/* ==========================================================================
   Fantasy Sports lander — "Floodlit pitch after dark"
   Deep field-green/charcoal, thin pitch-marking rules, one sodium-amber
   accent used only on the CTA, the active PIN box, and focus states.
   All rules live here — the CSP has no 'unsafe-inline' for styles.
   ========================================================================== */

/* ---- Self-hosted type: IBM Plex Sans Arabic + IBM Plex Sans (Latin) ----
   Same type family, drawn together by the same foundry, so the language
   toggle does not feel like two different products. No system-font
   fallback chain is trusted for Arabic — Noto Kufi / Noto Sans Arabic /
   Tahoma all carry different descender metrics. */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-arabic-400.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-arabic-600.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-arabic-700.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
/* IBM Plex Sans latin is shipped upstream as one variable file (wght 100-700).
   Registering it three times under discrete weights is the same technique
   Google Fonts itself serves it with: the engine sets the wght axis to the
   value each @font-face block declares. One file on disk, three weights. */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-latin-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-latin-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-latin-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122;
}

/* ---- Tokens ---- */
:root {
  --bg: #0a1210;
  --bg-hero-glow: radial-gradient(ellipse 900px 460px at 50% -12%, rgba(255, 182, 39, 0.16), transparent 62%);
  --surface: #101c17;
  --surface-2: #16241d;
  --surface-input: #0d1713;
  --line: rgba(233, 241, 236, 0.10);
  --line-strong: rgba(233, 241, 236, 0.20);
  --text: #f4f2e9;
  --text-muted: #93a79b;
  --text-dim: #5d7267;
  --accent: #ffb627;
  --accent-strong: #ffcb66;
  --accent-ink: #1c1002;
  --danger: #ff6b5b;
  --danger-ink: #2a0e09;
  --focus-ring: rgba(255, 182, 39, 0.45);

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --font-ar: 'IBM Plex Sans Arabic', 'IBM Plex Sans', sans-serif;
  --font-en: 'IBM Plex Sans', 'IBM Plex Sans Arabic', sans-serif;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.75rem;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  padding: 0;
}
h1, h2, h3, p, figure { margin: 0; }
button { font: inherit; color: inherit; }
input { font: inherit; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }

/* ---- Base ---- */
html {
  font-size: 100%;
  background: var(--bg);
}
html[lang='ar'] { font-family: var(--font-ar); }
html[lang='en'] { font-family: var(--font-en); }

body {
  background: var(--bg-hero-glow), var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 27.5rem;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-7);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Header / lang toggle ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--surface);
  flex-shrink: 0;
}
.lang-toggle-opt {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  /* min-height keeps the tap target >=44px even though the visual pill
     stays compact — a mobile-only, mid-range-Android audience needs a
     forgiving hit area here more than a slim toggle. */
  min-height: var(--space-7);
  padding: 0 var(--space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.lang-toggle-opt[aria-current='true'] {
  background: var(--accent);
  color: var(--accent-ink);
}
.lang-toggle-opt:not([aria-current='true']):hover {
  color: var(--text);
}
.lang-toggle-opt:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  padding-top: var(--space-6);
  padding-bottom: var(--space-5);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -13rem;
  left: 50%;
  transform: translateX(-50%);
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  pointer-events: none;
}
.hero-inner {
  position: relative;
}
.hero-title {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-2);
}
.hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 22rem;
}

.pitch-rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--space-5) 0;
}

/* ---- Steps ---- */
.step { display: block; }
[data-step='phone'] .step-pin { display: none; }
[data-step='pin'] .step-phone { display: none; }

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.field-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Phone entry: prefix chip + digits, pinned LTR so the digits never
   reflow backwards under an RTL document direction. */
.phone-group {
  direction: ltr;
  display: flex;
  align-items: stretch;
  background: var(--surface-input);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.phone-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border-right: 1px solid var(--line-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.phone-input {
  direction: ltr;
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.9rem var(--space-4);
  font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  outline: none;
  text-align: left;
}
.phone-input::placeholder {
  color: var(--text-dim);
}

.pin-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-2);
}

