:root {
  --ink: #1E1B4B;
  --ink-soft: #4A4676;
  --paper: #F7F7F5;
  --card: #FFFFFF;
  --amber: #F5A524;
  --amber-dark: #C9860F;
  --line: #E7E5E0;
  --success: #16A34A;
  --success-bg: #EAF6EE;
  --radius: 14px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --maxw: 1140px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  font-family: var(--font-body);
  color: var(--ink);
}

/* ---------- Header / site nav ---------- */

.sitebar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.sitebar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo-key { color: var(--amber-dark); font-size: 20px; }

.site-nav {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: center;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.site-nav a:hover { color: var(--ink); }

.progress-track {
  height: 3px;
  background: var(--line);
}

.progress-fill {
  height: 100%;
  width: 16%;
  background: var(--amber);
  transition: width 0.35s ease;
}

.site-footer {
  text-align: center;
  padding: 28px;
  color: var(--ink-soft);
  font-size: 12.5px;
}

/* ---------- Main / screens ---------- */

.site-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 48px 32px 64px;
  min-height: 70vh;
}

.screen { display: none; animation: fadeIn 0.25s ease; }
.screen.active { display: block; }

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

/* ---------- Home / hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 56px;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--amber-dark);
  font-weight: 600;
}

h1 {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1.12;
  margin: 12px 0 16px;
}

h2 {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 0 0 8px;
}

h3 {
  font-family: var(--font-display);
  font-size: 15px;
  margin: 0 0 14px;
}

.lede {
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.65;
  margin: 0 0 28px;
  max-width: 480px;
}

.hero-actions { display: flex; gap: 12px; margin-bottom: 16px; }

.hero-visual { display: flex; justify-content: center; }

.key-card {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1.5;
  background: var(--ink);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.key-card::after {
  content: '⌁';
  position: absolute;
  right: -20px;
  bottom: -40px;
  font-size: 160px;
  color: rgba(245, 165, 36, 0.12);
  font-family: var(--font-display);
}

.key-glyph { font-size: 40px; color: var(--amber); }
.key-label {
  font-family: var(--font-display);
  color: #fff;
  letter-spacing: 0.08em;
  font-size: 14px;
  margin: 0;
}

.subhead {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 24px;
}

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

.trust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.trust-grid.wide { grid-template-columns: repeat(3, 1fr); max-width: 640px; }

.trust-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
}

.trust-icon { font-size: 22px; display: block; margin-bottom: 8px; }
.trust-card p { font-size: 13px; margin: 0; color: var(--ink-soft); }

/* ---------- Buttons ---------- */

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  border-radius: 10px;
  border: none;
  padding: 13px 22px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.btn:active { transform: scale(0.98); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 13.5px; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { opacity: 0.92; }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-outline:hover { border-color: var(--ink); }

.fineprint {
  font-size: 12.5px;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 14px;
}

.fineprint.left { text-align: left; }
.fineprint.center { text-align: center; }
.fineprint a { color: var(--ink); font-weight: 600; }

/* ---------- Centered card pages (signin, otp, success) ---------- */

.card-page {
  max-width: 420px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px 36px 30px;
}

.wide-page {
  max-width: 720px;
  margin: 0 auto;
}

.back-btn {
  background: none;
  border: none;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 0 0 18px;
  font-weight: 500;
}

.back-btn:hover { color: var(--ink); }

form label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 14px 0 6px;
  font-weight: 500;
}

form input, form select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 14.5px;
  font-family: var(--font-body);
  color: var(--ink);
}

form input:focus, form select:focus {
  outline: none;
  border-color: var(--amber-dark);
  box-shadow: 0 0 0 3px rgba(245, 165, 36, 0.18);
}

form .btn { margin-top: 22px; }

.field-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
}

.otp-row {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.otp-box {
  width: 100%;
  aspect-ratio: 1;
  text-align: center;
  font-size: 19px;
  font-family: var(--font-display);
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.otp-box:focus {
  outline: none;
  border-color: var(--amber-dark);
  box-shadow: 0 0 0 3px rgba(245, 165, 36, 0.18);
}

.resend { margin-top: 16px; }
#otpTimer { font-weight: 600; color: var(--ink); }

/* ---------- Plans ---------- */

.plans-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.plan-card {
  display: block;
  position: relative;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.plan-card input { position: absolute; opacity: 0; }

.plan-card.selected,
.plan-card:has(input:checked) {
  border-color: var(--amber-dark);
  background: #FFFBF2;
}

.plan-card.featured { transform: translateY(-6px); }

.badge {
  position: absolute;
  top: -11px;
  left: 16px;
  background: var(--ink);
  color: var(--amber);
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}

.plan-head { margin-bottom: 8px; }
.plan-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  display: block;
  margin-bottom: 4px;
}

.plan-price {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
}

.plan-price span {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.plan-desc { font-size: 12.5px; color: var(--ink-soft); margin: 0; }

/* ---------- Payment ---------- */

.pay-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 32px;
  align-items: start;
  max-width: 900px;
  margin: 0 auto;
}

.pay-main {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px;
}

.pay-summary-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  position: sticky;
  top: 90px;
}

.pay-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.pay-method {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  cursor: pointer;
}

.pay-method:has(input:checked) {
  border-color: var(--amber-dark);
  background: #FFFBF2;
}

.pay-icon { font-size: 16px; }

.method-panel {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-bottom: 8px;
}

.upi-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: start;
}

