/* ==========================================================================
   ZangoLearn design tokens
   Brand: Primary #074898 · Secondary #7A7A7A · Accent #DC0B1D (sparingly)
   Note: #7A7A7A is 4.3:1 on white, so it is used for borders/icons only;
   body "muted" text uses --zl-text-muted (≥ 4.5:1) to meet WCAG AA.
   ========================================================================== */
:root {
  /* Brand */
  --zl-primary: #074898;
  --zl-primary-hover: #053a7b;
  --zl-primary-soft: #e6eef9;
  --zl-primary-contrast: #ffffff;
  --zl-secondary: #7a7a7a;
  --zl-accent: #dc0b1d;
  --zl-accent-hover: #b80918;
  --zl-accent-soft: #fde8ea;
  /* text on red buttons (white in light mode, near-black on the lighter dark-mode reds) */
  --zl-on-danger: #ffffff;

  /* Neutrals / surfaces */
  --zl-bg: #f5f7fa;
  --zl-surface: #ffffff;
  --zl-surface-2: #eef2f7;
  --zl-text: #1b2430;
  --zl-text-muted: #5b6472;
  --zl-border: #d9dfe7;
  --zl-border-strong: #808a99; /* 3.5:1 on white: input and control borders meet WCAG 1.4.11 */
  --zl-link: #074898;
  --zl-focus: #0a66d6;
  --zl-hero-bg: #074898;
  --zl-hero-text: #ffffff;
  --zl-footer-bg: #0b1f3f;
  --zl-footer-text: #d4dceb;

  /* Status */
  --zl-success: #0f7a3d;
  --zl-success-soft: #e3f4ea;
  --zl-warning: #8a5a00;
  --zl-warning-soft: #fff4d6;
  --zl-danger: #c20a19;
  --zl-danger-soft: #fde8ea;
  --zl-info: #074898;
  --zl-info-soft: #e6eef9;

  /* Session-model stage colours (paired with text labels, never colour alone) */
  --zl-stage-concept: #074898;
  --zl-stage-demonstration: #5b3fa8;
  --zl-stage-guided: #0d6e74;
  --zl-stage-independent: #0f7a3d;
  --zl-stage-challenge: #a3460a;
  --zl-stage-review: #4a5462;

  /* Typography: scale 12/14/16/18/20/24/32/40 */
  --zl-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --zl-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --zl-fs-12: 0.75rem;
  --zl-fs-14: 0.875rem;
  --zl-fs-16: 1rem;
  --zl-fs-18: 1.125rem;
  --zl-fs-20: 1.25rem;
  --zl-fs-24: 1.5rem;
  --zl-fs-32: 2rem;
  --zl-fs-40: 2.5rem;
  --zl-lh-tight: 1.2;
  --zl-lh: 1.55;
  --zl-fw-regular: 400;
  --zl-fw-medium: 500;
  --zl-fw-semibold: 600;
  --zl-fw-bold: 700;

  /* Spacing: 4/8/12/16/24/32/48 */
  --zl-sp-1: 4px;
  --zl-sp-2: 8px;
  --zl-sp-3: 12px;
  --zl-sp-4: 16px;
  --zl-sp-5: 24px;
  --zl-sp-6: 32px;
  --zl-sp-7: 48px;

  /* Shape & depth */
  --zl-radius: 8px;
  --zl-radius-lg: 16px;
  --zl-radius-pill: 999px;
  --zl-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --zl-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
  --zl-shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.16);

  /* Layout */
  --zl-container: 1200px;
  --zl-container-narrow: 760px;
  --zl-header-h: 64px;
  --zl-touch: 44px;
  --zl-ease: cubic-bezier(0.2, 0, 0, 1);
  --zl-dur: 180ms;

  color-scheme: light;
}

/* Dark theme: follows the OS unless the user picked light manually… */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --zl-primary: #2f6fd6;
    --zl-primary-hover: #2560c4;
    --zl-primary-soft: #14284a;
    --zl-accent: #ff4d5c;
    --zl-accent-hover: #ff6b77;
    --zl-accent-soft: #3a1418;
    --zl-on-danger: #0b1220;
    --zl-bg: #0b1220;
    --zl-surface: #121b2d;
    --zl-surface-2: #18233a;
    --zl-text: #e7ecf3;
    --zl-text-muted: #a6b0bf;
    --zl-border: #26334d;
    --zl-border-strong: #64779a;
    --zl-link: #8ab8ff;
    --zl-focus: #8ab8ff;
    --zl-hero-bg: #0d2550;
    --zl-footer-bg: #070d18;
    --zl-success: #4cc684;
    --zl-success-soft: #0f2a1c;
    --zl-warning: #f2c14e;
    --zl-warning-soft: #2e2510;
    --zl-danger: #ff6b77;
    --zl-danger-soft: #3a1418;
    --zl-info: #8ab8ff;
    --zl-info-soft: #14284a;
    --zl-stage-concept: #8ab8ff;
    --zl-stage-demonstration: #b9a3ff;
    --zl-stage-guided: #5fd3d9;
    --zl-stage-independent: #4cc684;
    --zl-stage-challenge: #ffad6b;
    --zl-stage-review: #b7c0cc;
    --zl-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --zl-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    --zl-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

/* …or picked dark manually (toggle saved in localStorage). */
:root[data-theme='dark'] {
  --zl-primary: #2f6fd6;
  --zl-primary-hover: #2560c4;
  --zl-primary-soft: #14284a;
  --zl-accent: #ff4d5c;
  --zl-accent-hover: #ff6b77;
  --zl-accent-soft: #3a1418;
  --zl-on-danger: #0b1220;
  --zl-bg: #0b1220;
  --zl-surface: #121b2d;
  --zl-surface-2: #18233a;
  --zl-text: #e7ecf3;
  --zl-text-muted: #a6b0bf;
  --zl-border: #26334d;
  --zl-border-strong: #64779a;
  --zl-link: #8ab8ff;
  --zl-focus: #8ab8ff;
  --zl-hero-bg: #0d2550;
  --zl-footer-bg: #070d18;
  --zl-success: #4cc684;
  --zl-success-soft: #0f2a1c;
  --zl-warning: #f2c14e;
  --zl-warning-soft: #2e2510;
  --zl-danger: #ff6b77;
  --zl-danger-soft: #3a1418;
  --zl-info: #8ab8ff;
  --zl-info-soft: #14284a;
  --zl-stage-concept: #8ab8ff;
  --zl-stage-demonstration: #b9a3ff;
  --zl-stage-guided: #5fd3d9;
  --zl-stage-independent: #4cc684;
  --zl-stage-challenge: #ffad6b;
  --zl-stage-review: #b7c0cc;
  --zl-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --zl-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  --zl-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
