/* Fluencia — contrastes AA vérifiés sur fond blanc / fond carte */
:root {
  --fond: #f4f6fb;
  --carte: #ffffff;
  --texte: #1b2433;
  --texte-doux: #4a5568;   /* 7.5:1 sur blanc */
  --principal: #1d4ed8;    /* 6.7:1 avec texte blanc */
  --principal-fonce: #1e3a8a;
  --bordure: #cbd5e1;
  --erreur: #b91c1c;
  --surligne: #fde68a;
  --rayon: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--texte);
  background: var(--fond);
  line-height: 1.5;
}
* { box-sizing: border-box; }
/* L'attribut hidden doit toujours gagner, même sur un élément en display:flex */
[hidden] { display: none !important; }
body { margin: 0; }
.lien-evitement { position: absolute; left: -999px; top: 0; background: var(--principal); color: #fff; padding: .5rem 1rem; z-index: 10; }
.lien-evitement:focus { left: 0; }
.visuellement-masque { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.entete { text-align: center; padding: 2rem 1rem 1rem; }
.entete h1 { margin: 0; font-size: 2.2rem; color: var(--principal-fonce); letter-spacing: -.02em; }
.sous-titre { margin: .25rem 0 0; color: var(--texte-doux); }

main { max-width: 760px; margin: 0 auto; padding: 0 1rem 2rem; }
.carte { background: var(--carte); border-radius: var(--rayon); padding: 1.25rem 1.5rem; margin: 1rem 0;
         box-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 16px rgba(15, 23, 42, .05); }
.carte h2 { margin: 0 0 .75rem; font-size: 1.2rem; }

.depot { border: 2px dashed var(--bordure); border-radius: var(--rayon); padding: 1.75rem 1rem; text-align: center;
         color: var(--texte-doux); cursor: pointer; transition: border-color .15s, background .15s; }
.depot p { margin: .25rem 0; }
.depot strong { color: var(--texte); }
.depot.survol, .depot:hover { border-color: var(--principal); background: #eef2ff; }
.aide { font-size: .9rem; color: var(--texte-doux); }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-top: 1rem; }
.bouton { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .55rem 1.1rem; border-radius: 10px;
          border: 1px solid var(--bordure); background: #fff; color: var(--texte); font: inherit; font-weight: 600; cursor: pointer; }
.bouton:hover { border-color: var(--principal); }
.bouton.principal { background: var(--principal); border-color: var(--principal); color: #fff; }
.bouton.principal:hover { background: var(--principal-fonce); }
:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
#fichier:focus-visible + .bouton, label.bouton:focus-within { outline: 3px solid #f59e0b; }

.enregistrement { text-align: center; margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; align-items: center; }
.enregistrement p { width: 100%; margin: 0; }
.point-rec { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: var(--erreur); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.confidentialite { font-size: .85rem; color: var(--texte-doux); text-align: center; margin: 1rem 0 0; }

.fichier-nom { color: var(--texte-doux); margin: 0 0 .75rem; word-break: break-all; }
.etapes { display: flex; list-style: none; padding: 0; margin: 0 0 .75rem; gap: .5rem; flex-wrap: wrap; }
.etapes li { flex: 1; min-width: 6rem; text-align: center; font-size: .85rem; padding: .35rem; border-radius: 8px;
             background: #eef1f6; color: var(--texte-doux); }
.etapes li.active { background: var(--principal); color: #fff; font-weight: 600; }
.etapes li.faite { background: #dbeafe; color: var(--principal-fonce); }
progress { width: 100%; height: 14px; accent-color: var(--principal); }

.erreur { border-left: 6px solid var(--erreur); }
.erreur h2 { color: var(--erreur); }

.resultat { text-align: center; }
.mpm { margin: .5rem 0 1rem; }
.mpm-valeur { display: block; font-size: clamp(3.5rem, 14vw, 5.5rem); font-weight: 800; line-height: 1; color: var(--principal-fonce); }
.mpm-unite { font-size: 1.1rem; color: var(--texte-doux); }
.chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: 0 0 1rem; }
.chiffres div { background: #f1f5f9; border-radius: 10px; padding: .6rem .4rem; }
.chiffres dt { font-size: .8rem; color: var(--texte-doux); }
.chiffres dd { margin: 0; font-size: 1.35rem; font-weight: 700; }
.precision { font-size: .9rem; color: var(--texte-doux); }
.regles { text-align: left; margin: .75rem 0; }
.regles summary { cursor: pointer; font-weight: 600; color: var(--principal-fonce); }
.regles ul { margin: .5rem 0 0; padding-left: 1.2rem; font-size: .9rem; }
.avertissement { font-size: .8rem; color: var(--texte-doux); margin: .75rem 0 0; }

.titre-ligne { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.titre-ligne h2 { margin: 0; }
audio { width: 100%; margin: .75rem 0 .25rem; }
.texte { margin-top: .75rem; padding: 1rem; border: 1px solid var(--bordure); border-radius: 10px; background: #fbfcfe;
         font-size: 1.1rem; line-height: 1.8; max-height: 22rem; overflow-y: auto; }
.texte .m { cursor: pointer; border-radius: 4px; padding: 0 .05em; }
.texte .m.actif { background: var(--surligne); box-shadow: 0 0 0 2px var(--surligne); }
.centre { text-align: center; }
.pied { text-align: center; font-size: .8rem; color: var(--texte-doux); padding: 1rem; }

@media (max-width: 520px) {
  .carte { padding: 1rem; }
  .chiffres { grid-template-columns: 1fr; }
  .etapes li { min-width: 4.5rem; font-size: .75rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