.upi-qr-block { text-align: center; }

.upi-qr {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.upi-caption { font-size: 12px; color: var(--ink-soft); margin: 10px 0 0; }

.or-label {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.order-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.order-summary.total {
  border-bottom: none;
  padding-top: 14px;
  font-size: 15px;
  font-weight: 600;
}

/* ---------- Processing / success ---------- */

.processing-wrap {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--ink-soft);
  font-size: 14px;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--amber-dark);
  animation: spin 0.8s linear infinite;
}

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

.success-wrap { text-align: center; }

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.receipt {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  margin: 20px 0 22px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  padding: 6px 0;
}

.receipt-row span { color: var(--ink-soft); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .plans-list { grid-template-columns: 1fr; }
  .plan-card.featured { transform: none; }
  .pay-layout { grid-template-columns: 1fr; }
  .pay-summary-panel { position: static; }
  .trust-grid.wide { grid-template-columns: 1fr 1fr; max-width: none; }
}

@media (max-width: 600px) {
  .site-main { padding: 32px 18px 48px; }
  h1 { font-size: 32px; }
  .card-page, .pay-main { padding: 24px; }
  .upi-grid { grid-template-columns: 1fr; text-align: center; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .sitebar-inner { flex-wrap: wrap; gap: 12px; }
  .site-nav { order: 3; width: 100%; justify-content: flex-start; gap: 18px; }
}

/* ---------- Banner carousel ---------- */

.carousel {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 40px;
}

.carousel-track {
  display: flex;
  transition: transform 0.4s ease;
}

.banner-slide {
  min-width: 100%;
  background: var(--ink);
  padding: 28px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.banner-slide::after {
  content: '⌁';
  position: absolute;
  right: -10px;
  bottom: -36px;
  font-size: 130px;
  color: rgba(245, 165, 36, 0.12);
  font-family: var(--font-display);
}

.slide-b { background: #2E2A63; }
.slide-c { background: #14123A; }

.eyebrow-light { color: var(--amber); }

.banner-title {
  font-family: var(--font-display);
  color: #fff;
  font-size: 20px;
  margin: 8px 0 4px;
  font-weight: 600;
}

.banner-copy {
  color: rgba(255,255,255,0.72);
  font-size: 13.5px;
  margin: 0;
  max-width: 360px;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.carousel-arrow:hover { background: rgba(255,255,255,0.28); }
.carousel-arrow.prev { left: 14px; }
.carousel-arrow.next { right: 14px; }

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  border: none;
  cursor: pointer;
  padding: 0;
}

.carousel-dot.active { background: var(--amber); }

/* ---------- Voucher + wallet toggle (payment screen) ---------- */

.voucher-block {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}

.voucher-block label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-weight: 500;
}

.voucher-row {
  display: flex;
  gap: 8px;
}

.voucher-row input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 13.5px;
  font-family: var(--font-body);
  color: var(--ink);
}

.voucher-row input:focus {
  outline: none;
  border-color: var(--amber-dark);
  box-shadow: 0 0 0 3px rgba(245, 165, 36, 0.18);
}

#voucherMsg { margin-top: 8px; min-height: 14px; }
#voucherMsg.success { color: var(--success); }
#voucherMsg.error { color: #C0392B; }

.wallet-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 16px;
  cursor: pointer;
}

.wallet-toggle input { width: auto; }
.wallet-toggle strong { color: var(--ink); }

/* ---------- Wallet screen ---------- */

.wallet-balance-card {
  background: var(--ink);
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 28px;
}

.wallet-balance-label {
  font-size: 12.5px;
  color: rgba(255,255,255,0.65);
}

.wallet-balance-amount {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--amber);
}

.section-label {
  font-family: var(--font-display);
  font-size: 14px;
  margin: 0 0 12px;
}

.topup-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.topup-chip {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink);
}

.topup-chip:hover { border-color: var(--amber-dark); }
.topup-chip.selected { border-color: var(--amber-dark); background: #FFFBF2; }

#customTopupInput {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 14.5px;
  font-family: var(--font-body);
  color: var(--ink);
}

#walletMsg { margin-top: 10px; }
#walletMsg.success { color: var(--success); }

.wallet-history {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallet-history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
}

.wallet-history-row .wh-desc { color: var(--ink-soft); }
.wallet-history-row .wh-amount { font-weight: 600; color: var(--success); }

@media (max-width: 600px) {
  .banner-slide { flex-direction: column; align-items: flex-start; text-align: left; padding: 22px; }
  .topup-grid { grid-template-columns: repeat(2, 1fr); }
}
