@font-face { font-family: 'Archivo'; font-weight: 700; font-display: swap; src: url('/fonts/archivo-700-latin.woff2') format('woff2'); }
@font-face { font-family: 'Public Sans'; font-weight: 400; font-display: swap; src: url('/fonts/public-sans-400-latin.woff2') format('woff2'); }
@font-face { font-family: 'Public Sans'; font-weight: 600; font-display: swap; src: url('/fonts/public-sans-600-latin.woff2') format('woff2'); }

:root {
  --rouge: #d8382a; --rouge-fonce: #b42a1e; --rouge-pale: #fdecea;
  --navy: #0b2540; --navy-2: #17436e; --bleu-ffss: #1b3378; --jaune: #f5c400;
  --texte: #1b2430; --gris: #5b6675; --trait: #dde2e8; --fond: #f4f6f8; --carte: #fff;
  --vert: #1e7a46; --vert-pale: #e5f4ea; --orange: #a35a00; --orange-pale: #fff3e0;
  --rayon: 12px; --ombre: 0 1px 2px rgba(11,37,64,.06), 0 4px 14px rgba(11,37,64,.06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Public Sans', system-ui, sans-serif; font-size: 16px; line-height: 1.5; color: var(--texte); background: var(--fond); -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-family: 'Archivo', system-ui, sans-serif; color: var(--navy); line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
a { color: var(--navy-2); }
p { margin: 0 0 .8em; }
[hidden] { display: none !important; }

.page { max-width: 1180px; margin: 0 auto; padding: 20px 16px 60px; }
.page.etroite { max-width: 640px; }
.sous-titre { color: var(--gris); margin: -4px 0 16px; }

.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 16px; box-shadow: var(--ombre); margin-bottom: 16px; }
.carte > h2:first-child, .carte > h3:first-child { margin-top: 0; }
.grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 16px; }
.grille .carte { margin: 0; }
.chiffre { font-family: 'Archivo'; font-size: 2rem; color: var(--navy); font-weight: 700; line-height: 1.1; }
.gris { color: var(--gris); } .petit { font-size: .9rem; }
.vide { text-align: center; color: var(--gris); padding: 24px 10px; }
.ligne { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ligne.entre { justify-content: space-between; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--trait); background: #fff; color: var(--navy); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--navy-2); }
.btn.principal { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.btn.principal:hover { background: var(--rouge-fonce); }
.btn.sombre { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--rouge-fonce); border-color: #f1c2bd; }
.btn.large { width: 100%; }
.btn.petit { min-height: 36px; padding: 6px 10px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

label { display: block; font-weight: 600; margin: 12px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=url], input[type=number], input[inputmode], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #c9d1da; border-radius: 10px; background: #fff; color: var(--texte); font: inherit; font-size: 16px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid rgba(23,67,110,.3); outline-offset: 1px; }
.case { display: flex; align-items: center; gap: 10px; font-weight: 400; margin: 8px 0; cursor: pointer; }
.case input { width: 22px; height: 22px; flex: none; accent-color: var(--navy); }
.code-saisie { font-size: 1.6rem !important; letter-spacing: .4em; text-align: center; font-family: 'Archivo', monospace; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; background: var(--fond); color: var(--gris); border: 1px solid var(--trait); white-space: nowrap; }
.badge.vert { background: var(--vert-pale); color: var(--vert); border-color: #bfe3cc; }
.badge.rouge { background: var(--rouge-pale); color: var(--rouge-fonce); border-color: #f1c2bd; }
.badge.orange { background: var(--orange-pale); color: var(--orange); border-color: #f3d3a6; }
.badge.bleu { background: #e8edf8; color: var(--bleu-ffss); border-color: #c9d3ec; }

.alerte { border-radius: 10px; padding: 12px 14px; margin: 12px 0; border: 1px solid; }
.alerte.info { background: #eef3fa; border-color: #c9d6e8; color: var(--navy); }
.alerte.ok { background: var(--vert-pale); border-color: #bfe3cc; color: #14532d; }
.alerte.erreur { background: var(--rouge-pale); border-color: #f1c2bd; color: var(--rouge-fonce); }
.alerte.attention { background: var(--orange-pale); border-color: #f3d3a6; color: #6b3a00; }

/* Bulletin */
.choix { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px; margin: 0 0 10px; border: 2px solid var(--trait); border-radius: 12px; background: #fff; font: inherit; font-size: 1.1rem; font-weight: 600; color: var(--navy); cursor: pointer; min-height: 60px; }
.choix .rond { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #9aa6b4; flex: none; display: grid; place-items: center; }
.choix.carre .rond { border-radius: 6px; }
.choix[aria-pressed=true] { border-color: var(--navy); background: #eef3fa; }
.choix[aria-pressed=true] .rond { border-color: var(--navy); background: var(--navy); }
.choix[aria-pressed=true] .rond::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.choix.carre[aria-pressed=true] .rond::after { border-radius: 2px; }
.choix.blanc { font-weight: 400; color: var(--gris); border-style: dashed; }
.droit { border-left: 5px solid var(--jaune); }
.recu { font-family: 'Archivo', monospace; font-size: 1.3rem; letter-spacing: .08em; color: var(--navy); background: var(--fond); border-radius: 8px; padding: 8px 12px; display: inline-block; }

/* Tableaux */
.tableau { width: 100%; border-collapse: collapse; }
.tableau th, .tableau td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--trait); vertical-align: middle; }
.tableau th { font-size: .85rem; color: var(--gris); font-weight: 600; }
.defile { overflow-x: auto; }
.barre-voix { height: 10px; background: var(--fond); border-radius: 5px; overflow: hidden; margin-top: 4px; }
.barre-voix i { display: block; height: 100%; background: var(--bleu-ffss); }

/* Liste membres (cartes en mobile) */
.membre { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--trait); flex-wrap: wrap; }
.membre .qui { flex: 1 1 200px; min-width: 0; }
.membre .qui strong { display: block; overflow-wrap: anywhere; }
.membre .qui .gris { overflow-wrap: anywhere; }
.presence { display: inline-flex; border: 1px solid var(--trait); border-radius: 10px; overflow: hidden; }
.presence button { border: 0; background: #fff; padding: 8px 12px; min-height: 40px; font: inherit; font-size: .9rem; cursor: pointer; color: var(--gris); }
.presence button + button { border-left: 1px solid var(--trait); }
.presence button.on { background: var(--navy); color: #fff; font-weight: 600; }

.pied { text-align: center; color: var(--gris); font-size: .85rem; padding: 24px 16px; }
.qr { width: 100%; max-width: 320px; display: block; margin: 0 auto; }
.qr-lien { overflow-wrap: anywhere; text-align: center; }

/* Impression du procès-verbal */
.pv h1 { font-size: 1.5rem; }
.pv .signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 40px; }
.pv .signatures div { border-top: 1px solid var(--texte); padding-top: 8px; min-height: 90px; }
@media print {
  .menu-gauche, .barre-mobile, .onglets-bas, .entete-electeur, .ne-pas-imprimer { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .carte { box-shadow: none; border: 0; padding: 0; }
}
.resume { font-size: 1.25rem; font-weight: 600; color: var(--navy); margin: 16px 0; }
.marge { margin: 8px 0; }
.barre-voix i.l0 { width: 0%; }
.barre-voix i.l5 { width: 5%; }
.barre-voix i.l10 { width: 10%; }
.barre-voix i.l15 { width: 15%; }
.barre-voix i.l20 { width: 20%; }
.barre-voix i.l25 { width: 25%; }
.barre-voix i.l30 { width: 30%; }
.barre-voix i.l35 { width: 35%; }
.barre-voix i.l40 { width: 40%; }
.barre-voix i.l45 { width: 45%; }
.barre-voix i.l50 { width: 50%; }
.barre-voix i.l55 { width: 55%; }
.barre-voix i.l60 { width: 60%; }
.barre-voix i.l65 { width: 65%; }
.barre-voix i.l70 { width: 70%; }
.barre-voix i.l75 { width: 75%; }
.barre-voix i.l80 { width: 80%; }
.barre-voix i.l85 { width: 85%; }
.barre-voix i.l90 { width: 90%; }
.barre-voix i.l95 { width: 95%; }
.barre-voix i.l100 { width: 100%; }

/* ---------- Mise en page du bureau : reprise de l'outil formations ---------- */
.sprite { position: absolute; }
svg.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cadre { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.contenu { min-width: 0; }
.menu-gauche { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--navy); color: #fff; display: flex; flex-direction: column; padding: 18px 12px; gap: 18px; }
.menu-gauche .marque { font-family: 'Archivo'; font-weight: 700; color: #fff; text-decoration: none; display: flex; align-items: center; gap: 8px; font-size: 1.1rem; padding: 0 8px; }
.menu-gauche .marque img { width: 34px; height: 40px; object-fit: contain; }
.menu-gauche .marque span { display: flex; flex-direction: column; line-height: 1.15; }
.menu-gauche .marque small { font-family: 'Public Sans'; font-weight: 400; font-size: .78rem; color: #9fb2c6; }
.menu-gauche nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.menu-gauche nav a { display: flex; align-items: center; gap: 10px; color: #cfd9e4; text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 600; min-height: 40px; }
.menu-gauche nav a svg.ic { width: 19px; height: 19px; opacity: .85; }
.menu-gauche nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.menu-gauche nav a.active { background: var(--rouge); color: #fff; }
.menu-gauche .groupe { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #8ea3b9; font-weight: 700; padding: 12px 12px 4px; }
.menu-gauche .affiliation { display: flex; gap: 10px; align-items: center; padding: 0 8px; font-size: .75rem; color: #9fb2c6; line-height: 1.3; }
.menu-gauche .affiliation img { width: 40px; height: 40px; flex: none; }
.menu-gauche .moi { border-top: 1px solid rgba(255,255,255,.15); padding: 14px 8px 0; font-size: .9rem; }
.menu-gauche .moi .nom { font-weight: 600; } .menu-gauche .moi .role { color: #9fb2c6; margin-bottom: 10px; }
.barre-mobile, .onglets-bas, .voile-menu { display: none; }
.logos-connexion { display: flex; justify-content: center; gap: 16px; margin: 24px 0 16px; }
.logos-connexion img { height: 64px; width: auto; }

/* Mode « appli » sur téléphone et petite tablette */
@media (max-width: 900px) {
  .cadre { display: block; }
  .barre-mobile { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 30;
    background: var(--navy); color: #fff; padding: calc(6px + env(safe-area-inset-top)) 10px 6px; min-height: 56px; box-shadow: 0 2px 10px rgba(11,37,64,.25); }
  .barre-mobile .marque img { height: 36px; width: 36px; object-fit: contain; border-radius: 8px; background: #fff; padding: 2px; display: block; }
  .barre-mobile .titre-ecran { font: 700 1.1rem/1.2 Archivo, sans-serif; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .barre-mobile .logo-ffss { height: 34px; width: 34px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px; justify-self: end; }
  .onglets-bas { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; z-index: 45; left: 0; right: 0; bottom: 0;
    background: #fff; border-top: 1px solid var(--trait); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(11,37,64,.08); }
  .onglets-bas a, .onglets-bas button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; border: 0; background: none;
    color: var(--gris); text-decoration: none; font: 600 .74rem 'Public Sans', sans-serif; border-radius: 12px; cursor: pointer; }
  .onglets-bas svg.ic { width: 22px; height: 22px; }
  .onglets-bas a.active, .onglets-bas button.active { color: var(--rouge); }
  .onglets-bas a.active svg.ic, .onglets-bas button.active svg.ic { background: var(--rouge-pale); border-radius: 99px; padding: 3px 14px; width: 22px; height: 22px; box-sizing: content-box; margin: -3px 0; }
  .contenu { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .menu-gauche { position: fixed; z-index: 44; left: 0; right: 0; top: auto; bottom: 0; width: auto; height: auto; max-height: 82vh; border-radius: 20px 20px 0 0;
    padding: 18px 14px calc(80px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
  .menu-gauche.ouvert { transform: none; box-shadow: 0 -8px 30px rgba(0,0,0,.3); }
  .menu-gauche > .marque, .menu-gauche .affiliation { display: none; }
  .menu-gauche::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 9px; background: rgba(255,255,255,.35); margin: -8px auto 4px; }
  .voile-menu { display: block; position: fixed; inset: 0; z-index: 43; background: rgba(11,37,64,.45); }
}
@media (max-width: 760px) { .page { padding: 14px 16px 24px; } h1 { font-size: 1.35rem; } }
@media (prefers-reduced-motion: reduce) { .menu-gauche { transition: none; } }

/* Page électeur : même barre que l'appli, sur tous les écrans */
.entete-electeur { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 30;
  background: var(--navy); color: #fff; padding: calc(6px + env(safe-area-inset-top)) 10px 6px; min-height: 56px; box-shadow: 0 2px 10px rgba(11,37,64,.25); }
.entete-electeur img { height: 36px; width: 36px; object-fit: contain; border-radius: 8px; background: #fff; padding: 2px; display: block; }
.entete-electeur .titre-ecran { font: 700 1.1rem/1.2 Archivo, sans-serif; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entete-electeur .droite { justify-self: end; display: flex; gap: 6px; }
.entete-electeur button { height: 36px; border: 0; background: rgba(255,255,255,.12); color: #fff; border-radius: 10px; padding: 0 10px; font: 600 .85rem 'Public Sans', sans-serif; cursor: pointer; }
form .btn.large, form p > .btn { margin-top: 8px; }
.tableau td:last-child { white-space: nowrap; text-align: right; }
textarea.modele { font-family: ui-monospace, Menlo, monospace; font-size: 14px; line-height: 1.5; min-height: 320px; }
.apercu-email { width: 100%; height: 900px; border: 1px solid var(--trait); border-radius: 10px; background: #f4f6f8; display: block; }
details { margin: 12px 0; } summary { cursor: pointer; font-weight: 600; color: var(--navy-2); min-height: 32px; }
details ul { padding-left: 20px; } code { background: var(--fond); border-radius: 4px; padding: 1px 5px; }
@media (max-width: 760px) { .apercu-email { height: 760px; } }
/* Champs côte à côte : le libellé prend la place libre, les cases restent alignées même si un libellé passe sur deux lignes. */
.grille > div:has(> input, > select) { display: flex; flex-direction: column; }
.grille > div:has(> input, > select) > label { flex: 1; display: flex; align-items: flex-end; }
.btn .ic, .btn svg.ic { width: 18px; height: 18px; }
h2 svg.ic, h1 svg.ic { width: 20px; height: 20px; vertical-align: -3px; color: var(--navy-2); }
.gris svg.ic, .alerte svg.ic { width: 16px; height: 16px; vertical-align: -3px; }
.btn.google { background: #fff; border-color: #c9d1da; color: #1b2430; margin: 8px 0 4px; }
.btn.google:hover { border-color: var(--navy-2); }
.choix .ic { width: 22px; height: 22px; }
