/* ==========================================================================
   Track Chasse — design tokens
   Direction « Forêt profonde » (Agence Algorithme). Deux thèmes :
   - :root                 = SOMBRE (identité par défaut)
   - [data-theme="clair"]  = mode « Extérieur » (lisibilité plein soleil)
   L'app n'honore plus la préférence système (pas de @media prefers-color-scheme) :
   le sombre est l'identité, le clair est un mode Extérieur — pas un thème clair
   générique. Bascule pilotée par js/core/theme.js (préférence par appareil).
   Noms de variables --c-* CONSERVÉS (réconciliation avec l'existant).
   ========================================================================== */

:root {
  /* ---- Couleurs thématiques (SOMBRE) ---- */
  --c-bg: #10140d;              /* fond de page */
  --c-bg-terrain: #0c100a;      /* fond mode terrain (plus sombre, plein écran) */
  --c-surface: #1a2015;         /* cartes, panneaux, bottom-sheets */
  --c-surface-2: #243120;       /* boutons secondaires, éléments surélevés */
  --c-nav: #161b10;             /* barre d'onglets */
  --c-field: #12160f;           /* champs de formulaire */

  --c-text: #eef1e6;            /* texte principal */
  --c-text-strong: #f2f5ec;     /* titres, mode terrain */
  --c-text-muted: #9aa48c;      /* libellés, texte secondaire (AA sur --c-surface) */
  --c-accent: #a9d29f;          /* chiffres clés, onglet actif, liens */
  --c-text-inverse: #f3f7ed;    /* texte sur fond primaire */

  /* Rampe assombrie vs feuille : le texte quasi-blanc (--c-text-inverse) sur le bouton doit tenir
     l'AA (≥ 4.5:1) ; #5c8a4f n'était qu'à 3.72:1. #4e7643 → 4.75:1 (cf. tests/d1-contrast). */
  --c-primary: #4e7643;         /* bouton principal */
  --c-primary-600: #446838;     /* survol */
  --c-primary-700: #3a5730;     /* appui */
  --c-primary-soft: rgba(140, 180, 135, .14); /* bandeaux/survols discrets */

  --c-success: #7fd07a;         /* pastille en ligne, succès */
  --c-success-bg: rgba(140, 180, 135, .18);
  --c-danger: #7e2f28;          /* fond bouton urgence / erreur */
  --c-danger-ink: #ffe9e5;      /* texte sur --c-danger */
  --c-danger-line: #d05a4e;     /* contour secteurs interdits (carte) */
  --c-danger-fill: rgba(190, 60, 50, .42); /* remplissage secteurs interdits */
  --c-danger-text: #f0c8c2;     /* consigne de sécurité en texte */
  --c-warn-bg: #5a4a1e;         /* bandeau/pastille hors ligne */
  --c-warn-ink: #f5e9c8;
  --c-warning: #5a4a1e;         /* compat (= --c-warn-bg) */

  --c-border: rgba(255, 255, 255, .09);
  --c-border-strong: rgba(255, 255, 255, .14);

  --c-header-grad: linear-gradient(180deg, #233019, #1a2413);
  --c-header-ink: #eaf2e1;

  --shadow-sheet: 0 -8px 24px rgba(0, 0, 0, .35);
  --focus-ring: 0 0 0 3px rgba(127, 208, 122, .45);

  /* ---- Typographie (non thématique) ---- */
  /* Titres : Archivo · Corps : Public Sans (repli system-ui) — vendorées (P5, zéro CDN) */
  --font-sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-title: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, Menlo, Consolas, monospace;

  --fs-sm: 13px;    /* libellés */
  --fs-base: 14.5px; /* corps */
  --fs-body-lg: 16px; /* mobile / lecteurs âgés */
  --fs-lg: 17px;    /* titres de cartes */
  --fs-kpi: 20px;   /* chiffres clés */
  --fs-terrain: 22px; /* boutons XXL mode terrain */
  --fs-xl: 26px;    /* titre de page */

  /* ---- Rythme (non thématique) ---- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 22px;
  --sp-6: 28px;

  --radius: 14px;       /* cartes */
  --radius-sm: 9px;     /* boutons, champs */
  --radius-terrain: 16px; /* boutons XXL terrain */
  --radius-pill: 999px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.38);

  /* ---- Tactile ---- */
  --tap-min: 44px;      /* cible minimum partout */
  --tap-terrain: 76px;  /* hauteur boutons mode terrain */

  --header-h: 56px;
}

/* ==========================================================================
   Thème clair « Extérieur » — soleil rasant, lisibilité maximum.
   Activé par js/core/theme.js : <html data-theme="clair">.
   ========================================================================== */
[data-theme="clair"] {
  --c-bg: #f2f4ec;
  --c-bg-terrain: #f7f8f2;      /* quasi blanc : luminance max au soleil */
  --c-surface: #ffffff;
  --c-surface-2: #e4e9db;
  --c-nav: #eaeee1;
  --c-field: #ffffff;

  --c-text: #171d13;            /* quasi noir : contraste maximal */
  --c-text-strong: #10140d;
  --c-text-muted: #4d5745;      /* plus foncé qu'en sombre : AA garanti dehors */
  --c-accent: #2f5527;
  --c-text-inverse: #ffffff;

  --c-primary: #3c6032;
  --c-primary-600: #34552b;
  --c-primary-700: #2b4823;
  --c-primary-soft: rgba(60, 96, 50, .12);

  --c-success: #2e7d32;
  --c-success-bg: rgba(60, 96, 50, .14);
  --c-danger: #a8281f;
  --c-danger-ink: #ffffff;
  --c-danger-line: #b3362b;
  --c-danger-fill: rgba(190, 60, 50, .38);
  --c-danger-text: #8c2019;
  --c-warn-bg: #f3e3b3;
  --c-warn-ink: #4d3a08;
  --c-warning: #f3e3b3;

  --c-border: rgba(23, 29, 19, .18);
  --c-border-strong: rgba(23, 29, 19, .32);

  --c-header-grad: linear-gradient(180deg, #2f4529, #273b22);
  --c-header-ink: #f2ead7;

  --shadow-sheet: 0 -8px 24px rgba(23, 29, 19, .18);
  --focus-ring: 0 0 0 3px rgba(60, 96, 50, .40);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-text-size-adjust: 100%;
}
