/*
  Solace web design system — single source of truth for every page
  (index, buy, privacy, terms, refund, about, contact). Light base, one
  accent, 2-hue signature gradient used sparingly. One fluid responsive
  layout per page (no separate mobile/desktop versions). Token-driven.
*/
:root {
  /* Color — light, restrained: neutral ramp + one accent */
  --canvas: #F6F9FC;
  --surface: #FFFFFF;
  --ink: #0A2540;            /* primary text */
  --slate: #425466;          /* secondary text */
  --muted: #6B7A8D;          /* tertiary */
  --hairline: #E3E8EE;
  --pill: #EEF2F7;
  --accent: #635BFF;
  --accent-press: #4F46E5;
  --success: #16A34A;
  --error: #DC2626;
  /* Signature gradient — 2 hues only */
  --grad-a: #635BFF;
  --grad-b: #8A7CFF;
  /* Spacing scale */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
  /* Radius */
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-pill: 999px;
  /* Elevation */
  --e-1: 0 1px 2px rgba(10,37,64,0.06);
  --e-2: 0 10px 30px -14px rgba(10,37,64,0.18);
  --e-3: 0 24px 54px -28px rgba(10,37,64,0.20);
  /* Motion */
  --t-fast: 120ms; --t: 200ms; --t-slow: 360ms; --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* Containers */
  --doc-max: 720px; --page-max: 1080px; --card-max: 420px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--canvas); color: var(--ink);
  font-family: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; line-height: 1.6; font-size: 16px;
  min-height: 100vh; display: flex; flex-direction: column;
  /* Contain off-canvas third-party widgets (Firebase's reCAPTCHA badge is
     position:fixed and parked past the right edge) so they never add a
     horizontal scrollbar on narrow screens. `clip` (not `hidden`) keeps
     position:sticky on the header working. */
  overflow-x: clip;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.container { width: 100%; max-width: var(--page-max); margin: 0 auto; padding-inline: clamp(20px, 5vw, 40px); }
.hidden { display: none !important; }
.mt-3 { margin-top: var(--sp-3); }
main { flex: 1 0 auto; }

/* ---------- Shared header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,0.82);
  -webkit-backdrop-filter: saturate(180%) blur(10px); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.site-header .inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.wordmark { display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: 800; font-size: 19px; letter-spacing: -0.02em; color: var(--ink); }
.brand-logo { height: 22px; width: auto; display: block; }
.wordmark:hover { text-decoration: none; }
.logout-link { color: var(--slate); font-size: 14px; font-weight: 600; }
/* "Get the app · Coming soon" header badge (public). */
.app-cta { font-size: 13px; font-weight: 600; color: var(--accent); background: rgba(99, 91, 255, 0.10); padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.logout-link:hover { color: var(--ink); text-decoration: none; }

/* Read-only profile chip + card (signed-in) */
.header-right { display: flex; align-items: center; gap: 16px; position: relative; }
.chip-btn { display: inline-flex; align-items: center; gap: 8px; width: auto; margin: 0; padding: 4px 6px; background: none; border: 0; cursor: pointer; color: var(--ink); font-weight: 600; font-size: 14px; }
.chip-btn:hover:not(:disabled) { background: none; }
.avatar-sm, .avatar-lg { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; flex: none; }
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.profile-card { position: absolute; top: calc(100% + 10px); right: 0; width: 260px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md); box-shadow: var(--e-2); padding: 16px; z-index: 30; }
.pc-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--hairline); }
.pc-alias { font-weight: 700; font-size: 16px; color: var(--ink); }
.pc-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 14px; color: var(--slate); }
.pc-row strong { color: var(--ink); }
.pc-note { margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.pc-close { position: absolute; top: 8px; right: 10px; width: auto; margin: 0; padding: 2px 6px; background: none; border: 0; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; }
.pc-close:hover:not(:disabled) { background: none; color: var(--ink); }
.pc-logout { display: block; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline); }
#chip-alias { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .profile-card { position: fixed; left: 16px; right: 16px; top: 64px; width: auto; } }

