/* =====================================================================
   DESIGN TOKENS — Identité visuelle EPGE/MI.F.HA.C
   Palette dérivée du logo officiel :
   - Vert palmier profond   -> couleur de marque principale
   - Terre cuite / rouille  -> accent chaleureux (texte du sceau, aigle)
   - Or / ocre              -> accent précieux (offrandes, mise en valeur)
   - Bleu ciel du globe     -> accent informatif discret
   - Papier ivoire chaud    -> fond général (PAS de gradient dominant)
   ===================================================================== */

:root {
    /* Couleurs de marque */
    --brand-green-900: #0F2E22;
    --brand-green-800: #163F2F;
    --brand-green-700: #1F5C42;
    --brand-green-600: #2E6F52;
    --brand-green-500: #3E8564;
    --brand-green-100: #E4EFE7;
    --brand-green-50:  #F1F6F2;

    --brand-terracotta-700: #9A4A1A;
    --brand-terracotta-600: #B5651D;
    --brand-terracotta-500: #C9752E;
    --brand-terracotta-100: #FBE9DA;

    --brand-gold-700: #9C7A15;
    --brand-gold-600: #C9A227;
    --brand-gold-100: #F8EFCF;

    --brand-sky-700: #2A5D82;
    --brand-sky-600: #3E7CB1;
    --brand-sky-100: #E2EEF6;

    /* Neutres */
    --ink-900: #191E1B;
    --ink-800: #2A3128;
    --ink-700: #3D453F;
    --ink-600: #565F58;
    --ink-500: #737C74;
    --ink-400: #9BA39A;
    --ink-300: #C4CAC1;
    --ink-200: #E1E5DE;
    --ink-100: #EFF1EB;

    --paper-0: #FFFFFF;
    --paper-50: #FBF9F4;
    --paper-100: #F5F2EA;

    /* États sémantiques */
    --state-success: #1F5C42;
    --state-success-bg: #E4EFE7;
    --state-warning: #9C7A15;
    --state-warning-bg: #F8EFCF;
    --state-danger: #A32B2B;
    --state-danger-bg: #F8E4E1;
    --state-info: #2A5D82;
    --state-info-bg: #E2EEF6;

    /* Typographie */
    --font-display: 'Fraunces', 'Georgia', serif;
    --font-body: 'Work Sans', 'Segoe UI', sans-serif;
    --font-mono-num: 'Work Sans', sans-serif;

    /* Rayons & bordures — géométrie nette, pas de glassmorphism */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --border-thin: 1px solid var(--ink-200);
    --border-brand: 1px solid var(--brand-green-600);

    /* Ombres discrètes (profondeur par hiérarchie, pas par flou) */
    --shadow-xs: 0 1px 2px rgba(25, 30, 27, 0.06);
    --shadow-sm: 0 2px 8px rgba(25, 30, 27, 0.08);
    --shadow-md: 0 6px 20px rgba(25, 30, 27, 0.10);

    /* Rythme */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;

    /* Transitions */
    --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --dur-fast: 140ms;
    --dur-base: 220ms;
    --dur-slow: 380ms;

    /* Thèmes & Dégradés de cartes (Style claquant et épuré) */
    --card-grad-emerald: linear-gradient(145deg, #0d3827 0%, #17543b 50%, #1f6b4d 100%);
    --card-grad-terracotta: linear-gradient(145deg, #743111 0%, #99451a 50%, #bd5a25 100%);
    --card-grad-gold: linear-gradient(145deg, #87620c 0%, #b38515 50%, #d4a324 100%);
    --card-grad-sky: linear-gradient(145deg, #184369 0%, #255d8f 50%, #3577b3 100%);
    --card-grad-purple: linear-gradient(145deg, #4c1d4f 0%, #6d2c72 50%, #8c3e92 100%);
    --card-grad-dark: linear-gradient(145deg, #161c18 0%, #242c27 50%, #323d37 100%);
    --card-grad-ivory: linear-gradient(145deg, #ffffff 0%, #fcfbfa 60%, #f6f3eb 100%);

    /* Motifs Filigranes (SVG Data URIs) */
    --filigree-rosace: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><defs><pattern id='g1' width='40' height='40' patternUnits='userSpaceOnUse'><path d='M0 20 Q10 0 20 20 T40 20 M20 0 Q30 20 20 40 T20 0' stroke='%23ffffff' stroke-width='1' fill='none' stroke-opacity='0.15'/></pattern></defs><rect width='200' height='200' fill='url(%23g1)'/><circle cx='160' cy='160' r='90' fill='none' stroke='%23ffffff' stroke-width='2' stroke-opacity='0.12'/><circle cx='160' cy='160' r='60' fill='none' stroke='%23ffffff' stroke-width='1' stroke-dasharray='4,4' stroke-opacity='0.15'/></svg>");
    --filigree-palmes: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g fill='none' stroke='%23ffffff' stroke-width='1.2' stroke-opacity='0.14'><path d='M100 200 C120 140 180 120 200 100 C140 120 120 180 100 200 Z'/><path d='M100 200 C80 140 20 120 0 100 C60 120 80 180 100 200 Z'/><path d='M100 200 C110 110 190 70 200 0 C130 50 100 130 100 200 Z'/><circle cx='180' cy='40' r='30' stroke-opacity='0.1'/></g></svg>");
    --filigree-sceau: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g fill='none' stroke='%23ffffff' stroke-opacity='0.18'><circle cx='150' cy='150' r='80' stroke-width='1.5'/><circle cx='150' cy='150' r='65' stroke-width='1' stroke-dasharray='6,3'/><path d='M150 50 L150 250 M50 150 L250 150 M79 79 L221 221 M79 221 L221 79' stroke-width='1'/><polygon points='150,90 165,135 210,150 165,165 150,210 135,165 90,150 135,135' stroke-width='1.2'/></g></svg>");
    --filigree-constellation: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><defs><pattern id='p4' width='30' height='30' patternUnits='userSpaceOnUse'><path d='M0 30 L30 0 M0 0 L30 30' stroke='%23ffffff' stroke-opacity='0.12' stroke-width='1'/><circle cx='15' cy='15' r='2' fill='%23ffffff' fill-opacity='0.15'/></pattern></defs><rect width='200' height='200' fill='url(%23p4)'/><circle cx='170' cy='30' r='70' fill='none' stroke='%23ffffff' stroke-opacity='0.12' stroke-width='1.5'/></svg>");
    --filigree-vitrail: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g fill='none' stroke='%23ffffff' stroke-width='1.2' stroke-opacity='0.15'><path d='M100 0 L200 100 L100 200 L0 100 Z'/><path d='M100 30 L170 100 L100 170 L30 100 Z'/><path d='M100 60 L140 100 L100 140 L60 100 Z'/><circle cx='100' cy='100' r='25'/></g></svg>");
    --filigree-mesh: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><defs><pattern id='p6' width='40' height='40' patternUnits='userSpaceOnUse'><path d='M20 0 L40 10 L40 30 L20 40 L0 30 L0 10 Z' fill='none' stroke='%23ffffff' stroke-opacity='0.10' stroke-width='1'/></pattern></defs><rect width='200' height='200' fill='url(%23p6)'/><circle cx='180' cy='180' r='100' fill='none' stroke='%23ffffff' stroke-opacity='0.08' stroke-width='2'/></svg>");
    --filigree-light: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g fill='none' stroke='%23191e1b' stroke-opacity='0.06' stroke-width='1.2'><circle cx='170' cy='170' r='90'/><circle cx='170' cy='170' r='60' stroke-dasharray='4,4'/><path d='M170 50 L170 290 M50 170 L290 170'/><polygon points='170,110 183,157 230,170 183,183 170,230 157,183 110,170 157,157'/></g></svg>");

    --sidebar-width: 264px;
    --sidebar-width-collapsed: 76px;
    --topbar-height: 68px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

[data-theme="dark"] {
    --ink-900: #F2F4F0;
    --ink-800: #DDE2D9;
    --ink-700: #C0C7BC;
    --ink-600: #9AA396;
    --ink-500: #7A8476;
    --ink-400: #5E675A;
    --ink-300: #3D453F;
    --ink-200: #2A3128;
    --ink-100: #222A24;

    --paper-0: #161C18;
    --paper-50: #1B221D;
    --paper-100: #202822;

    --brand-green-50: #17251C;
    --brand-green-100: #1D3327;

    --border-thin: 1px solid var(--ink-200);
}
