/* Page capitaine — DESIGN.md §6 et §8. Texte toujours sur un panneau uni, jamais sur la matière. */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Fond briques derrière les panneaux ; couleur unie si l'image ne charge pas */
.page-capitaine {
  background-color: #8C4A3A;
  background-image: url("../img/briques.webp");
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
}

.entete__infos { display: flex; gap: 24px; margin: 0; font-weight: 700; text-align: right; }
.entete__limite { color: var(--gris); font-weight: 400; }
.entete__limite strong { color: var(--encre); }

.capitaine { max-width: 880px; }

/* Titres focalisés par le script à chaque changement d'écran (lecteurs d'écran) : pas de cadre */
h1[tabindex="-1"]:focus { outline: none; }

.chargement {
  background: var(--blanc); padding: 24px; margin: 0;
}

/* ── Panneaux ─────────────────────────────────────────────── */
.panneau {
  background: var(--blanc);
  color: var(--encre);
  padding: 32px;
  margin: 0 0 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.panneau h1, .panneau h2 { margin-top: 0; }
.panneau--etape { background: var(--etape); color: var(--etape-sur); display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.panneau--etape h1 { margin: 0; color: var(--etape-sur); }
.panneau--gris { background: var(--gris); color: var(--blanc); }
.panneau--gris h1 { color: var(--blanc); }
.panneau--plan {
  background-color: #1F4E8C;
  background-image: url("../img/plan-bleu.webp");
  background-size: cover;
  padding: 24px;
}
.panneau__picto { display: block; width: 160px; height: auto; margin: 0 0 16px; }
.panneau__texte { font-size: 18px; margin: 0; }

.surtitre {
  font-size: var(--t-surtitre); text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; margin: 0 0 8px;
}

.carte-limite {
  background: var(--blanc); color: var(--encre); padding: 12px 16px; min-width: 140px; text-align: center;
}
.carte-limite .surtitre { color: var(--gris); }
.carte-limite__heure { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 0; }

/* ── Bandeaux (succès, erreur) ────────────────────────────── */
.bandeau-zone:empty { display: none; }
.bandeau {
  padding: 16px 24px; margin: 0 0 24px; border-left: 8px solid; background: var(--blanc);
  display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.bandeau:focus { outline: 3px solid var(--bleu); outline-offset: 2px; }
.bandeau p { margin: 0; }
.bandeau--succes { border-color: var(--vert); background: #E9F5E9; }
.bandeau--erreur { border-color: var(--orange); background: #FDECE7; }
.bandeau__titre { font-weight: 700; }

/* ── Formulaire ───────────────────────────────────────────── */
.bloc {
  background: var(--blanc);
  border: 0;
  border-top: 6px solid var(--etape, var(--encre));
  padding: 24px;
  margin: 0 0 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  min-width: 0;
}
.bloc legend { padding: 0; float: left; width: 100%; margin-bottom: 16px; }
.bloc > :not(legend) { clear: both; }
.bloc__surtitre { display: block; font-size: var(--t-surtitre); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--etape-texte, var(--gris)); margin-bottom: 4px; }
.bloc__question { display: block; font-size: var(--t-question); font-weight: 700; line-height: 1.3; }
.bloc__aide { color: var(--gris); margin: 0 0 16px; }
.bloc[aria-invalid="true"] { outline: 3px solid var(--orange-texte); outline-offset: -3px; }
.bloc__erreur { color: var(--orange-texte); font-weight: 700; margin: 0 0 12px; }

.choix { display: grid; gap: 12px; }
.choix--ligne { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

.option { position: relative; display: block; }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option label {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 12px 16px;
  font-size: var(--t-choix); line-height: 1.3;
  border: 2px solid var(--filet); background: var(--blanc); cursor: pointer;
}
.option label::before {
  content: ""; flex: none; width: 24px; height: 24px; border: 2px solid var(--encre); background: var(--blanc);
}
.option input[type="radio"] + label::before { border-radius: 50%; }
.option label:hover { border-color: var(--encre); }
.option input:focus-visible + label { outline: 3px solid var(--bleu); outline-offset: 2px; }
.option input:checked + label { border-color: var(--encre); border-width: 3px; font-weight: 700; }
/* Coche visible : l'état ne repose pas sur la couleur seule */
.option input:checked + label::before {
  content: "✓"; color: var(--blanc); background: var(--encre);
  display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700;
}
.option input:disabled + label { cursor: not-allowed; color: var(--gris); background: var(--fond); }

/* Curseur de posture : 4 crans, dégradé neutre de l'encre au bleu (ni bien ni mal) */
.posture { grid-template-columns: repeat(4, 1fr); gap: 0; border: 2px solid var(--encre); }
.posture .option label { border: 0; border-right: 1px solid var(--filet); flex-direction: column; text-align: center; justify-content: flex-start; min-height: 120px; font-size: 16px; }
.posture .option:last-child label { border-right: 0; }
.posture .option:nth-child(1) label::after,
.posture .option:nth-child(2) label::after,
.posture .option:nth-child(3) label::after,
.posture .option:nth-child(4) label::after { content: ""; display: block; width: 100%; height: 8px; order: -1; margin-bottom: 4px; }
.posture .option:nth-child(1) label::after { background: var(--encre); }
.posture .option:nth-child(2) label::after { background: #3A4A63; }
.posture .option:nth-child(3) label::after { background: #2F5085; }
.posture .option:nth-child(4) label::after { background: var(--bleu); }
.posture .option input:checked + label { outline: 3px solid var(--encre); outline-offset: -3px; }

.compteur { color: var(--gris); margin: 12px 0 0; font-variant-numeric: tabular-nums; }

/* Équipes : grille compacte */
.equipes { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.equipes .option label { font-size: 16px; min-height: 48px; }
.equipes__prise { display: block; font-size: 13px; font-weight: 400; }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px;
  background: var(--encre); color: var(--blanc);
  font: inherit; font-weight: 700; font-size: 18px;
  border: 0; cursor: pointer;
}
.bouton:hover { background: #000; }
.bouton:disabled { background: var(--gris); cursor: progress; }
.bouton--secondaire { background: var(--blanc); color: var(--encre); border: 2px solid var(--encre); min-height: 44px; font-size: 16px; }
.envoi { background: var(--blanc); padding: 24px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); }
.envoi .bouton { width: 100%; }

.formulaire[aria-disabled="true"] .bloc { opacity: 0.6; }

@media (max-width: 640px) {
  main { padding: 16px; }
  .panneau { padding: 20px; }
  .posture { grid-template-columns: 1fr 1fr; }
  .entete { flex-wrap: wrap; }
  .entete__infos { text-align: left; }
}
