/* ==========================================================================
   myLims — Design tokens
   Un seul fichier pilote l'apparence : thème (data-theme) et densité
   (data-density) sont posés sur <html>. Aucune page ne code de couleur en dur.
   Thèmes : clair « Laboratoire » (défaut), sombre, contraste élevé ; choisis par l'utilisateur,
   indépendants du réglage du système.
   Tailles en rem (1rem = 16px à 100 %) : le curseur de taille de la barre d'état change la taille
   de base de <html> (Kit.scale, 80 à 200 %), toute l'interface suit ; seuls les filets restent à 1px.
   ========================================================================== */

/* Polices embarquées (SIL OFL 1.1, voir fonts/LISEZMOI.txt) : aucun appel à un service externe */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-wght.woff2") format("woff2-variations"), url("../fonts/inter-latin-wght.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("../fonts/jetbrains-mono-latin-wght.woff2") format("woff2-variations"), url("../fonts/jetbrains-mono-latin-wght.woff2") format("woff2"); }

:root {
  /* Typographie */
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  --fs-xs: 0.6875rem;
  --fs-sm: 0.75rem;
  --fs-base: 0.8125rem;
  --fs-md: 0.875rem;
  --fs-lg: 1rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.625rem;

  /* Formes */
  --radius-sm: 0.25rem;
  --radius: 0.375rem;
  --radius-lg: 0.625rem;

  /* Densité (cozy par défaut) */
  --control-h: 2rem;
  --row-h: 2.25rem;
  --gap: 0.75rem;
  --pad: 1rem;
  --field-gap: 0.75rem;

  /* Thème clair « Laboratoire » (défaut) */
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef1f5;
  --border: #dde2ea;
  --border-strong: #c3cad6;
  --text: #1b2232;
  --text-muted: #535e72;   /* contraste AA sur les bandes de panneau, DEC-034 */
  --text-faint: #5d687c;   /* contraste AA (4,5:1) sur les surfaces et les bandes de panneau, corrigé le 13/11/2026 (DEC-034) */
  --accent: #2563eb;
  --accent-hover: #1d4fd8;
  --accent-contrast: #ffffff;
  --accent-soft: #e8efff;
  --focus: #2563eb;
  --ok: #166534;      --ok-soft: #e4f5ea;   /* contraste AA sur --ok-soft, DEC-034 */
  --warn: #a14a07;    --warn-soft: #fdf1dc;   /* contraste AA sur --warn-soft, DEC-034 */
  --err: #c0262d;     --err-soft: #fde8e8;
  --info: #0e7490;    --info-soft: #e0f3f7;
  --nav-bg: #111a2e;
  --nav-text: #c9d2e3;
  --nav-text-strong: #ffffff;
  --nav-active: #24314f;
  --required: #c0262d;
  --input-bg: #ffffff;
  --input-readonly: #f3f5f8;
  --shadow-sm: 0 1px 0.125rem rgba(16, 24, 40, .06);
  --shadow: 0 0.125rem 0.5rem rgba(16, 24, 40, .08), 0 1px 0.125rem rgba(16, 24, 40, .04);
  --shadow-lg: 0 0.75rem 2rem rgba(16, 24, 40, .18);
  --paper: #ffffff;
  --paper-text: #1b2232;
  --viewer-bg: #525866;

  color-scheme: light;
}

/* ---------- Densités ---------- */
:root[data-density="compact"] {
  --fs-base: 0.75rem;
  --fs-md: 0.8125rem;
  --control-h: 1.625rem;
  --row-h: 1.75rem;
  --gap: 0.5rem;
  --pad: 0.75rem;
  --field-gap: 0.5rem;
}
:root[data-density="comfortable"] {
  --fs-base: 0.875rem;
  --fs-md: 0.9375rem;
  --control-h: 2.375rem;
  --row-h: 2.75rem;
  --gap: 1rem;
  --pad: 1.375rem;
  --field-gap: 1rem;
}

/* ---------- Thème sombre ---------- */
:root[data-theme="sombre"] {
  --bg: #0e131c;
  --surface: #161d29;
  --surface-2: #1b2331;
  --surface-3: #222c3d;
  --border: #2b3546;
  --border-strong: #3c485d;
  --text: #e6eaf2;
  --text-muted: #9aa5b8;
  --text-faint: #8a94a8;   /* contraste AA, DEC-034 */
  --accent: #5b8cff;
  --accent-hover: #7aa2ff;
  --accent-contrast: #0b1020;
  --accent-soft: #1d2a4a;
  --focus: #7aa2ff;
  --ok: #4ade80;      --ok-soft: #12301f;
  --warn: #fbbf24;    --warn-soft: #3a2c0d;
  --err: #f87171;     --err-soft: #3d1618;
  --info: #22d3ee;    --info-soft: #0d2f37;
  --nav-bg: #0a0f17;
  --nav-text: #9aa5b8;
  --nav-text-strong: #ffffff;
  --nav-active: #1b2537;
  --required: #f87171;
  --input-bg: #111824;
  --input-readonly: #1a2130;
  --shadow-sm: 0 1px 0.125rem rgba(0, 0, 0, .4);
  --shadow: 0 0.125rem 0.625rem rgba(0, 0, 0, .45);
  --shadow-lg: 0 1rem 2.5rem rgba(0, 0, 0, .6);
  --paper: #ffffff;
  --paper-text: #1b2232;
  --viewer-bg: #05080d;
  color-scheme: dark;
}

/* ---------- Thème « Contraste » : accessibilité renforcée (AAA visé) ---------- */
:root[data-theme="contraste"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #f0f0f0;
  --border: #4a4a4a;
  --border-strong: #000000;
  --text: #000000;
  --text-muted: #2b2b2b;
  --text-faint: #4a4a4a;
  --accent: #0033a0;
  --accent-hover: #001f66;
  --accent-contrast: #ffffff;
  --accent-soft: #dfe7ff;
  --focus: #d40000;
  --ok: #00561b;      --ok-soft: #dff3e4;
  --warn: #6b3a00;    --warn-soft: #fff0d6;
  --err: #a00000;     --err-soft: #ffe0e0;
  --info: #004b5c;    --info-soft: #dff4f8;
  --nav-bg: #000000;
  --nav-text: #ffffff;
  --nav-active: #0033a0;
  --input-readonly: #ececec;
  --shadow-sm: none;
  --shadow: 0 0 0 1px #000;
  --shadow-lg: 0 0 0 0.125rem #000;
}
