/* Assistant de procès-verbal : une seule feuille de style, sans dépendance. */

:root {
  --encre: #13212e;
  --encre-2: #34465a;
  --gris: #5b6875;
  --trait: #d9dee3;
  --fond: #f4f5f2;
  --carte: #ffffff;
  --vert: #1f6f5c;
  --vert-fonce: #175646;
  --vert-clair: #e4f2ec;
  --ambre: #8a5300;
  --ambre-clair: #fff3dc;
  --rouge: #b42318;
  --rouge-clair: #fdecea;
  --bleu: #1f4e79;
  --bleu-clair: #e8f0f8;
  --rayon: 12px;
  --ombre: 0 1px 2px rgba(19, 33, 46, .06), 0 4px 16px rgba(19, 33, 46, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font: 400 16.5px/1.55 Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
}
h1, h2, h3 { font-family: "Bricolage Grotesque", Figtree, system-ui, sans-serif; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .8em; }
a { color: var(--vert-fonce); }
a:hover { color: var(--encre); }
code { background: #eef0f2; padding: .1em .35em; border-radius: 4px; font-size: .92em; }
:focus-visible { outline: 3px solid #3a8fd6; outline-offset: 2px; }
[hidden] { display: none !important; }
.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Bandeau du haut ---------- */
.barre { background: var(--encre); color: #fff; }
.barre-dedans { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.marque { color: #fff; text-decoration: none; font: 700 1.2rem "Bricolage Grotesque", sans-serif; display: flex; align-items: center; gap: 10px; }
.marque:hover { color: #fff; }
.marque svg { width: 28px; height: 28px; fill: none; stroke: #8fd3bd; stroke-width: 2.2; stroke-linecap: round; }
.collectivite { color: #b9c6d2; font-size: .95rem; border-left: 1px solid #3a4b5c; padding-left: 16px; }
.menu { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.menu a, .menu .lien { color: #dfe7ee; text-decoration: none; padding: 7px 12px; border-radius: 8px; font-size: .97rem; }
.menu a:hover, .menu .lien:hover { background: #22364a; color: #fff; }
.menu a[aria-current="page"] { background: #22364a; color: #fff; }
.menu form { margin: 0; }
.lien { background: none; border: 0; font: inherit; cursor: pointer; color: var(--vert-fonce); text-decoration: underline; padding: 0; }
.bandeau-demo { background: var(--ambre-clair); color: var(--ambre); text-align: center; padding: 9px 20px; font-size: .95rem; border-bottom: 1px solid #f0d9a8; }

.page { max-width: 1180px; margin: 0 auto; padding: 28px 20px 60px; }
.pied { max-width: 1180px; margin: 0 auto; padding: 20px; color: var(--gris); font-size: .85rem; border-top: 1px solid var(--trait); }

/* ---------- Blocs ---------- */
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 24px; margin-bottom: 20px; box-shadow: var(--ombre); }
.carte.etroite { max-width: 520px; margin-left: auto; margin-right: auto; }
.carte > :last-child { margin-bottom: 0; }
.encadre-info { background: var(--bleu-clair); border-color: #c9dcee; box-shadow: none; }
.vide { text-align: center; padding: 48px 24px; color: var(--gris); }
.sous-carte { border: 1px solid var(--trait); border-radius: 10px; padding: 18px; background: #fafbfa; }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.entete-page { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.entete-page h1 { margin-bottom: .2em; }
.fil { margin: 0 0 4px; font-size: .92rem; color: var(--gris); }
.fil a { color: var(--gris); }
.aide { color: var(--gris); font-size: .92rem; }
.ok { color: var(--vert); font-weight: 600; }
.ko { color: var(--rouge); font-weight: 600; }
.droite { text-align: right; }
.boutons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.droite .boutons { justify-content: flex-end; }

/* ---------- Messages ---------- */
.alerte { border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid; }
.alerte-ok { background: var(--vert-clair); border-color: #b8dccd; color: #124a3c; }
.alerte-erreur { background: var(--rouge-clair); border-color: #f2c4bf; color: #8c1c13; }
.alerte-info { background: var(--bleu-clair); border-color: #c9dcee; color: #17395a; }
.alerte-attention { background: var(--ambre-clair); border-color: #f0d9a8; color: var(--ambre); }
.alerte-action { background: var(--ambre-clair); border-color: #f0d9a8; color: #6b4100; font-weight: 600; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--vert); color: #fff; border: 1px solid var(--vert); border-radius: 9px;
  padding: 10px 18px; font: 600 1rem Figtree, system-ui, sans-serif; text-decoration: none; cursor: pointer;
  min-height: 44px; transition: background .15s;
}
.btn:hover { background: var(--vert-fonce); color: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-secondaire { background: #fff; color: var(--vert-fonce); border-color: #b9cdc6; }
.btn-secondaire:hover { background: var(--vert-clair); color: var(--vert-fonce); }
.btn-danger { background: var(--rouge); border-color: var(--rouge); }
.btn-danger:hover { background: #8c1c13; }
.btn-lien-danger { background: none; border-color: transparent; color: var(--rouge); text-decoration: underline; padding: 4px 6px; min-height: 0; font-weight: 500; }
.btn-lien-danger:hover { background: var(--rouge-clair); color: #8c1c13; }
.btn-petit { padding: 6px 12px; min-height: 36px; font-size: .92rem; }

/* ---------- Formulaires ---------- */
.formulaire { margin: 0; }
.champ { margin-bottom: 14px; flex: 1 1 200px; min-width: 0; }
.champ label { display: block; font-weight: 600; margin-bottom: 5px; font-size: .95rem; }
.champ .aide { margin: 5px 0 0; font-size: .86rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; font: inherit; color: var(--encre); background: #fff;
  border: 1px solid #c5ccd3; border-radius: 8px; padding: 9px 11px; min-height: 44px;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--vert); outline: 3px solid rgba(31, 111, 92, .18); outline-offset: 0; }
input[disabled], select[disabled], textarea[disabled] { background: #f3f4f5; color: var(--encre-2); }
.court { width: 84px !important; }
.moyen { width: 150px !important; }
.ligne-champs { display: flex; gap: 14px; flex-wrap: wrap; }
.ligne-champs.aligne-bas { align-items: flex-end; }
.court-champ { flex: 0 0 110px; }
.champ-en-ligne { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.champ-en-ligne label { margin: 0; }
.case { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; margin: 4px 14px 4px 0; }
.case input { width: 18px; height: 18px; accent-color: var(--vert); }
.actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
fieldset.sans-cadre { border: 0; padding: 0; margin: 0; min-width: 0; }
.barre-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 0; }
.barre-actions.collante { position: sticky; bottom: 0; background: rgba(244, 245, 242, .96); border-top: 1px solid var(--trait); padding: 14px 4px; z-index: 5; }

/* ---------- Tableaux ---------- */
.tableau-defile { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 12px; }
.tableau { width: 100%; border-collapse: collapse; font-size: .97rem; }
.tableau th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gris); border-bottom: 2px solid var(--trait); padding: 8px 10px; white-space: nowrap; }
.tableau td { border-bottom: 1px solid #eceff1; padding: 10px; vertical-align: middle; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau-saisie td { padding: 6px; }
.tableau-saisie td.large { min-width: 260px; }
.tableau-saisie select, .tableau-saisie input { min-height: 40px; padding: 7px 9px; }
.tableau tr.inactif td { opacity: .55; }
.compteurs { background: #f6f8f7; border: 1px solid var(--trait); border-radius: 8px; padding: 9px 13px; font-weight: 600; }

/* ---------- Étiquettes d'état ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.badge-grand { font-size: .95rem; padding: 6px 14px; }
.badge-neutre { background: #eceff2; color: var(--encre-2); }
.badge-encours { background: var(--bleu-clair); color: var(--bleu); }
.badge-action { background: var(--ambre-clair); color: #6b4100; }
.badge-ok { background: var(--vert-clair); color: #124a3c; }
.badge-erreur { background: var(--rouge-clair); color: #8c1c13; }

/* ---------- Les étapes d'une séance ---------- */
.etapes { list-style: none; padding: 0; margin: 0 0 24px; counter-reset: etape; }
.etape { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 22px 24px 22px 24px; margin-bottom: 16px; box-shadow: var(--ombre); }
.etape h2 { display: flex; align-items: center; gap: 12px; }
.etape .num { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: #eceff2; color: var(--encre-2); font-size: 1rem; flex: none; }
.etape.faite .num { background: var(--vert); color: #fff; }
.etape.actuelle { border-color: var(--vert); box-shadow: 0 0 0 3px rgba(31, 111, 92, .12), var(--ombre); }
.etape.actuelle .num { background: var(--encre); color: #fff; }
.resume { margin: 0 0 14px; padding-left: 20px; color: var(--encre-2); }
.fichiers { list-style: none; padding: 0; margin: 0 0 14px; }
.fichiers li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 9px 12px; border: 1px solid var(--trait); border-radius: 9px; margin-bottom: 8px; background: #fafbfa; }
.fichiers form { margin: 0 0 0 auto; }
.fichier-nom { font-weight: 600; overflow-wrap: anywhere; }
.a-faire { margin: 8px 0 0; padding-left: 20px; color: var(--encre-2); }
.ligne-boutons { margin: 0 0 12px; }
.a-faire li { margin-bottom: 4px; }

/* Dépôt de fichiers */
.depot { position: relative; border: 2px dashed #a9c5bb; border-radius: 12px; background: #f6faf8; padding: 4px; margin-bottom: 12px; transition: background .15s, border-color .15s; }
.depot.survol { background: var(--vert-clair); border-color: var(--vert); }
.depot input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.depot label { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; padding: 24px 16px; cursor: pointer; }
.depot label strong { color: var(--vert-fonce); font-size: 1.05rem; }
.depot label span { color: var(--gris); font-size: .92rem; }
.depot input:focus-visible + label { outline: 3px solid #3a8fd6; border-radius: 8px; }
.envois { list-style: none; margin: 0; padding: 0 12px; }
.envois li { padding: 10px 0; border-top: 1px solid #dfe9e5; font-size: .95rem; }
.envois .barre-progres { height: 8px; background: #dfe9e5; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.envois .barre-progres span { display: block; height: 100%; width: 0; background: var(--vert); transition: width .2s; }
.envois .erreur { color: var(--rouge); }
.envois .fini { color: var(--vert); font-weight: 600; }

.conseils { margin-top: 6px; }
.conseils summary, .zone-danger summary, details.noms summary { cursor: pointer; font-weight: 600; color: var(--encre-2); }
.conseils ul { margin: 10px 0 0; padding-left: 20px; color: var(--encre-2); }

.progression { display: flex; align-items: center; gap: 14px; background: var(--bleu-clair); border: 1px solid #c9dcee; border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.roue { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #b8cfe5; border-top-color: var(--bleu); animation: tourne 1s linear infinite; flex: none; }
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .roue { animation-duration: 3s; } }

.zone-danger { margin-top: 28px; border: 1px solid #f2c4bf; border-radius: 10px; padding: 14px 18px; background: #fff; }
.zone-danger summary { color: var(--rouge); }
.zone-danger p { margin-top: 10px; }

/* ---------- Qui parle ? ---------- */
.voix-entete { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.voix-entete h2 { margin: 0; }
.indice { background: #f6f8f7; border-left: 4px solid var(--vert); padding: 8px 12px; border-radius: 0 8px 8px 0; color: var(--encre-2); }
.indice span { font-weight: 600; }
.extrait { margin: 0 0 10px; padding: 10px 14px; background: #fafbfa; border: 1px solid var(--trait); border-radius: 9px; color: var(--encre-2); }
.extrait .btn { margin-left: 8px; vertical-align: middle; }
.minute { display: inline-block; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--gris); margin-right: 6px; }

/* ---------- Relecture ---------- */
.relecture { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; }
.controles { position: sticky; top: 16px; background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 18px; box-shadow: var(--ombre); max-height: calc(100vh - 32px); overflow-y: auto; }
.controles ul { list-style: none; padding: 0; margin: 0 0 12px; font-size: .9rem; }
.controles li { padding: 7px 0 7px 26px; position: relative; border-bottom: 1px solid #eef0f2; }
.controles li::before { position: absolute; left: 0; top: 7px; width: 18px; height: 18px; border-radius: 50%; font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.controle-ok::before { content: "✓"; background: var(--vert-clair); color: var(--vert); }
.controle-attention::before { content: "!"; background: var(--ambre-clair); color: var(--ambre); }
.controle-erreur::before { content: "×"; background: var(--rouge-clair); color: var(--rouge); }
.controles a { color: var(--encre); text-decoration: none; }
.controles a:hover { text-decoration: underline; }
.redaction .carte { scroll-margin-top: 16px; }
.point-entete { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.point-entete .num { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; border-radius: 9px; background: var(--encre); color: #fff; font-weight: 700; }
.titre-point { flex: 1 1 300px; font-weight: 700 !important; font-size: 1.05rem !important; }
.a-verifier { background: var(--ambre-clair); border: 1px solid #f0d9a8; border-radius: 9px; padding: 10px 14px; margin-bottom: 14px; color: #5e3a00; font-size: .94rem; }
.a-verifier ul { margin: 6px 0; padding-left: 18px; }
.vote { border: 1px solid var(--trait); border-radius: 10px; padding: 12px 16px 6px; margin: 4px 0 0; }
.vote legend { font-weight: 700; padding: 0 6px; }
.choix { display: flex; flex-wrap: wrap; margin-bottom: 8px; }
.detail-vote { border-top: 1px dashed var(--trait); padding-top: 12px; }
.detail-vote .champ { flex: 0 1 140px; }
details.noms { margin: 8px 0; }
.grille-noms { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 10px; padding: 8px 0 4px; }
.apercu-vote { background: #f6f8f7; border-radius: 8px; padding: 8px 12px; font-weight: 600; font-size: .94rem; color: var(--encre-2); }

/* Lecteur audio flottant */
audio[data-lecteur].visible { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); z-index: 20; box-shadow: 0 6px 24px rgba(19, 33, 46, .25); border-radius: 30px; background: #fff; }

/* Administration */
.etat-service { list-style: none; padding: 0; margin: 0; }
.etat-service li { padding: 8px 0 8px 26px; position: relative; border-bottom: 1px solid #eef0f2; }
.etat-service li::before { content: "•"; position: absolute; left: 8px; color: var(--gris); }
.etat-service li.ok::before { content: "✓"; color: var(--vert); left: 4px; }
.etat-service li.attention::before { content: "!"; color: var(--ambre); font-weight: 700; left: 6px; }
.etat-service li.ok, .etat-service li.attention { color: var(--encre); font-weight: 400; }
/* Texte et bouton alignés en haut, pour que la coche reste sur la première ligne quand le bouton passe dessous */
.etat-service li.avec-action { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.etat-service li.avec-action form { margin: -4px 0; }
.copie { display: flex; gap: 8px; margin-top: 8px; }
.copie input { flex: 1; }

@media (max-width: 920px) {
  .relecture { grid-template-columns: 1fr; }
  .controles { position: static; max-height: none; }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  h1 { font-size: 1.55rem; }
  .page { padding: 20px 14px 50px; }
  .carte, .etape { padding: 18px 16px; }
  .deux-colonnes { grid-template-columns: 1fr; }
  .collectivite { border: 0; padding: 0; width: 100%; order: 3; }
  .menu { margin-left: 0; }
  audio[data-lecteur].visible { bottom: 90px; }
}
