/**
 * design-tokens.css — SOURCE DE VÉRITÉ UNIQUE DES TOKENS (Niveau 0 refonte DS)
 * ============================================================================
 * Consolide les 6 sources concurrentes (brand-variables.css, themes.css,
 * themes-gi.css, tailwind.config inline, brand-colors.js, hex en dur).
 * Voir .claude/docs/audits/AUDIT_DESIGN_SYSTEM.md
 *
 * STRATÉGIE (N0.1) :
 *   - Chargé EN DERNIER dans app.html → ses définitions :root / :root.light /
 *     :root.dark gagnent en cascade (même spécificité, source order).
 *   - Valeurs = effectif ACTUEL (themes-gi gagne sur themes.css en light),
 *     donc AUCUN changement visuel attendu...
 *   - ...SAUF 3 corrections délibérées marquées [FIX] ci-dessous.
 *   - 100% réversible : retirer le <link> de design-tokens.css dans app.html
 *     restaure exactement le comportement précédent.
 *
 * N0.2 FAIT (2026-06-23) : blocs :root* de définition de tokens supprimés de
 *   brand-variables.css / themes.css / themes-gi.css / gi-utilities.css.
 *   Ce fichier est désormais chargé EN PREMIER (fondation) ; les overrides
 *   responsive @media de brand-variables/themes-gi, chargés après, gagnent à
 *   leurs breakpoints. tailwind.config primary branché sur la rampe cyan.
 *
 * MAJ : 2026-06-23
 */

/* ============================================================================
   1. TOKENS GLOBAUX (indépendants du thème) — ex brand-variables.css
   ============================================================================ */
