/* ===== leketia — tokens du design system (source unique) =====
   Lu par l'app (index.html) et par les pages publiques (/b, /p). Toute couleur passe par ici.
   Rôles : bleu roi = action et marque ; bleu nuit = fond du mode sombre ; ocre = UNE chose qui demande
   l'attention par écran (bouton principal d'une conversion, rappel, nouveauté). Voir docs/DESIGN.md. */
:root {
  /* Fonds */
  --paper: #fbf9f4;               /* fond de page : blanc de lait, froissé par app.css */
  --paper-rgb: 251 249 244;
  --surface: var(--paper);        /* ancien nom, gardé pour les règles existantes */
  --surface-elevated: #ffffff;    /* cartes, fenêtres */
  --surface-sunken: #e9eef9;      /* champs, onglets, survols */
  --surface-overlay: rgb(255 255 255 / 0.86); /* barres translucides */
  --scrim: rgb(11 22 64 / 0.32);  /* voile derrière une fenêtre */

  /* Encre */
  --ink: #0e1430;
  --ink-rgb: 14 20 48;
  --shadow-rgb: 14 20 48;       /* teinte des ombres (reste sombre en mode sombre) */
  --ink-secondary: #4a5275;
  --ink-muted: #6b7290;
  --inverse: #0e1430;           /* fond inversé : onglet actif, filtre actif, toast */
  --on-inverse: #ffffff;
  --border-light: #e1e6f2;
  --border-strong: #cdd4e6;

  /* Bleu roi : action, liens, marque */
  --accent: #1F4BC9;              /* texte et icônes d'action */
  --accent-rgb: 31 75 201;
  --accent-fill: #1F4BC9;         /* fond des boutons principaux */
  --accent-hover: #173aa0;
  --accent-soft: #eaf0fe;
  --accent-light: #d6e0fb;
  --on-accent: #ffffff;

  /* Ocre de la calebasse : une seule chose qui demande l'attention par écran */
  --highlight: #e8a93c;
  --highlight-hover: #d9982a;
  --highlight-soft: #fdf3e1;
  --on-highlight: #0e1430;

  /* Bleu nuit : surfaces sombres de la marque */
  --navy: #0b1640;

  /* États */
  --success: #16a34a;
  --info: #3B82F6;
  --info-soft: #eff6ff;
  --danger: #d92d20;
  --danger-soft: #fef2f2;
  --warning: #b45309;
  --warning-soft: #fffbeb;

  /* Typographie : Sora pour les titres (800 pour les grands), DM Sans pour le texte, JetBrains Mono pour les bits */
  --font-display: 'Sora', 'DM Sans', system-ui, sans-serif;
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --text-xs: 12px; --text-sm: 13px; --text-base: 15px; --text-lg: 18px; --text-xl: 22px; --text-2xl: 28px; --text-3xl: 36px;

  /* Espacements (grille de 4 px) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

  /* Arrondis : les boutons et pastilles sont des pilules */
  --r-sm: 6px; --r: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 24px; --r-full: 9999px;

  /* Ombres (teintées d'encre) */
  --shadow-card: 0 0 0 1px rgb(var(--shadow-rgb) / 0.04), 0 1px 3px rgb(var(--shadow-rgb) / 0.05), 0 3px 8px rgb(var(--shadow-rgb) / 0.06);
  --shadow-hover: 0 0 0 1px rgb(var(--shadow-rgb) / 0.05), 0 2px 6px rgb(var(--shadow-rgb) / 0.07), 0 8px 24px rgb(var(--shadow-rgb) / 0.1);
  --shadow-dialog: 0 0 0 1px rgb(var(--shadow-rgb) / 0.05), 0 4px 12px rgb(var(--shadow-rgb) / 0.07), 0 16px 48px rgb(var(--shadow-rgb) / 0.16);
  --shadow-popover: 0 0 0 1px rgb(var(--shadow-rgb) / 0.06), 0 8px 24px rgb(var(--shadow-rgb) / 0.14);

  /* Mouvement */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-fast: 120ms; --dur: 250ms; --dur-slow: 400ms; --dur-reveal: 600ms;

  /* Plans */
  --z-base: 0; --z-sticky: 10; --z-dropdown: 50; --z-modal: 100; --z-toast: 200;

  color-scheme: light;
}

/* Mode sombre : le bleu nuit de la marque. Mêmes rôles, valeurs relevées pour le contraste. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b1640; --paper-rgb: 11 22 64;
    --surface-elevated: #14215a; --surface-sunken: #1a2a68; --surface-overlay: rgb(11 22 64 / 0.86); --scrim: rgb(3 7 24 / 0.6);
    --ink: #eef1fb; --ink-rgb: 238 241 251; --shadow-rgb: 3 7 24; --ink-secondary: #b3bbdc; --ink-muted: #8f9ac6; --border-light: #24336f; --border-strong: #34468c; --inverse: #eef1fb; --on-inverse: #0b1640;
    --accent: #8fa9ff; --accent-rgb: 143 169 255; --accent-fill: #3a62e6; --accent-hover: #3356d6; --accent-soft: #1c2b66; --accent-light: #26388a;
    --highlight-soft: #3a2e17; --danger: #ff7a6e; --danger-soft: #3a1414; --info: #7fb0ff; --info-soft: #14254d; --warning: #f0b45a; --warning-soft: #3a2a12; --success: #4ade80;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0b1640; --paper-rgb: 11 22 64;
  --surface-elevated: #14215a; --surface-sunken: #1a2a68; --surface-overlay: rgb(11 22 64 / 0.86); --scrim: rgb(3 7 24 / 0.6);
  --ink: #eef1fb; --ink-rgb: 238 241 251; --shadow-rgb: 3 7 24; --ink-secondary: #b3bbdc; --ink-muted: #8f9ac6; --border-light: #24336f; --border-strong: #34468c; --inverse: #eef1fb; --on-inverse: #0b1640;
  --accent: #8fa9ff; --accent-rgb: 143 169 255; --accent-fill: #3a62e6; --accent-hover: #3356d6; --accent-soft: #1c2b66; --accent-light: #26388a;
  --highlight-soft: #3a2e17; --danger: #ff7a6e; --danger-soft: #3a1414; --info: #7fb0ff; --info-soft: #14254d; --warning: #f0b45a; --warning-soft: #3a2a12; --success: #4ade80;
  color-scheme: dark;
}
