/* =========================================================================
   FiscaDuo – identité « Duo »
   Chaque déclarant a sa couleur (d0 corail, d1 sarcelle), le foyer reste à l'encre.
   Les états (succès, attention, danger) ont leurs propres teintes et sont toujours
   accompagnés d'une icône et d'un libellé : une couleur de personne n'est jamais un état.

   Ce fichier n'est pas dans une couche (@layer) : ses valeurs priment sur le thème
   par défaut de Web Awesome, chargé avant lui. Les paires texte / fond sont vérifiées
   par test/contraste.test.js (ratio ≥ 4,5:1 pour le texte, ≥ 3:1 pour les repères).
   ========================================================================= */
:root {
  /* --- Personnes du foyer --- */
  --fd-d0: #e2614b;          /* repère : liseré, segment, pastille */
  --fd-d0-texte: #b03f2c;    /* texte coloré */
  --fd-d0-fond: #fce8e3;     /* fond teinté */
  --fd-d1: #138a80;
  --fd-d1-texte: #0b6c64;
  --fd-d1-fond: #dcf1ee;
  --fd-foyer: #22303c;       /* encre : marque, foyer, totaux */
  --fd-foyer-fond: #eef1f5;

  /* --- Surfaces et texte --- */
  --fd-fond: #fbf7f2;        /* crème de la page */
  --fd-surface: #ffffff;     /* cartes */
  --fd-surface-basse: #f5f0ea; /* tuiles dans une carte */
  --fd-surface-haute: #ede6dd;
  --fd-trait: #e6dfd6;
  --fd-trait-fort: #948f89;
  --fd-texte: #1e2328;
  --fd-texte-doux: #5a5753;

  /* --- Typographie : 6 tailles --- */
  --fd-police-titre: 'Bricolage Grotesque Variable', 'Inter Variable', ui-sans-serif, system-ui, sans-serif;
  --fd-police-texte: 'Inter Variable', ui-sans-serif, system-ui, sans-serif;
  --fd-texte-xs: 0.75rem;    /* 12 px : étiquettes, aides */
  --fd-texte-s: 0.875rem;    /* 14 px : texte courant */
  --fd-texte-m: 1rem;        /* 16 px : titres de section */
  --fd-texte-l: 1.25rem;     /* 20 px : titres de carte */
  --fd-texte-xl: 1.75rem;    /* 28 px : titre de page, montants */
  --fd-texte-2xl: 2.25rem;   /* 36 px : montants principaux */

  /* --- Rayons et espacements (base 4 px) --- */
  --fd-rayon-s: 8px;
  --fd-rayon-m: 12px;
  --fd-rayon-l: 20px;
  --fd-rayon-pilule: 999px;
  --fd-espace-1: 4px;
  --fd-espace-2: 8px;
  --fd-espace-3: 12px;
  --fd-espace-4: 16px;
  --fd-espace-5: 20px;
  --fd-espace-6: 24px;
  --fd-espace-8: 32px;
  --fd-espace-10: 40px;
  --fd-ombre: 0 1px 2px rgb(34 48 60 / 0.06), 0 4px 16px rgb(34 48 60 / 0.06);

  /*
    Verre de la navigation : assez transparent pour laisser voir le contenu flouté qui défile dessous, assez teinté
    pour garder le texte lisible. Les sous-menus, aux textes plus longs, ont un verre plus dense. Flou limité à 12 px :
    au-delà, Chromium laisse passer net le texte sous le verre sur les écrans à forte densité.
  */
  --fd-verre-fond: rgb(255 255 255 / 0.62);
  --fd-verre-fond-dense: rgb(255 255 255 / 0.8);
  --fd-verre-flou: blur(12px) saturate(1.6);
  --fd-verre-reflet: rgb(255 255 255 / 0.75);
  --fd-verre-bord: rgb(148 143 137 / 0.24);
  --fd-verre-ombre: 0 12px 36px rgb(34 48 60 / 0.10), 0 2px 8px rgb(34 48 60 / 0.05), inset 0 1px 0 rgb(255 255 255 / 0.9);

  /* --- Correspondance avec Web Awesome --- */
  --wa-font-family-body: var(--fd-police-texte);
  --wa-font-family-heading: var(--fd-police-titre);
  --wa-font-weight-heading: 650;
  --wa-border-radius-s: var(--fd-rayon-s);
  --wa-border-radius-m: var(--fd-rayon-m);
  --wa-border-radius-l: var(--fd-rayon-l);
  --wa-form-control-border-radius: var(--fd-rayon-m);
  --wa-form-control-label-font-weight: 550;
  --wa-form-control-hint-line-height: 1.4;
  --wa-form-control-placeholder-color: var(--fd-trait-fort);
  --wa-form-control-activated-color: var(--fd-foyer);
  --wa-panel-border-radius: var(--fd-rayon-l);
  --wa-focus-ring-width: 2px;
  --wa-focus-ring-offset: 2px;

  /* Encre (marque) */
  --wa-color-brand-95: #eef1f5;
  --wa-color-brand-90: #dde3ea;
  --wa-color-brand-80: #bac7d3;
  --wa-color-brand-70: #93a7ba;
  --wa-color-brand-60: #6d879f;
  --wa-color-brand-50: #4d6a85;
  --wa-color-brand-40: #3d566c;
  --wa-color-brand-30: #2f4253;
  --wa-color-brand-20: #22303c;
  --wa-color-brand-10: #151e27;
  --wa-color-brand-05: #0e141a;

  /* Neutres chauds */
  --wa-color-neutral-95: #f3eee8;
  --wa-color-neutral-90: #e6e0d8;
  --wa-color-neutral-80: #cdc8c1;
  --wa-color-neutral-70: #b1ada7;
  --wa-color-neutral-60: #948f89;
  --wa-color-neutral-50: #76736f;
  --wa-color-neutral-40: #5a5753;
  --wa-color-neutral-30: #45494f;
  --wa-color-neutral-20: #2e3339;
  --wa-color-neutral-10: #1c2025;
  --wa-color-neutral-05: #121519;

  /* Succès : vert prairie, distinct de la sarcelle */
  --wa-color-success-95: #eaf5e9;
  --wa-color-success-90: #d2ebd2;
  --wa-color-success-80: #a4d3a6;
  --wa-color-success-70: #77b87c;
  --wa-color-success-60: #4e9a55;
  --wa-color-success-50: #2e7536;
  --wa-color-success-40: #26632d;
  --wa-color-success-30: #1e4f24;
  --wa-color-success-20: #173a1b;
  --wa-color-success-10: #102612;
  --wa-color-success-05: #0b1a0c;

  /* Attention : ambre */
  --wa-color-warning-95: #fdf2de;
  --wa-color-warning-90: #fbe3bc;
  --wa-color-warning-80: #f2c47e;
  --wa-color-warning-70: #e0a040;
  --wa-color-warning-60: #c27a0a;
  --wa-color-warning-50: #995c00;
  --wa-color-warning-40: #7f4c00;
  --wa-color-warning-30: #643c00;
  --wa-color-warning-20: #482b00;
  --wa-color-warning-10: #2e1b00;
  --wa-color-warning-05: #1f1200;

  /* Danger : framboise, distinct du corail */
  --wa-color-danger-95: #fdedf0;
  --wa-color-danger-90: #fad9df;
  --wa-color-danger-80: #f2aeba;
  --wa-color-danger-70: #e57d90;
  --wa-color-danger-60: #cf4d67;
  --wa-color-danger-50: #aa2443;
  --wa-color-danger-40: #8c1d37;
  --wa-color-danger-30: #6e172b;
  --wa-color-danger-20: #50111f;
  --wa-color-danger-10: #330a13;
  --wa-color-danger-05: #22060c;

  --wa-color-surface-default: var(--fd-surface);
  --wa-color-surface-raised: var(--fd-surface);
  --wa-color-surface-lowered: var(--fd-surface-basse);
  --wa-color-surface-border: var(--fd-trait);
  --wa-color-text-normal: var(--fd-texte);
  --wa-color-text-quiet: var(--fd-texte-doux);
  --wa-color-text-link: var(--fd-foyer);
  --wa-color-focus: var(--wa-color-brand-50);

  /* Boutons principaux à l'encre */
  --wa-color-brand-fill-quiet: var(--wa-color-brand-95);
  --wa-color-brand-fill-normal: var(--wa-color-brand-90);
  --wa-color-brand-fill-loud: var(--fd-foyer);
  --wa-color-brand-border-quiet: var(--wa-color-brand-90);
  --wa-color-brand-border-normal: var(--wa-color-brand-80);
  --wa-color-brand-border-loud: var(--wa-color-brand-40);
  --wa-color-brand-on-quiet: var(--wa-color-brand-30);
  --wa-color-brand-on-normal: var(--fd-foyer);
  --wa-color-brand-on-loud: #ffffff;
  --wa-color-neutral-border-loud: var(--fd-trait-fort);

  color-scheme: light;
}