:root {
  /* --- Palette de marque GI --- */
  --gi-black: #000000;
  --gi-cyan: #009FE3;            /* Pantone 2191 C — accent unique de la charte */
  --gi-cyan-50: #E6F4FB;        /* teinte claire (rampe cyan pour Tailwind primary-50) */
  --gi-cyan-hover: #0088c7;     /* = primary-600 */
  --gi-cyan-active: #0076A8;    /* = primary-700 */
  --gi-strategy: #FBE40B;        /* Jaune  — pôle Stratégie  */
  --gi-design: #654897;          /* Violet — pôle Design     */
  --gi-web: #EB5D18;             /* Orange — pôle Web (thème ShopFlow) */
  --gi-social: #4E78BC;          /* Bleu   — pôle Social     */
  --gi-photo: #5EBFBB;           /* Turquoise — pôle Photo   */
  --gi-print: #E20E7E;           /* Magenta — pôle Print     */

  /* --- Couleurs fonctionnelles « brand » (globales, ex brand-variables) --- */
  --gi-text-primary: #000000;
  --gi-text-secondary: #4B5563;
  --gi-text-tertiary: #9CA3AF;
  --gi-bg-primary: #FFFFFF;
  --gi-bg-secondary: #F9FAFB;
  --gi-bg-tertiary: #F3F4F6;
  --gi-border-primary: #E5E7EB;
  --gi-border-secondary: #D1D5DB;
  --gi-accent: var(--gi-cyan);
  --gi-accent-hover: #0088c7;
  --gi-success: #10B981;
  --gi-warning: #F59E0B;
  --gi-error: #EF4444;
  --gi-info: var(--gi-cyan);

  /* --- Typographie --- */
  --gi-font-primary: "Outfit", system-ui, -apple-system, sans-serif;
  --gi-font-secondary: "Zalando Sans", system-ui, -apple-system, sans-serif;
  /* Alias sans préfixe utilisés par les composants — désormais GLOBAUX (étaient
     light-only dans themes-gi → indéfinis en dark, d'où la typo non synchronisée). */
  --font-primary: "Outfit", system-ui, -apple-system, sans-serif;
  --font-secondary: "Zalando Sans", system-ui, -apple-system, sans-serif;

  /* Échelle typographique (size / line-height / letter-spacing) */
  --gi-text-h1-size: 48px;  --gi-text-h1-lh: 1.2;  --gi-text-h1-ls: -0.02em;
  --gi-text-h2-size: 36px;  --gi-text-h2-lh: 1.3;  --gi-text-h2-ls: -0.01em;
  --gi-text-h3-size: 28px;  --gi-text-h3-lh: 1.4;  --gi-text-h3-ls: 0;
  --gi-text-h4-size: 22px;  --gi-text-h4-lh: 1.4;  --gi-text-h4-ls: 0;
  --gi-text-h5-size: 18px;  --gi-text-h5-lh: 1.5;  --gi-text-h5-ls: 0;
  --gi-text-h6-size: 16px;  --gi-text-h6-lh: 1.5;  --gi-text-h6-ls: 0.01em;
  --gi-text-body-size: 16px;       --gi-text-body-lh: 1.6;       --gi-text-body-ls: 0;
  --gi-text-bodyLarge-size: 18px;  --gi-text-bodyLarge-lh: 1.7;  --gi-text-bodyLarge-ls: 0;
  --gi-text-bodySmall-size: 14px;  --gi-text-bodySmall-lh: 1.6;  --gi-text-bodySmall-ls: 0;
  --gi-text-caption-size: 12px;    --gi-text-caption-lh: 1.5;    --gi-text-caption-ls: 0.01em;
  --gi-text-quote-size: 20px;      --gi-text-quote-lh: 1.7;      --gi-text-quote-ls: 0;
  --gi-text-label-size: 14px;      --gi-text-label-lh: 1.4;      --gi-text-label-ls: 0.01em;

  /* --- Espacements (échelle 4px) --- */
  --gi-spacing-xs: 4px;
  --gi-spacing-sm: 8px;
  --gi-spacing-md: 16px;
  --gi-spacing-lg: 24px;
  --gi-spacing-xl: 32px;
  --gi-spacing-2xl: 48px;
  --gi-spacing-3xl: 64px;

  /* --- Rayons --- */
  --gi-radius-sm: 4px;
  --gi-radius-md: 8px;
  --gi-radius-lg: 12px;
  --gi-radius-xl: 16px;
  --gi-radius-full: 9999px;

  /* --- Ombres de base (neutres) --- */
  --gi-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --gi-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --gi-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --gi-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* --- Transitions --- */
  --gi-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --gi-transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --gi-transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* --- Z-index --- */
  --gi-z-base: 0;
  --gi-z-dropdown: 1000;
  --gi-z-sticky: 1100;
  --gi-z-modal: 1200;
  --gi-z-popover: 1300;
  --gi-z-tooltip: 1400;
}

/* ============================================================================
   2. THÈME SOMBRE — tokens sémantiques (ex themes.css :root.dark)
   ============================================================================ */
:root.dark {
  /* Charte GI : noir & blanc + cyan. Palette NEUTRE stark (ex-slate bleuté retoné
     2026-06-25) — gris purs, base noir profond, cyan #009FE3 = seul accent. */
  --bg-primary: #080808;
  --bg-secondary: #121212;
  --bg-tertiary: #1a1a1a;
  --bg-hover: #242424;

  --text-primary: #fafafa;
  --text-secondary: #d4d4d4;
  --text-tertiary: #a3a3a3;
  --text-muted: #737373;

  --border-primary: #202020;
  --border-secondary: #303030;

  --card-bg: #121212;
  --card-hover: #1c1c1c;

  --input-bg: #161616;
  --input-border: #303030;
  --input-focus: var(--gi-cyan);   /* [FIX] était #3b82f6 (bleu Tailwind) → cyan GI */

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);

  --skeleton-base: #1a1a1a;
  --skeleton-highlight: #262626;
}

/* ============================================================================
   3. THÈME CLAIR — valeurs EFFECTIVES (themes-gi.css gagne, themes.css comble)
   ============================================================================ */
