/* Barakah autopay — fixed single-screen viewport, no page scroll */
:root {
  --cream: #ecf8ef;
  --cream-deep: #e0f0e5;
  --white: #ffffff;
  --text: #1e293b;
  --text-mid: #475569;
  --saffron: #2e7d32;
  --saffron-light: #43a047;
  --saffron-dark: #1b5e20;
  --radius-card: 14px;
  --radius-pill: 999px;
  --shadow: 0 8px 30px rgba(27, 94, 32, 0.12);
  --shadow-soft: 0 2px 12px rgba(15, 23, 42, 0.06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Noto Sans", sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.4;
  background: radial-gradient(
      120% 80% at 50% -20%,
      rgba(129, 199, 132, 0.35),
      transparent 55%
    ),
    linear-gradient(165deg, var(--cream) 0%, var(--cream-deep) 100%);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.viewport {
  height: 100dvh;
  max-height: 100dvh;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: var(--safe-bottom);
}

.top-bar {
  flex: 0 0 auto;
  padding: calc(10px + var(--safe-top) * 0.6) 18px 8px;
  text-align: center;
  background: transparent;
}

.brand {
  margin: 0;
  font-size: clamp(0.95rem, 3.8vw, 1.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--saffron-dark);
}

.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.8vw, 10px);
  padding: 0 clamp(14px, 5vw, 20px);
  overflow: hidden;
}

.card {
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(27, 94, 32, 0.08);
}

.card--hero {
  flex: 1 1 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
}

.video-wrap {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #0d2818, #1b5e20);
  border-radius: inherit;
  overflow: hidden;
}

.video-wrap--sound-pending {
  cursor: pointer;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.sound-toast {
  position: absolute;
  left: 50%;
  bottom: clamp(10px, 4vw, 20px);
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  padding: 8px 14px;
  margin: 0;
  border-radius: 999px;
  background: rgba(13, 40, 24, 0.92);
  color: #fff;
  font: inherit;
  font-size: clamp(0.72rem, 3vw, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  line-height: 1.25;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}

.sound-toast[hidden] {
  display: none;
}

.sound-toast__icon {
  flex-shrink: 0;
  font-size: 1.05em;
  line-height: 1;
  opacity: 0.95;
}

.sound-toast__text {
  text-align: center;
  line-height: 1.3;
}

.card--offer {
  flex: 0 0 auto;
  padding: clamp(8px, 2.2vw, 12px) clamp(10px, 3vw, 14px) 10px;
  position: relative;
}

.offer-title {
  margin: 0 0 2px;
  text-align: center;
  font-size: clamp(0.9rem, 3.8vw, 1.05rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.price-old {
  font-size: clamp(0.95rem, 3.6vw, 1.1rem);
  color: rgba(71, 85, 105, 0.75);
  text-decoration: line-through;
}

.price-new {
  font-size: clamp(1.35rem, 6.5vw, 1.75rem);
  font-weight: 900;
  color: var(--saffron);
  letter-spacing: -0.03em;
}

.offer-sub {
  margin: 0 0 6px;
  text-align: center;
  font-size: clamp(0.6rem, 2.4vw, 0.7rem);
  color: rgba(71, 85, 105, 0.75);
  font-weight: 500;
}

.marquee {
  overflow: hidden;
  height: clamp(22px, 6.5vw, 26px);
  margin: 0 -2px;
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 6%,
    #000 94%,
    transparent
  );
}

.marquee__track {
  display: flex;
  gap: 6px;
  width: max-content;
  animation: marquee 28s linear infinite;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.pill {
  flex-shrink: 0;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(236, 248, 239, 0.95);
  border: 1px solid rgba(102, 187, 106, 0.4);
  font-size: clamp(0.58rem, 2.5vw, 0.68rem);
  font-weight: 600;
  color: var(--text);
}

.tagline {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: clamp(0.62rem, 2.5vw, 0.72rem);
  font-weight: 600;
  color: rgba(71, 85, 105, 0.92);
}

.flag {
  font-size: 0.85rem;
}

.register-status {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: clamp(0.78rem, 3vw, 0.88rem);
  font-weight: 700;
  color: var(--saffron-dark);
  background: rgba(129, 199, 132, 0.22);
  border: 1px solid rgba(46, 125, 50, 0.2);
  border-radius: 12px;
  animation: statusPop 0.35s ease;
}

.register-status[hidden] {
  display: none !important;
}

.register-status__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--saffron);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
}

.footer {
  flex: 0 0 auto;
  padding: 8px clamp(14px, 5vw, 20px) calc(12px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.55));
}

.footer-pay {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-pay[hidden] {
  display: none !important;
}

.upi-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  background: var(--white);
  border-radius: 12px;
  border: 1px solid rgba(71, 85, 105, 0.12);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  -webkit-tap-highlight-color: transparent;
}

.upi-box:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 2px;
}

.upi-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: contain;
}

