/* Bilan de la Fatigue : la feuille de l'application (accueil, passation, boutons).
 * La feuille du RAPPORT n'est pas ici : elle vit dans js/report-style.js
 * (adoptedStyleSheets, sous la CSP style-src 'self'). Des classes, jamais de style en ligne. */

:root {
  --fond: #f6f7f6;
  --carte: #ffffff;
  --texte: #1a1d1c;
  --doux: #545c59;
  --trait: #d5dbd8;
  --accent: #2c5f55;
  --sur-accent: #ffffff;
  --alerte: #9a3b22;
  --fond-alerte: #fbefe9;
  --choisi: #e2eeea;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #121514;
    --carte: #1a1e1d;
    --texte: #e3e8e6;
    --doux: #9aa5a1;
    --trait: #2d3532;
    --accent: #8fc9bb;
    --sur-accent: #0f1f1b;
    --alerte: #f0a184;
    --fond-alerte: #2a1c17;
    --choisi: #1d2e2a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: break-word;
}
.dedans { max-width: 46rem; margin: 0 auto; padding: 0 1rem; }

.entete { position: sticky; top: 0; z-index: 5; background: var(--fond); border-bottom: 1px solid var(--trait); }
.entete-ligne { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .2rem 1rem; padding-top: .6rem; padding-bottom: .3rem; }
.marque { margin: 0; font-weight: 700; letter-spacing: .01em; }
.compteur { margin: 0; color: var(--doux); font-size: .85rem; font-variant-numeric: tabular-nums; }
progress#jauge { display: block; width: 100%; height: .3rem; border: 0; appearance: none; -webkit-appearance: none; background: var(--trait); }
progress#jauge::-webkit-progress-bar { background: var(--trait); }
progress#jauge::-webkit-progress-value { background: var(--accent); }
progress#jauge::-moz-progress-bar { background: var(--accent); }

main { padding-top: 1.2rem; padding-bottom: 3rem; }
main:focus { outline: none; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: .4rem 0 .6rem; }
h1:focus { outline: none; }
.chapeau { font-size: 1.08rem; }
.sous-titre { color: var(--doux); margin-top: -.3rem; }
.confidentialite { color: var(--doux); font-size: .95rem; }

.question { border: 1px solid var(--trait); background: var(--carte); border-radius: 6px; margin: 1rem 0; padding: .8rem 1rem 1rem; min-width: 0; }
.question legend { float: left; width: 100%; padding: 0; margin: 0 0 .6rem; font-weight: 600; line-height: 1.4; }
.question legend + * { clear: both; }
.aide-question { clear: both; margin: 0 0 .7rem; color: var(--doux); font-size: .92rem; }
.echelle { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; }
.echelle-note { grid-template-columns: repeat(11, minmax(0, 1fr)); }
.reponses { display: grid; gap: .45rem; }
.option { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--trait); border-radius: 5px; padding: .55rem .6rem; cursor: pointer; min-height: 2.75rem; font-size: .95rem; }
.echelle .option { justify-content: center; text-align: center; flex-direction: column; gap: .25rem; font-size: .85rem; }
.option:has(input:checked) { border-color: var(--accent); background: var(--choisi); }
.option input { accent-color: var(--accent); margin: 0; flex: none; }

/* La consigne de l'échelle, posée avant les affirmations qu'elle concerne. */
.consigne-echelle { margin: 1.2rem 0 .4rem; padding: .6rem .8rem; border-left: 3px solid var(--accent); background: var(--choisi); font-size: .95rem; }

/* Le champ « Autre… ». */
.champ { margin: .8rem 0 0; }
.champ input { font: inherit; padding: .55rem .7rem; border: 1px solid var(--trait); border-radius: 5px; background: var(--carte); color: var(--texte); width: 100%; }
.champ input:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }

.actions, .nav { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.4rem 0; }
.nav { justify-content: space-between; }
.bouton { font: inherit; font-size: .95rem; padding: .65rem 1rem; border-radius: 6px; cursor: pointer; min-height: 2.75rem; min-width: min(9rem, 100%); max-width: 100%; border: 1px solid var(--accent); }
.bouton-principal { background: var(--accent); color: var(--sur-accent); }
.bouton-discret { background: transparent; color: var(--texte); border-color: var(--trait); }
.bouton:focus-visible, .option:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.bouton:disabled,
.bouton[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }

.obligatoire { color: var(--doux); font-size: .93rem; margin: 1rem 0 0; text-align: right; }
.confirmation { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.confirmation p { flex-basis: 100%; margin: 0; }
.message { border-radius: 6px; padding: .7rem 1rem; margin: 1rem 0; background: var(--choisi); border: 1px solid var(--trait); }

/* L'aide affichée dès la réponse aux idées noires, sous la question (la zone role=status reste
 * dans la page, vide tant qu'il n'y a rien à dire : seul son contenu porte le cadre). */
.aide-immediate-bloc { clear: both; margin: .9rem 0 0; padding: .7rem 1rem; border: 1px solid var(--alerte); border-left: 5px solid var(--alerte); border-radius: 5px; background: var(--fond-alerte); }
.aide-immediate-bloc p { margin: 0 0 .5rem; }
.aide-immediate-bloc ul { margin: 0; padding-left: 1.2rem; }
.aide-immediate-bloc li { margin: .3rem 0; }

[hidden] { display: none !important; }

@media (max-width: 34rem) {
  .echelle { grid-template-columns: 1fr; }
  .echelle .option { flex-direction: row; justify-content: flex-start; text-align: left; }
  .echelle.echelle-note { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .echelle.echelle-note .option { flex-direction: column; justify-content: center; text-align: center; }
  .nav { flex-direction: column-reverse; }
  .nav .bouton { width: 100%; }
}