.pin-context {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}
.pin-context strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  /* Pinned so a recapped subscriber number never reorders under RTL. */
  direction: ltr;
  unicode-bidi: embed;
}

/* PIN boxes: pinned LTR — without this the first typed digit lands in the
   rightmost box under an RTL document and entry advances leftward. */
.pin-grid {
  direction: ltr;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.pin-box {
  direction: ltr;
  width: 100%;
  aspect-ratio: 1 / 1;
  text-align: center;
  font-size: 1.375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--surface-input);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.pin-box:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
  transform: translateY(-1px);
}
.pin-box.is-filled {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.step-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.link-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-strong);
  cursor: pointer;
}
.link-btn:disabled {
  color: var(--text-dim);
  cursor: not-allowed;
}
.link-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}
.link-btn--muted {
  color: var(--text-muted);
}

/* ---- Disclosure card: the compliance gate, not a design flourish.
   Always sits above the CTA button regardless of step. Corner ticks use
   physical left/right — inside an RTL block, inset-inline-end resolves to
   the LEFT and would read backwards on a full-width card. ---- */
.disclosure {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.disclosure::before,
.disclosure::after {
  content: '';
  position: absolute;
  top: -1px;
  width: 0.85rem;
  height: 0.85rem;
  border-top: 2px solid var(--accent);
  pointer-events: none;
}
.disclosure::before {
  left: -1px;
  border-left: 2px solid var(--accent);
  border-top-left-radius: 4px;
}
.disclosure::after {
  right: -1px;
  border-right: 2px solid var(--accent);
  border-top-right-radius: 4px;
}
.disclosure-price {
  font-size: 1.1875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--space-2);
}
.disclosure-unsub {
  font-size: 1rem;
  color: var(--text-muted);
}
.disclosure-pending {
  font-size: 1rem;
  color: var(--text-muted);
}

.consent {
  font-size: 0.8125rem;
  color: var(--text-dim);
  margin-top: var(--space-3);
  margin-bottom: var(--space-5);
}

/* ---- CTA ---- */
.cta {
  appearance: none;
  border: 0;
  width: 100%;
  padding: 1rem var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.0625rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.08s ease, opacity 0.15s ease;
}
.cta:hover:not(:disabled) { background: var(--accent-strong); }
.cta:active:not(:disabled) { transform: scale(0.98); }
.cta:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}
.cta:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---- Alerts ---- */
.alert {
  display: none;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--danger);
  background: rgba(255, 107, 91, 0.10);
  border: 1px solid rgba(255, 107, 91, 0.35);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
}
.alert.is-visible { display: block; }
.alert.is-info {
  color: var(--accent-strong);
  background: rgba(255, 182, 39, 0.10);
  border-color: rgba(255, 182, 39, 0.35);
}

/* ---- Success page ---- */
.success-card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-4);
  text-align: center;
  margin-top: var(--space-6);
}
.success-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 700;
}
.success-title {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
}
.success-body {
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}

/* ---- Motion: one entrance, staggered ---- */
.reveal {
  opacity: 0;
  animation: rise 0.6s ease forwards;
}
.reveal--1 { animation-delay: 0.02s; }
.reveal--2 { animation-delay: 0.10s; }
.reveal--3 { animation-delay: 0.18s; }
.reveal--4 { animation-delay: 0.26s; }
.reveal--5 { animation-delay: 0.34s; }

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

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

/* ---- Small screens keep single column by default; widen the breathing
   room slightly above phone width. ---- */
@media (min-width: 30rem) {
  .page { padding-top: var(--space-6); }
  .pin-box { font-size: 1.5rem; }
}

/* ---- iPhone-SE-class / narrow-Android widths: the default pin-grid gap
   (0.5rem x5) leaves each of the 6 boxes under the 44px touch-target
   guideline at a 320px viewport. Tighten the gap only down here so wider
   phones keep the more generous default spacing. ---- */
@media (max-width: 23rem) {
  .pin-grid { gap: var(--space-1); }
}