.upi-label {
  flex: 1;
  font-size: clamp(0.8rem, 3vw, 0.9rem);
  font-weight: 600;
}

.upi-change {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  gap: 2px;
}

.cta {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: clamp(0.85rem, 3.5vw, 0.95rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, var(--saffron-light), var(--saffron-dark));
  box-shadow: 0 6px 20px rgba(27, 94, 32, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.cta--hero {
  font-size: clamp(0.92rem, 3.8vw, 1.02rem);
  min-height: 52px;
}

.cta:active:not(:disabled) {
  transform: scale(0.98);
}

.cta:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.cta .cta-emoji {
  font-size: 1.05rem;
}

.cta--loading .cta-emoji {
  width: 19px;
  height: 19px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  font-size: 0;
}

#signup-btn[hidden] {
  display: none !important;
}

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

@keyframes statusPop {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  z-index: 90;
  animation: fadeIn 0.2s ease;
  backdrop-filter: blur(3px);
}

.backdrop[hidden] {
  display: none !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: linear-gradient(180deg, #f4fbf6 0%, var(--cream) 100%);
  border-radius: 20px 20px 0 0;
  padding: 8px 20px calc(20px + var(--safe-bottom));
  max-width: 440px;
  margin: 0 auto;
  animation: slideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.14);
}

.sheet[hidden] {
  display: none !important;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.sheet__handle {
  width: 36px;
  height: 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.1);
  margin: 4px auto 14px;
}

.sheet__title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
}

.sheet__title--center {
  text-align: center;
}

.sheet__sub {
  margin: 0 0 14px;
  font-size: 0.86rem;
  color: var(--text-mid);
}

.phone-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid rgba(71, 85, 105, 0.15);
  border-radius: 12px;
  padding: 2px 12px;
  margin-bottom: 8px;
}

.phone-cc {
  font-weight: 800;
  color: var(--text-mid);
  font-size: 0.95rem;
}

.phone-field input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.05rem;
  padding: 11px 4px;
  min-width: 0;
  font-family: inherit;
}

.phone-field input:focus {
  outline: none;
}

.field-error {
  color: #b91c1c;
  font-size: 0.8rem;
  margin: 0 0 10px;
}

.btn-primary {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 1rem;
  background: linear-gradient(180deg, var(--saffron-light), var(--saffron-dark));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(27, 94, 32, 0.3);
}

.upi-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  max-height: min(52vh, 380px);
  overflow-y: auto;
}

.upi-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border-radius: 12px;
  cursor: pointer;
  border: 1.5px solid transparent;
  margin-bottom: 4px;
}

.upi-list li[aria-selected="true"] {
  border-color: var(--saffron);
  background: rgba(129, 199, 132, 0.12);
}

.upi-list img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: contain;
}

.upi-list span {
  font-weight: 600;
}

.qrcode {
  display: flex;
  justify-content: center;
  margin: 12px 0;
  min-height: 200px;
  align-items: center;
}

.qr-wait {
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-mid);
}

.sheet--success {
  text-align: center;
  padding-top: 24px;
}

.success-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 1.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.success-text {
  margin: 0 0 18px;
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.45;
}

.btn-store {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--saffron-light), var(--saffron-dark));
  color: #fff !important;
  font-weight: 800;
  text-decoration: none;
  font-size: 0.95rem;
  box-shadow: 0 4px 16px rgba(27, 94, 32, 0.3);
}

.toast {
  position: fixed;
  bottom: calc(88px + var(--safe-bottom));
  left: 16px;
  right: 16px;
  max-width: 400px;
  margin: 0 auto;
  padding: 11px 14px;
  background: #0f172a;
  color: #fff;
  border-radius: 12px;
  font-size: 0.84rem;
  z-index: 200;
  text-align: center;
  animation: toastIn 0.25s ease;
}

.toast[hidden] {
  display: none !important;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-height: 620px) {
  .top-bar {
    padding-top: calc(6px + var(--safe-top) * 0.5);
    padding-bottom: 4px;
  }

  .brand {
    font-size: 0.88rem;
  }

  .stage {
    gap: 4px;
  }

  .card--offer {
    padding: 6px 9px 8px;
  }

  .offer-title {
    font-size: 0.82rem;
  }

  .price-new {
    font-size: 1.25rem;
  }

  .tagline {
    margin-top: 4px;
    font-size: 0.58rem;
  }

  .marquee {
    height: 20px;
  }

  .pill {
    padding: 3px 7px;
    font-size: 0.55rem;
  }

  .register-status {
    padding: 6px 10px;
    font-size: 0.72rem;
  }

  .footer {
    padding-top: 6px;
    gap: 8px;
  }

  .cta--hero {
    min-height: 48px;
  }
}

@media (min-width: 480px) {
  .viewport,
  .sheet {
    max-width: 400px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track {
    animation: none;
  }

  .cta .cta-emoji {
    animation: none;
  }

  .register-status {
    animation: none;
  }
}