/* ---------- Shared footer ---------- */
.site-footer { border-top: 1px solid var(--hairline); background: var(--surface); margin-top: auto; }
.site-footer .inner { padding-block: 28px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; flex-wrap: wrap; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.foot-links a { color: var(--muted); font-size: 13px; font-weight: 500; padding: 2px 0; }
.foot-links a:hover { color: var(--ink); }
/* Subtle middot separators between links — premium, single centered row. */
.foot-links a + a { margin-left: 18px; position: relative; }
.foot-links a + a::before { content: "·"; position: absolute; left: -10px; color: var(--muted); opacity: 0.55; }
.foot-entity { width: 100%; color: var(--muted); font-size: 12px; }
/* Separator line only when the doc-nav row sits above the entity line
   (checkout). On entity-only footers (doc pages) there's no stray rule. */
.foot-links + .foot-entity { margin-top: 2px; }
.site-footer .inner.center { justify-content: center; text-align: center; }
.site-copy { margin: 0; color: var(--slate); font-size: 12.5px; }

/* ---------- Document archetype (legal / about / contact) ---------- */
.doc { max-width: var(--doc-max); margin: 0 auto; padding-inline: clamp(20px, 5vw, 32px); padding-block: clamp(40px, 8vw, 72px); }
.doc h1 { margin: 0 0 20px; font-size: clamp(28px, 5vw, 40px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); }
.doc h2 { margin: 32px 0 12px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.doc p { margin: 0 0 16px; color: var(--slate); font-size: 16.5px; }
.doc strong { color: var(--ink); font-weight: 600; }
/* A paragraph that opens with a bold label reads as a titled section. */
.doc p > strong:first-child { display: block; margin-top: 6px; font-size: 17px; letter-spacing: -0.01em; }
.doc p { margin: 0 0 18px; }

/* ---------- Auth archetype (home / buy) ---------- */
.auth { flex: 1 0 auto; position: relative; overflow: hidden; display: flex; align-items: center; padding-block: clamp(32px, 6vw, 72px); }
.auth::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(50% 55% at 14% 4%, rgba(99,91,255,0.22), transparent 60%),
    radial-gradient(52% 55% at 88% 10%, rgba(138,124,255,0.18), transparent 62%),
    radial-gradient(42% 48% at 62% 102%, rgba(63,200,214,0.10), transparent 60%);
}
.auth-inner {
  position: relative; z-index: 1; width: 100%; max-width: var(--page-max); margin: 0 auto;
  padding-inline: clamp(20px, 5vw, 40px);
  display: flex; flex-direction: column; align-items: center; gap: clamp(28px, 5vw, 48px);
}
.auth-intro { max-width: 34ch; text-align: center; }
.brand-lg { font-weight: 800; font-size: clamp(20px, 2.2vw, 24px); letter-spacing: -0.02em; }
.auth-title { font-weight: 800; font-size: clamp(32px, 5vw, 52px); letter-spacing: -0.03em; line-height: 1.04; margin: 14px 0 0; }
.auth-sub { color: var(--slate); font-size: clamp(15px, 1.6vw, 19px); margin: 14px auto 0; max-width: 36ch; }
.auth-card {
  width: 100%; max-width: var(--card-max); background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--e-3);
  padding: clamp(26px, 4vw, 38px);
}
@media (min-width: 900px) {
  .auth-inner { flex-direction: row; justify-content: center; align-items: center; gap: clamp(40px, 6vw, 80px); }
  .auth-intro { text-align: left; flex: 0 1 32ch; max-width: 32ch; }
  .auth-sub { margin-left: 0; }
  .auth-card { flex: 0 0 auto; }
}

