/* =====================================================================
   EURETOPIA design tokens — v1.0 (approved 2026-11-14)
   One token set for the public website and the UBIAP web app.
   Components must use these variables only: no hard-coded colours/sizes.
   ===================================================================== */

:root {
  /* ---- Brand palette (from the founders) ---------------------------- */
  --brand-navy: #122D38;
  --brand-emerald: #16A085;
  --brand-blue: #3478F6;
  --brand-white: #FFFFFF;
  --brand-slate: #64748B;

  /* ---- Ramps derived from the palette -------------------------------- */
  --navy-950: #0A1A21;
  --navy-900: #122D38;
  --navy-800: #1A3D4B;
  --navy-700: #24505F;
  --navy-600: #2F6476;

  --emerald-800: #0B6A57;
  --emerald-700: #0E7C66;   /* AA on white (5.1:1): buttons, text */
  --emerald-500: #16A085;   /* brand; large text, icons, charts */
  --emerald-300: #6FD3BE;
  --emerald-100: #D3F2EA;
  --emerald-50:  #ECF9F5;

  --blue-700: #1D4FD0;
  --blue-600: #2563EB;      /* AA on white (5.2:1): links, AI text */
  --blue-500: #3478F6;      /* brand; focus ring, charts, AI accents */
  --blue-300: #8DB4FA;
  --blue-100: #DCE8FE;
  --blue-50:  #F0F5FF;

  --slate-900: #0F1F27;
  --slate-700: #334155;
  --slate-600: #5B6B7F;     /* muted text on light (5.1:1 on page bg) */
  --slate-500: #64748B;     /* brand slate; on white surfaces only */
  --slate-400: #94A3B8;
  --slate-200: #CBD4DA;
  --slate-100: #E4E9EC;
  --slate-50:  #F1F4F6;
  --slate-25:  #F6F8F9;

  --amber-800: #92400E;     /* AA text on amber-100 (6.1:1) */
  --amber-700: #B45309;
  --amber-100: #FDEBD3;
  --red-700:   #B42318;
  --red-100:   #FBE1DE;

  /* ---- Typography ----------------------------------------------------- */
  /* Proposed: Manrope (display), Inter (text), JetBrains Mono (numbers/code),
     all SIL Open Font License, self-hosted in static/fonts after approval.
     Until then the system fallbacks below render the mockups. */
  --font-display: "Manrope", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font-text: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;

  --fs-xs: 0.75rem;    /* 12 */
  --fs-sm: 0.8125rem;  /* 13 */
  --fs-md: 0.875rem;   /* 14  app body */
  --fs-base: 1rem;     /* 16  website body */
  --fs-lg: 1.125rem;   /* 18 */
  --fs-xl: 1.25rem;    /* 20 */
  --fs-2xl: 1.5rem;    /* 24 */
  --fs-3xl: 1.875rem;  /* 30 */
  --fs-4xl: 2.25rem;   /* 36 */
  --fs-5xl: 3rem;      /* 48 */
  --fs-6xl: 3.75rem;   /* 60 */

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-body: 1.55;

  /* ---- Space, radius, shadow, motion --------------------------------- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px; --sp-20: 80px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgb(18 45 56 / 0.06);
  --shadow-md: 0 2px 6px rgb(18 45 56 / 0.06), 0 8px 24px rgb(18 45 56 / 0.06);
  --shadow-lg: 0 12px 40px rgb(18 45 56 / 0.14);

  --dur-fast: 120ms;
  --dur-med: 220ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --sidebar-w: 256px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 60px;
  --content-max: 1440px;

}

/* ---- Semantic: LIGHT theme (default; also any [data-theme="light"] box) -- */
:root, [data-theme="light"] {
  color-scheme: light;
  --bg: var(--slate-25);
  --surface: #FFFFFF;
  --surface-2: var(--slate-50);
  --surface-3: var(--slate-100);
  --border: #E1E7EB;
  --border-strong: var(--slate-200);

  --text: var(--navy-900);
  --text-muted: var(--slate-600);
  --text-subtle: var(--slate-400);
  --text-inverse: #FFFFFF;

  --primary: var(--emerald-700);
  --primary-hover: var(--emerald-800);
  --primary-text: #FFFFFF;
  --primary-soft: var(--emerald-50);
  --primary-soft-text: var(--emerald-800);

  --accent: var(--blue-600);
  --accent-soft: var(--blue-50);
  --link: var(--blue-600);
  --focus: var(--blue-500);

  --success: var(--emerald-700);   --success-soft: var(--emerald-50);
  --warning: var(--amber-800);     --warning-soft: var(--amber-100);
  --danger: var(--red-700);        --danger-soft: var(--red-100);
  --info: var(--blue-600);         --info-soft: var(--blue-50);

  --ai: var(--blue-600);
  --ai-soft: var(--blue-50);
  --ai-border: var(--blue-100);
  --ai-gradient: linear-gradient(135deg, var(--blue-500), var(--emerald-500));

  --posted-bg: var(--navy-900);
  --posted-text: #FFFFFF;

  --sidebar-bg: var(--navy-900);
  --sidebar-text: #C9D7DD;
  --sidebar-text-active: #FFFFFF;
  --sidebar-active: rgb(255 255 255 / 0.08);
  --sidebar-indicator: var(--emerald-500);

  --chart-1: var(--emerald-500);
  --chart-2: var(--blue-500);
  --chart-3: var(--navy-600);
  --chart-4: #E0A43A;
  --chart-5: var(--slate-400);
  --chart-grid: var(--slate-100);
}

/* ---- Semantic: DARK theme ---------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0A1A21;
    --surface: #10252E;
    --surface-2: #153240;
    --surface-3: #1C3E4D;
    --border: #21424F;
    --border-strong: #2C5464;
    --text: #E8F0F3;
    --text-muted: #9FB3BE;
    --text-subtle: #6F8794;
    --text-inverse: #0A1A21;
    --primary: var(--emerald-500);
    --primary-hover: #1DB394;
    --primary-text: #04201A;
    --primary-soft: rgb(22 160 133 / 0.14);
    --primary-soft-text: var(--emerald-300);
    --accent: #5B93F8;
    --accent-soft: rgb(52 120 246 / 0.14);
    --link: #7AA8FA;
    --focus: #5B93F8;
    --success: #34C3A4;  --success-soft: rgb(22 160 133 / 0.14);
    --warning: #F0B45B;  --warning-soft: rgb(240 180 91 / 0.14);
    --danger: #F28B82;   --danger-soft: rgb(242 139 130 / 0.14);
    --info: #7AA8FA;     --info-soft: rgb(52 120 246 / 0.14);
    --ai: #8DB4FA;
    --ai-soft: rgb(52 120 246 / 0.12);
    --ai-border: rgb(52 120 246 / 0.32);
    --posted-bg: #E8F0F3;
    --posted-text: #0A1A21;
    --sidebar-bg: #07141A;
    --sidebar-text: #A9BCC5;
    --sidebar-active: rgb(255 255 255 / 0.06);
    --chart-3: #6FA8BC;
    --chart-grid: #1C3E4D;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow-md: 0 2px 8px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 12px 40px rgb(0 0 0 / 0.5);
  }
}
:root[data-theme="dark"], [data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A1A21;
  --surface: #10252E;
  --surface-2: #153240;
  --surface-3: #1C3E4D;
  --border: #21424F;
  --border-strong: #2C5464;
  --text: #E8F0F3;
  --text-muted: #9FB3BE;
  --text-subtle: #6F8794;
  --text-inverse: #0A1A21;
  --primary: var(--emerald-500);
  --primary-hover: #1DB394;
  --primary-text: #04201A;
  --primary-soft: rgb(22 160 133 / 0.14);
  --primary-soft-text: var(--emerald-300);
  --accent: #5B93F8;
  --accent-soft: rgb(52 120 246 / 0.14);
  --link: #7AA8FA;
  --focus: #5B93F8;
  --success: #34C3A4;  --success-soft: rgb(22 160 133 / 0.14);
  --warning: #F0B45B;  --warning-soft: rgb(240 180 91 / 0.14);
  --danger: #F28B82;   --danger-soft: rgb(242 139 130 / 0.14);
  --info: #7AA8FA;     --info-soft: rgb(52 120 246 / 0.14);
  --ai: #8DB4FA;
  --ai-soft: rgb(52 120 246 / 0.12);
  --ai-border: rgb(52 120 246 / 0.32);
  --posted-bg: #E8F0F3;
  --posted-text: #0A1A21;
  --sidebar-bg: #07141A;
  --sidebar-text: #A9BCC5;
  --sidebar-active: rgb(255 255 255 / 0.06);
  --chart-3: #6FA8BC;
  --chart-grid: #1C3E4D;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-md: 0 2px 8px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 12px 40px rgb(0 0 0 / 0.5);
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-med: 0ms; }
}
