*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding: 16px;
  -webkit-text-size-adjust: 100%;
}

/* ── SCREENS ── */
.screen { display: none; width: 100%; max-width: 480px; }
.screen.active { display: flex; flex-direction: column; align-items: center; }

/* ── CARD SHELL ── */
.card {
  background: #ffffff;
  border-radius: 20px;
  padding: 36px 32px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(10, 60, 20, 0.15);
}

/* ── HEADER ── */
.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.card-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: linear-gradient(135deg, #0a3d16, #145a28);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon svg { width: 22px; height: 22px; fill: #fff; }

.card-header h1 { font-size: 1.3rem; font-weight: 700; color: #0a3d16; }
.card-header p  { font-size: 0.78rem; color: #1a6b30; margin-top: 2px; }

.divider { height: 1px; background: #c5dbc9; margin-bottom: 24px; }

/* ── FORM ── */
.form-group { margin-bottom: 20px; }

label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: #0a3d16;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 7px;
}

.input-wrap { position: relative; }

.input-wrap svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  fill: #2d7a45;
  pointer-events: none;
}

input {
  width: 100%;
  padding: 13px 12px 13px 40px;
  border: 1.8px solid #a8cbb0;
  border-radius: 10px;
  font-size: 1rem;
  color: #0a3d16;
  background: #f4faf5;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  letter-spacing: 0.03em;
  -webkit-appearance: none;
  appearance: none;
}

input::placeholder { color: #7aab88; letter-spacing: 0; }

input:focus {
  border-color: #0a3d16;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(10, 61, 22, 0.15);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.submit-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #0a3d16, #145a28);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  letter-spacing: 0.04em;
  transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(10, 61, 22, 0.35);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.submit-btn:hover  { opacity: 0.92; box-shadow: 0 6px 22px rgba(10, 61, 22, 0.45); }
.submit-btn:active { transform: scale(0.97); }

.secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 0.75rem;
  color: #1a6b30;
}

.secure-note svg { width: 13px; height: 13px; fill: #1a6b30; }

/* ── LOADING SCREEN ── */
#loadingScreen .card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  gap: 24px;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #a8cbb0;
  border-top-color: #0a3d16;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1rem;
  font-weight: 600;
  color: #0a3d16;
  letter-spacing: 0.04em;
}

.loading-dots::after {
  content: '';
  animation: dots 1.4s steps(4, end) infinite;
}

@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}

/* ── DECLINED SCREEN ── */
#declinedScreen .card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  gap: 20px;
  text-align: center;
}

.x-circle {
  width: 72px;
  height: 72px;
  background: #ffebee;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pop 0.4s ease;
}

@keyframes pop {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1);   opacity: 1; }
}

.x-circle svg { width: 36px; height: 36px; fill: #e53935; }

.declined-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #c62828;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

/* ── MOBILE RESPONSIVENESS ── */

/* Small phones: 320px – 374px (iPhone SE, Galaxy A series, small Androids) */
@media (max-width: 374px) {
  body { padding: 10px; }

  .card { padding: 24px 18px; border-radius: 16px; }

  .card-header h1 { font-size: 1.1rem; }
  .card-header p  { font-size: 0.72rem; }

  input { font-size: 0.92rem; padding: 12px 10px 12px 38px; }

  .row { gap: 10px; }

  .submit-btn { font-size: 0.95rem; padding: 13px; }

  .declined-title { font-size: 1.1rem; }
}

/* Standard phones: 375px – 480px */
@media (min-width: 375px) and (max-width: 480px) {
  body { padding: 12px; }
  .card { padding: 28px 22px; }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  body { align-items: flex-start; padding: 12px; }
  .card { padding: 20px 24px; }
  .card-header { margin-bottom: 16px; }
  .divider { margin-bottom: 14px; }
  .form-group { margin-bottom: 14px; }
  #loadingScreen .card,
  #declinedScreen .card { min-height: 160px; }
}

/* Tablets and up: keep card contained */
@media (min-width: 481px) {
  body { padding: 24px; }
}
