/* ═══════════════════════════════════════════════════════════════════
   Syntaxiom Design Tokens — Single Source of Truth
   ═══════════════════════════════════════════════════════════════════
   This file defines ALL design variables for the entire website.
   No other CSS file may redefine these variables.
   Every page must load this file FIRST, before any other CSS.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* ─── Brand Colors (Sage Palette) ─── */
  --primary: #62B85E;
  --primary-dark: #4C9948;
  --primary-medium: #4A9446;
  --primary-light: #88CF85;
  --lime: #B8E0B5;
  --pale-green: #D8EBD7;
  --mint-surface: #F3F8F2;

  /* ─── Accent Colors ─── */
  --warm-accent: #FFB74D;
  --warm-accent-light: #FFE0B2;
  --warm-accent-orange: #E76F51;

  /* ─── Status Colors ─── */
  --success: #66BB6A;
  --error: #E57373;
  --error-red: #E57373;
  --warning: #FFB74D;
  --warning-amber: #FFB74D;

  /* ─── Quiz Status Colors ─── */
  --correct: #34A853;
  --correct-light: #E6F4EA;
  --wrong: #EA4335;
  --wrong-light: #FCE8E6;

  /* ─── PvP Medal Colors ─── */
  --pvp-gold: #FFD93D;
  --pvp-silver: #C4C9D4;
  --pvp-bronze: #CD7F32;

  /* ─── PvP Status Colors (softer than generic quiz) ─── */
  --pvp-correct: #66BB6A;
  --pvp-correct-light: #E0F7F0;
  --pvp-wrong: #E57373;
  --pvp-wrong-light: #FFE8E8;

  /* ─── Surfaces ─── */
  --surface-white: #F9F9F6;
  --bg: var(--surface-white);
  --bg-card: #FFFFFF;
  --bg-light: #f8f9fa;
  --bg-hover: #f3f4f6;
  --bg-input: #f9fafb;
  --border: #D8EBD7;
  --border-neutral: #dee2e6;

  /* ─── Text ─── */
  --text: #2A4A28;
  --text-dark: #2A4A28;
  --text-muted: #3A3A3A;
  --text-secondary: #6A737D;

  /* ─── Links ─── */
  --link: var(--primary);
  --link-hover: var(--primary-dark);

  /* ─── CTA ─── */
  --cta-bg: var(--primary);
  --cta-hover: var(--primary-dark);

  /* ─── Shadows ─── */
  --shadow: 0 2px 8px rgba(74, 148, 70, 0.12);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);

  /* ─── Radius ─── */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --radius-pill: 20px;
  --radius-round: 50%;

  /* ─── Typography ─── */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans SC', Helvetica, Arial, sans-serif;
  --font-size-base: 16px;
  --font-size-sm: 0.875rem;
  --font-size-xs: 0.75rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --line-height-base: 1.6;
  --line-height-tight: 1.15;

  /* ─── Spacing ─── */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* ─── Dark Mode Surfaces ─── */
  --dark-surface: #132013;
  --dark-card: #1C2E1B;
  --dark-app-bar: #0B150B;
  --dark-border: #2A3F28;

  /* ─── Dictionary-specific (bridge language backgrounds) ─── */
  --bridge-zh-bg: #fff7ed;
  --bridge-es-bg: #fef3f2;
  --bridge-fr-bg: #f0f8f4;
  --bridge-de-bg: #faf5e6;
  --bridge-ja-bg: #f0f0f5;
  --bridge-pt-bg: #f8f0f8;
  --sense-bg: #f8f9fa;

  /* ─── Morpheme colors ─── */
  --morph-prefix: #6366f1;
  --morph-root: #059669;
  --morph-suffix: #d97706;

  /* ─── CEFR badge colors ─── */
  --cefr-auth-bg: #d1fae5;
  --cefr-auth-text: #065f46;
  --cefr-auth-border: #6ee7b7;
  --cefr-biem-bg: #dbeafe;
  --cefr-biem-text: #1e40af;
  --cefr-biem-border: #93c5fd;

  /* ─── App download gradient ─── */
  --app-gradient: linear-gradient(135deg, #1B4332 0%, #2D6A4F 100%);
}

/* ═══ Dark Mode ═══ */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--dark-surface);
    --bg-card: var(--dark-card);
    --bg-light: #1f2937;
    --bg-hover: #2d2d44;
    --bg-input: #2d2d44;
    --border: var(--dark-border);
    --border-neutral: #374151;

    --text: #FFFFFF;
    --text-dark: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-secondary: rgba(255, 255, 255, 0.5);

    --link: var(--primary-light);
    --link-hover: var(--primary-light);

    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);

    --bridge-zh-bg: #1f2d24;
    --bridge-es-bg: #2d1f1f;
    --bridge-fr-bg: #1f2d24;
    --bridge-de-bg: #2d2a1f;
    --bridge-ja-bg: #1f1f2d;
    --bridge-pt-bg: #2d1f2d;
    --sense-bg: #1f2937;

    --cefr-auth-bg: #064e3b;
    --cefr-auth-text: #6ee7b7;
    --cefr-auth-border: #065f46;
    --cefr-biem-bg: #1e3a5f;
    --cefr-biem-text: #93c5fd;
    --cefr-biem-border: #1e40af;
  }
}