/* ---------- Auth components (steps / inputs / buttons / packs) ---------- */
main.auth, .auth-card main { display: block; }
.card { background: transparent; border: none; border-radius: 0; padding: 0; box-shadow: none; }
.step-h { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 4px; color: var(--ink); }
.step-help { color: var(--slate); font-size: 14px; margin: 0 0 18px; }
label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--slate); margin-bottom: 8px; }
input[type="tel"], input[type="text"] {
  width: 100%; padding: 13px 14px; font-size: 16px; font-family: inherit;
  border: 1px solid var(--hairline); border-radius: var(--r-sm); background: var(--surface);
  outline: none; color: var(--ink); transition: border-color var(--t), box-shadow var(--t);
}
input::placeholder, textarea::placeholder { color: #9AA7B5; }
input[type="text"].otp { letter-spacing: 0.4em; text-align: center; font-size: 22px; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,91,255,0.18); }
.phone-field { display: flex; align-items: stretch; }
.phone-field .cc {
  display: flex; align-items: center; padding: 0 14px; font-size: 16px; font-weight: 600;
  color: var(--slate); background: var(--pill); border: 1px solid var(--hairline); border-right: 0;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.phone-field input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
textarea {
  width: 100%; padding: 13px 14px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--hairline); border-radius: var(--r-sm); background: var(--surface);
  outline: none; color: var(--ink); resize: vertical; transition: border-color var(--t), box-shadow var(--t);
}
button {
  width: 100%; padding: 14px 16px; font-size: 15px; font-weight: 600; font-family: inherit;
  border: 1px solid transparent; border-radius: var(--r-sm); cursor: pointer;
  background: var(--accent); color: #fff; margin-top: var(--sp-4);
  transition: background var(--t), transform var(--t-fast);
}
button:hover:not(:disabled) { background: var(--accent-press); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.secondary { background: transparent; color: var(--slate); border: 1px solid var(--hairline); font-weight: 500; }
button.secondary:hover:not(:disabled) { background: var(--pill); }
.err { color: var(--error); font-size: 14px; margin-top: 12px; }
/* Auto-fit: as many equal columns as fit (floor 140px so a pack tile never
   squeezes below its "₹5000" content); collapses to one column on the
   narrowest phones. No hardcoded column count → adapts to any width. */
.pack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: var(--sp-3); margin: var(--sp-4) 0; }
.pack {
  padding: 16px; border: 1px solid var(--hairline); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer; text-align: center;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.pack:hover { border-color: var(--accent); box-shadow: var(--e-2); transform: translateY(-2px); }
.pack.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.pack-coins { font-size: 24px; font-weight: 700; color: var(--ink); }
.pack-price { color: var(--slate); font-size: 14px; margin-top: 4px; }
.status-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.badge { padding: 4px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; }
.badge.pending { background: var(--pill); color: var(--slate); }
.badge.credited { background: rgba(22,163,74,0.14); color: var(--success); }
.badge.failed { background: rgba(220,38,38,0.14); color: var(--error); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--hairline); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Sign-in legal block (consent + reCAPTCHA) — only shown on sign-in steps. */
.foot { padding: 14px 0 0; text-align: center; }
.consent { margin: 0; color: var(--slate); font-size: 13px; line-height: 1.6; }
.consent a { color: var(--accent); }
.auth-foot { text-align: center; padding-top: 18px; color: var(--muted); font-size: 12px; }
/* Invisible reCAPTCHA: hide Google's badge; the disclosure keeps it compliant. */
.grecaptcha-badge { visibility: hidden; }
.recaptcha-note { margin: 7px 0 0; color: var(--slate); font-size: 12px; line-height: 1.45; }
.recaptcha-note a { color: var(--slate); text-decoration: underline; }

/* ---------- Micro-interactions ---------- */
.btn-spin { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-right: 8px; border: 2px solid rgba(255,255,255,0.5); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
button.secondary .btn-spin { border-color: rgba(66,84,102,0.35); border-top-color: var(--slate); }
.step-in { animation: stepIn var(--t-slow) var(--ease); }
@keyframes stepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.resend { margin-top: 12px; font-size: 13px; color: var(--muted); text-align: center; }
.resend .link { display: inline; width: auto; margin: 0; padding: 0; background: none; border: none; color: var(--muted); font-weight: 500; cursor: pointer; }
.resend .link:hover:not(:disabled) { background: none; color: var(--ink); text-decoration: underline; }
.pack-skel { height: 78px; border: 1px solid var(--hairline); border-radius: var(--r-sm); background: linear-gradient(100deg, #F2F4F7 30%, #E7ECF2 50%, #F2F4F7 70%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.check { width: 44px; height: 44px; }
.check circle { fill: none; stroke: var(--success); stroke-width: 2; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw 0.5s var(--ease) forwards; }
.check path { fill: none; stroke: var(--success); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw 0.4s 0.35s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .btn-spin, .step-in, .pack-skel, .spinner, .check circle, .check path { animation: none; }
  .check circle, .check path { stroke-dashoffset: 0; }
}

/* My tickets list (/tickets) */
.ticket-row { border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 14px 16px; margin-top: 12px; }
.ticket-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ticket-num { color: var(--ink); font-size: 15px; letter-spacing: 0.01em; }
.ticket-status { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.ticket-status.open { color: var(--accent); background: rgba(99, 91, 255, 0.10); }
.ticket-status.resolved { color: var(--success); background: rgba(22, 163, 74, 0.10); }
.ticket-meta { margin-top: 6px; color: var(--muted); font-size: 13px; }

/* Coin-buy guide pane (left of the pack card on desktop; stacked, compact
   2-col grid on mobile). Shown only on the pack step (synced in JS). */
.buy-guide { width: 100%; }
@media (min-width: 900px) { .buy-guide { flex: 0 1 36ch; max-width: 38ch; } }
/* All guide sizes are fluid (clamp) so the pane scales continuously from the
   narrowest phone to the desktop side-column — no per-breakpoint px to keep
   in sync. The clamp floors equal the old mobile-override values, so the
   ≤899px view is unchanged; sizes grow smoothly toward the desktop max. */
.bg-title { margin: 0; font-size: clamp(20px, 3vw, 30px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); }
.bg-sub { margin: 8px 0 0; color: var(--slate); font-size: clamp(13.5px, 1.4vw, 15px); }
.bg-list { list-style: none; margin: clamp(16px, 2.4vw, 22px) 0 0; padding: 0; display: flex; flex-direction: column; gap: clamp(12px, 1.4vw, 14px); }
.bg-list li { display: flex; gap: var(--sp-3); align-items: center; }
.bg-list strong { display: block; color: var(--ink); font-size: 14.5px; }
.bg-list div span { color: var(--muted); font-size: clamp(12.5px, 1.3vw, 13px); }
.bg-ic { flex: none; width: clamp(32px, 4.2vw, 36px); height: clamp(32px, 4.2vw, 36px); border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; }
.bg-ic svg { width: clamp(18px, 2.3vw, 20px); height: clamp(18px, 2.3vw, 20px); }
.ic-coin .coin { width: clamp(18px, 2.3vw, 20px); height: clamp(18px, 2.3vw, 20px); margin: 0; vertical-align: middle; }
.ic-rooms { background: rgba(99, 91, 255, 0.12); color: #635BFF; }
.ic-voice { background: rgba(2, 132, 199, 0.12); color: #0284C7; }
.ic-gift  { background: rgba(219, 39, 119, 0.12); color: #DB2777; }
.ic-coin  { background: rgba(227, 176, 74, 0.18); }
.ic-lock  { background: rgba(22, 163, 74, 0.12); color: #16A34A; }
.bg-trust { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.bg-trust p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
/* Mobile: the guide stacks above the card. Sizes are handled by the fluid
   clamp() base rules above; the only thing this breakpoint owns is the
   container gutter so the guide + card never touch the viewport edge. */
@media (max-width: 899px) {
  .auth-inner { padding-inline: clamp(16px, 4vw, 22px); box-sizing: border-box; }
  .buy-guide { margin-bottom: 6px; }
  .bg-trust p { font-size: 12px; }
}

/* Coin glyph (ported from the app) used inline like the ₹ prefix. */
.coin { display: inline-block; width: 1em; height: 1em; vertical-align: -0.14em; margin-right: 3px; }

/* Support success confirmation */
.ok-title { margin: 0 0 8px; color: var(--success); font-size: 18px; font-weight: 700; }

/* Expandable ticket row + message thread (/tickets) */
.ticket-head { width: 100%; margin: 0; padding: 0; background: none; border: 0; cursor: pointer; display: flex; align-items: center; gap: 10px; font: inherit; color: inherit; }
.ticket-head:hover:not(:disabled) { background: none; }
.ticket-head .ticket-num { flex: 1; text-align: left; }
.ticket-chevron { color: var(--muted); font-size: 14px; transition: transform 0.15s ease; }
.ticket-head[aria-expanded="true"] .ticket-chevron { transform: rotate(180deg); }
.ticket-detail { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.msg { border-radius: var(--r-md); padding: 10px 12px; max-width: 90%; }
.msg-who { font-size: 12px; font-weight: 700; color: var(--slate); margin-bottom: 2px; }
.msg-body { font-size: 14px; color: var(--ink); white-space: pre-wrap; }
.msg-when { font-size: 11px; color: var(--muted); margin-top: 4px; }
.msg-you { align-self: flex-end; background: rgba(99, 91, 255, 0.08); }
.msg-support { align-self: flex-start; background: var(--hairline); }
.msg-system { align-self: center; background: none; color: var(--muted); }
