/* =================================================================
   Design tokens — SINGLE SOURCE OF TRUTH
   Change a value here and it propagates everywhere. Every other
   stylesheet must reference these via var(--…) rather than
   hardcoding colours, spacing, radii, shadows or z-index.
   Loaded first on every page (app shell + standalone auth pages).
   ================================================================= */
:root {
    /* Couleurs — palette de marque (chaude), pas l'indigo générique */
    --primary-color: #b23a1e;      /* terracotta de marque (corail assombri) */
    --primary-dark: #942f18;       /* survol / actif */
    --primary-rgb: 178, 58, 30;    /* pour les rgba() teintés */
    --color-success-rgb: 41, 166, 73;  /* = --color-success, pour rgba() */
    --secondary-color: #6b7280;
    --light-color: #f8f9fa;
    --dark-color: #1a1a2e;         /* encre de marque */
    --border-color: #e9ecef;
    --color-success: #29a649;      /* vert de marque */
    --color-danger: #d11a2a;       /* rouge vif, distinct du terracotta */
    --color-warning: #f29220;      /* orange de marque */

    /* Rayons */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 20px;

    /* Ombres */
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.2s ease;

    /* Échelle d'espacement (base 4px — reflète l'usage existant) */
    --space-2xs: 0.25rem;  /*  4px */
    --space-xs:  0.5rem;   /*  8px */
    --space-sm:  0.75rem;  /* 12px */
    --space-md:  1rem;     /* 16px */
    --space-lg:  1.5rem;   /* 24px */
    --space-xl:  2rem;     /* 32px */
    --space-2xl: 2.5rem;   /* 40px */
    --space-3xl: 4rem;     /* 64px */

    /* Typographie */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-serif: 'DM Serif Display', Georgia, serif;
    --text-xs:   0.75rem;
    --text-sm:   0.875rem;
    --text-base: 1rem;
    --text-lg:   1.125rem;
    --text-xl:   1.5rem;
    --text-2xl:  1.75rem;
    --text-3xl:  2rem;

    /* Gris neutres (remplace les greys ad-hoc) */
    --color-surface:      #ffffff;
    --color-bg:           #f8f9fa;
    --color-bg-subtle:    #f3f4f6;
    --color-border-subtle:#e5e7eb;
    --color-text:         #2c3e50;
    --color-text-muted:   #6b7280;
    --color-text-faint:   #9ca3af;

    /* Statuts (badges + alertes) — paires fond/texte, teintées marque */
    --status-neutral-bg: #f3f4f6; --status-neutral-fg: #4b5563;
    --status-info-bg:    #e7effb; --status-info-fg:    #2b5aad;
    --status-success-bg: #eaf6ec; --status-success-fg: #1b6b30;
    --status-warning-bg: #fdf1e0; --status-warning-fg: #8a5310;
    --status-danger-bg:  #fbeced; --status-danger-fg:  #a01521;
    --status-externe-bg: #fff3e0; --status-externe-fg: #b45309;

    /* Échelle z-index (remplace 13 valeurs magiques) */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-overlay: 1000;
    --z-modal: 2000;
    --z-toast: 3000;
    --z-tooltip: 4000;

    /* Compat (anciens noms conservés) */
    --border-radius: var(--radius-md);
    --box-shadow: var(--shadow-md);
}