:root.light {
  /* Palette GI (rappel local, identique au :root global) */
  --gi-black: #000000;
  --gi-cyan: #009FE3;
  --gi-web: #EB5D18;

  /* Textes (themes-gi) */
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-tertiary: #6B7280;
  --text-muted: #9CA3AF;

  /* Fonds (themes-gi) — light ÉLÉGANT (2026-06-25) : blancs nets + air.
     page = gris DOUX ; surfaces/cartes/inputs = blanc (définis par hairline + ombre, pas par aplats gris). */
  --bg-primary: #F8FAFB;          /* page : gris très léger (relief des cartes = ombre) */
  --bg-secondary: #FFFFFF;        /* bg-surface (inputs/panneaux) : blanc */
  --bg-tertiary: #F3F5F7;         /* bg-surface-inset : gris très subtil */
  --bg-hover: #EEF1F4;
  --card-bg: #FFFFFF;             /* cartes : blanc pur */
  --card-hover: #f8f9fa;          /* (themes.css — non redéfini par themes-gi) */
  --sidebar-bg: #FFFFFF;
  --sidebar-border: #dee2e6;      /* (themes.css) */
  --header-bg: #ffffff;           /* (themes.css) */
  --modal-bg: #ffffff;            /* (themes.css) */
  --main-bg: #F8FAFB;

  /* Bordures (themes-gi) — hairline élégantes */
  --border-primary: #E8EBEF;      /* cartes : bordure très subtile (l'ombre fait le relief) */
  --border-secondary: #DDE1E6;    /* inputs : hairline visible mais fine */

  /* Inputs */
  --input-bg: #FFFFFF;
  --input-border: #DDE1E6;
  --input-focus: var(--gi-cyan);  /* [FIX] était #3b82f6 (bleu Tailwind) → cyan GI */

  /* Accents & actions (themes-gi) */
  --accent: var(--gi-cyan);
  --accent-hover: #0088c7;
  --btn-primary: var(--gi-web);
  --btn-primary-hover: #d15316;

  /* États (themes-gi) */
  --success: #059669;
  --warning: #D97706;
  --error: #DC2626;
  --info: var(--gi-cyan);

  /* Skeleton (themes-gi) */
  --skeleton-base: #e0e4e8;
  --skeleton-highlight: #eef0f3;

  /* Ombres (themes-gi) */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.10), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.06);

  /* Ombres spécialisées (themes.css — non redéfinies par themes-gi) */
  --shadow-sidebar: 3px 0 12px -2px rgba(0, 0, 0, 0.08), 1px 0 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 2px 8px -2px rgba(0, 0, 0, 0.08), 0 1px 3px -1px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 8px 24px -4px rgba(0, 0, 0, 0.12), 0 4px 8px -2px rgba(0, 0, 0, 0.06);
  --shadow-interactive: 0 4px 16px -3px rgba(0, 159, 227, 0.12), 0 2px 6px -2px rgba(0, 0, 0, 0.06);

  /* Typographie GI (themes-gi) */
  --font-primary: "Outfit", system-ui, -apple-system, sans-serif;
  --font-secondary: "Zalando Sans", system-ui, -apple-system, sans-serif;

  /* Échelle de gris + sémantiques `--color-*` (absorbé de gi-utilities.css)
     NB: scope conservé en :root.light pour préserver l'effectif. Candidat à
     promouvoir en :root global (valeurs littérales, indépendantes du thème) en N1. */
  --gi-orange: var(--gi-web);   /* alias historique de --gi-web (#EB5D18) */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-error: #EF4444;
  --color-info: #009FE3;
  --color-gray-50: #F9FAFB;
  --color-gray-100: #F3F4F6;
  --color-gray-200: #E5E7EB;
  --color-gray-300: #D1D5DB;
  --color-gray-400: #9CA3AF;
  --color-gray-500: #6B7280;
  --color-gray-600: #4B5563;
  --color-gray-700: #374151;
  --color-gray-800: #1F2937;
  --color-gray-900: #111827;
}