/* Thème sombre : classe wa-dark sur <html>, posée par app.js */
:root.wa-dark {
  --fd-d0: #ff8a73;
  --fd-d0-texte: #ff9c88;
  --fd-d0-fond: #3b2420;
  --fd-d1: #4fc3b6;
  --fd-d1-texte: #63d2c5;
  --fd-d1-fond: #133330;
  --fd-foyer: #e9e3da;
  --fd-foyer-fond: #222b35;

  --fd-fond: #14181d;
  --fd-surface: #1c2127;
  --fd-surface-basse: #232930;
  --fd-surface-haute: #2b323a;
  --fd-trait: #343c45;
  --fd-trait-fort: #7d858e;
  --fd-texte: #f2eee9;
  --fd-texte-doux: #b5aea6;
  --fd-ombre: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 16px rgb(0 0 0 / 0.2);

  --fd-verre-fond: rgb(28 33 39 / 0.7);
  --fd-verre-fond-dense: rgb(28 33 39 / 0.84);
  --fd-verre-reflet: rgb(255 255 255 / 0.06);
  --fd-verre-bord: rgb(242 238 233 / 0.16);
  --fd-verre-ombre: 0 12px 36px rgb(0 0 0 / 0.32), 0 2px 8px rgb(0 0 0 / 0.18), inset 0 1px 0 rgb(255 255 255 / 0.10);

  --wa-color-focus: var(--wa-color-brand-70);
  --wa-color-brand-fill-quiet: var(--wa-color-brand-10);
  --wa-color-brand-fill-normal: #26323f;
  --wa-color-brand-fill-loud: var(--fd-foyer);
  --wa-color-brand-border-quiet: var(--wa-color-brand-20);
  --wa-color-brand-border-normal: var(--wa-color-brand-30);
  --wa-color-brand-border-loud: var(--wa-color-brand-60);
  --wa-color-brand-on-quiet: var(--wa-color-brand-80);
  --wa-color-brand-on-normal: var(--fd-foyer);
  --wa-color-brand-on-loud: var(--wa-color-brand-20);
  /* Texte des encadrés d'état un ton plus clair en sombre */
  --wa-color-success-on-quiet: var(--wa-color-success-70);
  --wa-color-warning-on-quiet: var(--wa-color-warning-70);
  --wa-color-danger-on-quiet: var(--wa-color-danger-70);
  --wa-color-neutral-border-loud: var(--fd-trait-fort);

  color-scheme: dark;
}
