/* Waseel web pages (ANS-100). Colours from design/tokens.json; system font only (no font files). */
:root {
  --page: #F1F3F7;          /* light.surfaceOnWhite */
  --panel: #FFFFFF;         /* light.surface */
  --panel-calm: #F3EEE4;    /* light.wallpaper: the finished step only */
  --border: #DDE2EA;        /* light.surfaceBorder */
  --field: #FFFFFF;
  --field-border: #DDE2EA;
  --text: #111318;          /* light.textPrimary */
  --muted: #6B7280;         /* light.textSecondary */
  --accent: #3D6BFF;        /* accent */
  --accent-text: #2F55D4;   /* light.link */
  --on-accent: #FFFFFF;
  --critical: #D92D35;      /* light.critical */
  --critical-fill: #D92D35; /* light.criticalFill */
  --success: #15803D;       /* light.success */
  --focus: #3D6BFF;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0B0C10;          /* dark.background */
    --panel: #1A1D24;         /* dark.surface */
    --panel-calm: #10152D;    /* dark.wallpaperGradient[1] */
    --border: #2A2E38;        /* dark.surfaceBorder */
    --field: #16181E;         /* dark.field */
    --field-border: #2A2E38;
    --text: #FFFFFF;
    --muted: #9AA1AE;
    --accent: #3D6BFF;
    --accent-text: #7FA2FF;   /* dark.link */
    --critical: #FF6B70;      /* dark.critical */
    --critical-fill: #E5484D; /* dark.criticalFill */
    --success: #3FCF8E;
    --focus: #6E93FF;         /* dark.accentOnDark */
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  font-variant-numeric: lining-nums;
}
:lang(en) { line-height: 1.5; }

.top, main, footer { width: min(100% - 32px, 560px); margin-inline: auto; }

.top { display: flex; align-items: center; justify-content: space-between; padding-block: 20px 8px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 20px; }
.lang {
  font: inherit; font-size: 15px; color: var(--accent-text); background: none; border: 0;
  min-height: 44px; padding-inline: 12px; border-radius: 22px; cursor: pointer;
}
.lang:hover { text-decoration: underline; }

h1 { font-size: 34px; line-height: 1.2; font-weight: 700; margin: 24px 0 12px; letter-spacing: -0.01em; }
:lang(ar) h1 { letter-spacing: 0; }
.lede { color: var(--muted); margin: 0 0 32px; max-width: 34em; }

/* The three steps are a real sequence: the numbered rail is the page's one structural device. */
.steps { list-style: none; margin: 0; padding: 0; }
.step { position: relative; padding-inline-start: 52px; padding-block-end: 28px; }
.step:last-child { padding-block-end: 0; }
/* The rail joins one step's number to the next; none after the last. */
.step:not(:last-child)::before {
  content: ""; position: absolute; inset-block: 40px 4px; inset-inline-start: 17px;
  width: 2px; background: var(--border);
}
.step[data-state="done"]:not(:last-child)::before { background: var(--success); }
.step h2 { display: flex; align-items: center; gap: 0; margin: 0 0 12px; font-size: 20px; line-height: 36px; font-weight: 600; }
.num {
  position: absolute; inset-inline-start: 0; inset-block-start: 0;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-size: 16px; font-weight: 700; background: var(--page); color: var(--muted);
  border: 2px solid var(--border);
}
.step[data-state="current"] .num { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.step[data-state="done"] .num { background: var(--panel); border-color: var(--success); color: var(--success); }
.step[data-state="later"] h2 { color: var(--muted); }

form { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 20px; }
label { display: block; font-size: 15px; color: var(--muted); margin-block-end: 6px; }
input[type="email"], input[type="text"] {
  width: 100%; font: inherit; color: var(--text); background: var(--field);
  border: 1px solid var(--field-border); border-radius: 12px; min-height: 52px; padding: 10px 14px;
  text-align: start;
}
input.code { font-size: 24px; font-weight: 600; letter-spacing: 0.4em; text-align: center; max-width: 240px; font-variant-numeric: tabular-nums; }
input::placeholder { color: var(--muted); }

button { font: inherit; cursor: pointer; }
.primary, .danger {
  display: block; width: 100%; min-height: 52px; margin-block-start: 16px; border: 0; border-radius: 26px;
  font-weight: 600; color: var(--on-accent);
}
.primary { background: var(--accent); }
.danger { background: var(--critical-fill); }
.primary:disabled, .danger:disabled { opacity: 0.55; cursor: progress; }
.quiet { background: none; border: 0; color: var(--accent-text); min-height: 44px; margin-block-start: 8px; padding-inline: 4px; }
.actions { display: flex; flex-direction: column; align-items: center; }

.hint { margin: 0 0 16px; font-size: 16px; overflow-wrap: anywhere; }
.consequences { margin-block: 20px 4px; border-block-start: 1px solid var(--border); padding-block-start: 8px; }
.consequences h3 { font-size: 16px; font-weight: 600; margin: 12px 0 4px; }
.consequences ul { margin: 0; padding-inline-start: 1.2em; color: var(--muted); font-size: 15px; }
.consequences li { margin-block: 4px; }

.check { display: flex; gap: 10px; align-items: flex-start; margin-block-start: 16px; color: var(--text); font-size: 16px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--critical-fill); }

.msg { margin: 12px 0 0; color: var(--critical); font-size: 15px; }
.done-note { margin: 0; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.done { background: var(--panel-calm); border-radius: 18px; padding: 20px; }
.done p { margin: 0; }
.done:focus { outline: none; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

footer { color: var(--muted); font-size: 14px; padding-block: 24px 40px; }

a { color: var(--accent-text); }

@media (max-width: 380px) {
  h1 { font-size: 28px; }
  form { padding: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .num { transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease; }
}
