/* World Mobile Design System 2.0 — the subset these two pages need.
 *
 * Tokens are copied verbatim from earthnode-wrap (src/app.css and
 * design-system/{colors,typography}), so the scripts server, the eligibility
 * flow and the wrap app stay one visual system. Do not "improve" a value here;
 * change it in the design system and copy it down.
 *
 * Dark is the default. Light mode is an inversion of the neutral scale, not a
 * separate palette. Yellow is the ONLY chromatic brand colour and is reserved
 * for primary actions and selected state — never for decoration.
 */

@font-face {
  font-family: 'Aeonik';
  src: url('/public/assets/fonts/Aeonik-Regular.woff2') format('woff2'),
       url('/public/assets/fonts/Aeonik-Regular.woff') format('woff');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Aeonik';
  src: url('/public/assets/fonts/Aeonik-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Aeonik';
  src: url('/public/assets/fonts/Aeonik-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Aeonik';
  src: url('/public/assets/fonts/Aeonik-Light.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}

:root {
  --wm-yellow-600: #fff533;   /* primary CTA */
  --wm-yellow-500: #fff766;   /* CTA hover */
  --wm-red-500:   #ef4444;
  --wm-green-500: #22c55e;
  --wm-orange-500:#f97316;

  --font-sans: 'Aeonik', system-ui, -apple-system, sans-serif;

  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;

  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
}

:root, [data-theme='dark'] {
  --bg: #0a0a0a;
  --fg: #f5f5f5;
  --card: #141414;
  --card-hover: #1a1a1a;
  --border: #262626;
  --input: #1a1a1a;
  --muted: #a3a3a3;
  --destructive: #dc2626;
  --success: #22c55e;
  --warning: #f97316;
  color-scheme: dark;
}

[data-theme='light'] {
  --bg: #f5f5f5;
  --fg: #0a0a0a;
  --card: #ffffff;
  --card-hover: #f5f5f5;
  --border: #d4d4d4;
  --input: #e5e5e5;
  --muted: #525252;
  --destructive: #dc2626;
  --success: #16a34a;
  --warning: #ea580c;
  color-scheme: light;
}

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

/* A layout rule must never resurrect a hidden element: .otp-row sets
   display:flex, which outranks the UA sheet's [hidden]{display:none}. */
[hidden] { display: none !important; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

/* Type scale — {size}/{weight} from the design system */
.t-3xl { font-size: 36px; line-height: 40px; font-weight: 700; letter-spacing: -0.02em; }
.t-2xl { font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -0.02em; }
.t-xl  { font-size: 24px; line-height: 32px; font-weight: 700; }
.t-lg  { font-size: 20px; line-height: 28px; font-weight: 500; }
.t-base{ font-size: 16px; line-height: 24px; font-weight: 500; }
.t-sm  { font-size: 14px; line-height: 20px; font-weight: 400; }
.t-xs  { font-size: 12px; line-height: 16px; font-weight: 400; }
.muted { color: var(--muted); }

/* ── The yellow curtain ──────────────────────────────────────────────────
   Kept from the previous scripts page: it is the one piece of motion in the
   brand and it is what makes the first paint feel like World Mobile rather
   than a generic dark dashboard.
   Critically it is built so the page is READABLE WITHOUT JAVASCRIPT: the
   content is fully laid out and the curtain sits on top, sliding away on
   load. The old implementation translated the CONTENT off-screen and relied
   on JS to bring it back, which meant no JS, no page. */
.wm-curtain {
  position: fixed;
  inset: 0;
  background: var(--wm-yellow-600);
  z-index: 9999;
  transform: translateY(0);
  animation: wm-curtain-up 900ms cubic-bezier(.7,0,.3,1) 350ms forwards;
  pointer-events: none;
}
@keyframes wm-curtain-up {
  to { transform: translateY(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  .wm-curtain { animation: none; display: none; }
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.wrap { max-width: 880px; margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: 1120px; }

header.site {
  padding: 40px 24px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
}
.logo { width: 168px; height: auto; color: var(--fg); }

.hero { padding: 40px 0 8px; }
.hero h1 { font-size: 36px; line-height: 42px; font-weight: 700; letter-spacing: -0.02em; }
.hero p  { margin-top: 12px; color: var(--muted); max-width: 60ch; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 16px;
}
.card + .card { margin-top: 0; }
.card h2 { font-size: 20px; line-height: 28px; font-weight: 600; display: flex; align-items: center; gap: 12px; }
.card p  { color: var(--muted); margin-top: 8px; }

/* Step markers: the flow really is ordered, so the number carries meaning. */
.step {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--muted);
  font-size: 13px; font-weight: 700;
}
.card.active .step { background: var(--wm-yellow-600); border-color: var(--wm-yellow-600); color: #0a0a0a; }
.card.done   .step { background: var(--success); border-color: var(--success); color: #0a0a0a; }
.card.locked { opacity: .5; pointer-events: none; }

/* ── Controls ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--wm-yellow-600);
  color: #0a0a0a;
  border: 1px solid var(--wm-yellow-600);
  border-radius: var(--radius-full);
  padding: 10px 20px;
  font: 500 15px/20px var(--font-sans);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover:not(:disabled) { background: var(--wm-yellow-500); border-color: var(--wm-yellow-500); }
.btn.ghost {
  background: transparent; color: var(--fg); border-color: var(--border);
}
.btn.ghost:hover:not(:disabled) { background: var(--card-hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
label .opt { color: var(--muted); font-weight: 400; }

input, select {
  width: 100%;
  background: var(--input);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  font: 400 15px/22px var(--font-sans);
}
input::placeholder { color: var(--muted); }
:is(input, select, button, a, [tabindex]):focus-visible {
  outline: 2px solid var(--wm-yellow-600);
  outline-offset: 2px;
}
.field { margin-top: 16px; }

.status { margin-top: 12px; font-size: 14px; color: var(--muted); }
.status.ok  { color: var(--success); }
.status.err { color: var(--destructive); }

code, pre, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--fg);
}
code { padding: 2px 6px; }
pre  { padding: 14px; overflow-x: auto; margin-top: 12px; }
pre:empty { display: none; }

/* A rule the user must not miss keeps the warning colour; everything else
   stays neutral so this actually stands out. */
.notice {
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-lg);
  background: var(--input);
  padding: 14px 16px;
  margin-top: 16px;
  font-size: 14px;
}
.notice strong { color: var(--fg); }
.notice.danger { border-left-color: var(--destructive); }

footer.site {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
footer.site a { color: var(--muted); text-decoration: none; margin: 0 12px; }
footer.site a:hover { color: var(--wm-yellow-600); }

@media (max-width: 640px) {
  header.site { padding: 24px 16px 0; }
  .wrap { padding: 0 16px; }
  .hero h1 { font-size: 28px; line-height: 34px; }
  .card { padding: 20px; }
}
