/* ==========================================================================
   HydSmPro 2026 — tokens.css
   Source unique du design system — généré par audit P0 du 2026-04-27
   --------------------------------------------------------------------------
   Stratégie de migration :
   1. La famille --hp-* est la SEULE source de vérité.
   2. Les anciens noms (--navy, --blue, --green, --red, --bg, --border…) sont
      conservés en alias pour ne rien casser. Ils sont marqués @deprecated.
   3. Sprint suivant : grep -r "var(--blue)" → var(--hp-blue), puis supprimer
      le bloc d'alias en bas de ce fichier.
   ==========================================================================
*/

:root {
  /* ----------- COULEURS PRIMAIRES (canon) ----------- */
  --hp-blue:        #1d70b7;
  --hp-blue-100:    #eaf3fb;
  --hp-blue-700:    #155a93;
  --hp-dark:        #0b2140;
  --hp-dark-soft:   #14304f;

  /* ----------- COULEURS NEUTRES ----------- */
  --hp-bg:          #f7faff;
  --hp-bg2:         #eef5fb;
  --hp-border:      #dce5f5;
  --hp-text:        #172033;
  --hp-muted:       #667085;
  --hp-disabled:    #b9c2d6;

  /* ----------- COULEURS SÉMANTIQUES ----------- */
  --hp-success:     #12b76a;
  --hp-success-100: #e6f8ee;
  --hp-warning:     #ffa940;
  --hp-warning-100: #fff5e0;
  --hp-danger:      #ff4d4f;
  --hp-danger-100:  #ffeaea;
  --hp-info:        #5dade2;

  /* ----------- COULEURS PRIORITÉ AUDIT (réutilisables) ----------- */
  --hp-p0:          #dc2626;
  --hp-p1:          #ea580c;
  --hp-p2:          #0891b2;
  --hp-p3:          #16a34a;

  /* ----------- TYPO & POIDS ----------- */
  --hp-fw-medium:   500;
  --hp-fw-semibold: 600;
  --hp-fw-bold:     700;

  /* ----------- LAYOUT ----------- */
  --hp-content-max: 1840px;   /* +280px vs actuel — exploiter écrans larges */
}

/* ==========================================================================
   ALIAS DE COMPATIBILITÉ — @deprecated (à supprimer au sprint +1)
   ==========================================================================
   Tant que ces alias existent, le code legacy continue de fonctionner.
   Pour migrer : grep -r "var(--blue)" → var(--hp-blue), puis supprimer.
*/
:root {
  /* @deprecated : utiliser --hp-* à la place */
  --navy:    var(--hp-dark);
  --blue:    var(--hp-blue);
  --blue2:   var(--hp-blue-700);
  --blue3:   var(--hp-info);
  --green:   var(--hp-success);
  --hp-green: var(--hp-success);  /* ancien #55e639 trop saturé, on aligne */
  --amber:   var(--hp-warning);
  --red:     var(--hp-danger);
  --gray:    var(--hp-muted);
  --bg:      var(--hp-bg);
  --light:   var(--hp-bg);
  --border:  var(--hp-border);
}

/* ==========================================================================
   AMÉLIORATIONS A11Y GLOBALES (non-invasives)
   ==========================================================================
*/

/* Focus visible accessible (WCAG 2.4.7) */
*:focus-visible {
  outline: 3px solid var(--hp-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Astérisque champ obligatoire saillant */
label .required,
label[data-required="true"]::after {
  content: " *";
  color: var(--hp-danger);
  font-weight: var(--hp-fw-bold);
  margin-left: 2px;
}

/* Inputs vides obligatoires : signal visuel à la perte de focus */
input[required]:not(:focus):invalid,
select[required]:not(:focus):invalid,
textarea[required]:not(:focus):invalid {
  border-color: var(--hp-danger);
  background: var(--hp-danger-100);
}

/* Boutons icône : hit zone min 40px (WCAG 2.5.5 Target Size) */
.icon-btn,
button[aria-label]:not([class*=text]):not([class*=primary]) {
  min-width: 40px;
  min-height: 40px;
}

/* Animation transition entre modules (P3 — fluidifie navigation) */
@media (prefers-reduced-motion: no-preference) {
  .module-content,
  [data-module-content] {
    animation: hp-fade-in 150ms ease-out;
  }
  @keyframes hp-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}
