/* Plateforme de candidatures TwinL — feuille de style unique.
   Montserrat est hébergée localement : aucun appel à un CDN tiers, donc aucun
   transfert d'adresse IP de candidat vers un service externe. */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/montserrat-latin-400-normal.e7198b2dcb57.woff2") format("woff2"),
       url("../fonts/montserrat-latin-400-normal.934faa18c225.woff") format("woff");
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/montserrat-latin-500-normal.f96e8aab37e8.woff2") format("woff2"),
       url("../fonts/montserrat-latin-500-normal.f4ab9cec00b4.woff") format("woff");
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/montserrat-latin-600-normal.9e606da1cbeb.woff2") format("woff2"),
       url("../fonts/montserrat-latin-600-normal.ab4aca9bfc9d.woff") format("woff");
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/montserrat-latin-700-normal.1c0792ac34ef.woff2") format("woff2"),
       url("../fonts/montserrat-latin-700-normal.f52f514907f6.woff") format("woff");
}

:root {
  --rouge: #d21f26;          /* rouge du logo */
  --rouge-sombre: #a6191f;
  --orange: #f38421;         /* orange du croissant */
  --encre: #1c1c20;
  --encre-doux: #5f6166;
  --papier: #f4f4f5;
  --surface: #ffffff;
  --trait: #dedee1;
  --trait-fort: #b9b9be;
  --alerte: #b4740f;
  --danger: #a6191f;
  --rayon: 8px;
  --rayon-carte: 16px;
  --rayon-pilule: 999px;
  --ombre: 0 1px 2px rgba(16, 18, 24, .04), 0 4px 16px rgba(16, 18, 24, .05);
  --ombre-forte: 0 8px 28px rgba(16, 18, 24, .10);
  --police: "Montserrat", "Segoe UI", Roboto, -apple-system, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--police);
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3 { font-weight: 700; line-height: 1.15; margin: 0 0 .6rem; letter-spacing: -.015em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.2rem; font-weight: 600; }
h3 { font-size: 1.02rem; font-weight: 600; }
p { margin: 0 0 1rem; max-width: 68ch; }
/* Back-office : des phrases courtes d'explication, qui prennent toute la largeur
   disponible. La limite de 68 caractères les coupait en deux lignes alors que la
   place ne manquait pas (audit du 2026-09-29). */
.scene p { max-width: none; }
a { color: var(--rouge-sombre); text-underline-offset: .15em; }
a:hover { color: var(--encre); }
small, .petit { font-size: .82rem; color: var(--encre-doux); }

:focus-visible { outline: 2px solid var(--rouge); outline-offset: 2px; }

/* ---------- Pages publiques : même vocabulaire que le back-office ---------- */
body.public { background: #f6f7f9; }

.public-shell { max-width: 46rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

.public-entete {
  background: var(--surface);
  border: 1px solid #e8e9ed;
  border-radius: var(--rayon-carte);
  box-shadow: var(--ombre);
  padding: 1.4rem 1.75rem;
  margin-bottom: 1.1rem;
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.public-entete img { height: 46px; width: auto; flex: none; }
.public-entete .titre { min-width: 0; }
.public-entete h1 { font-size: 1.4rem; margin: 0; }
.public-entete p { margin: .15rem 0 0; }

.carte {
  background: var(--surface);
  border: 1px solid #e8e9ed;
  border-radius: var(--rayon-carte);
  box-shadow: var(--ombre);
  padding: 1.75rem;
}
.carte + .carte { margin-top: 1.1rem; }

/* Sections séparées par l'espace seul, sans trait. */
.section-formulaire { padding-top: 0; margin-top: 2.25rem; border-top: none; }
.section-formulaire:first-of-type { padding-top: 0; margin-top: 0; border-top: none; }
.section-formulaire > h2 { font-size: 1.02rem; margin-bottom: .25rem; }
.section-formulaire > h2 + p { margin-bottom: 1.2rem; }

.champ { margin-bottom: 1.2rem; }
.champ > label, .champ .libelle {
  display: block; font-weight: 600; margin-bottom: .35rem; font-size: .88rem;
}
.champ .aide { display: block; color: var(--encre-doux); font-size: .8rem; margin-bottom: .4rem; }
.obligatoire { color: var(--rouge); margin-left: .15rem; }

.radios { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.radios div { display: flex; gap: .4rem; align-items: center; }
.radios label, .case label { font-weight: 400; }
.case { display: flex; gap: .65rem; align-items: flex-start; margin-bottom: .9rem;
  background: #fafbfc; border: 1px solid #eceef1; border-radius: var(--rayon);
  padding: .75rem .9rem; }
.case input { margin-top: .2rem; }
.case label { font-size: .88rem; }

.erreur { color: var(--danger); font-size: .84rem; margin-top: .3rem; font-weight: 500; }
.champ.en-erreur input, .champ.en-erreur select, .champ.en-erreur textarea { border-color: var(--danger); }

.public-envoi { margin-top: 1.6rem; padding-top: 1.4rem; border-top: none;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

.public-pied { margin-top: 1.4rem; text-align: center; }

/* ---------- Back-office : coque à rail latéral ---------- */
.sprite { display: none; }

body.app {
  background: #f6f7f9;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky; top: 0; align-self: start;
  height: 100vh; display: flex; flex-direction: column;
  padding: 1.4rem 1rem;
  background: #f6f7f9;
}
.rail-marque { display: block; padding: 0 .6rem 1.6rem; }
.rail-marque img { height: 30px; width: auto; display: block; }

.rail-nav { display: flex; flex-direction: column; gap: .15rem; }
.rail-groupe { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em;
  color: #9a9da5; font-weight: 600; margin: 1.1rem .75rem .35rem; }
.rail-nav a, .rail-pied > a {
  display: flex; align-items: center; gap: .7rem;
  padding: .62rem .75rem; border-radius: var(--rayon);
  color: #4a4e57; text-decoration: none; font-size: .88rem; font-weight: 500;
}
.rail-nav a svg, .rail-pied > a svg { width: 18px; height: 18px; flex: none; color: #8b8f98; }
.rail-nav a:hover, .rail-pied > a:hover { background: #ecedf1; color: var(--encre); }
.rail-nav a[aria-current="page"], .rail-pied > a[aria-current="page"] {
  background: var(--surface); color: var(--rouge); font-weight: 600; box-shadow: var(--ombre);
}
.rail-nav a[aria-current="page"] svg, .rail-pied > a[aria-current="page"] svg { color: var(--rouge); }
.pastille { margin-left: auto; background: var(--rouge); color: #fff; font-size: .7rem;
  font-weight: 700; padding: .05rem .45rem; border-radius: var(--rayon-pilule); }

.rail-pied { margin-top: auto; display: flex; flex-direction: column; gap: .15rem; }
.rail-compte { display: flex; align-items: center; gap: .6rem; margin-top: .8rem;
  padding: .6rem .7rem; background: var(--surface); border-radius: var(--rayon-carte);
  box-shadow: var(--ombre); }
.rail-compte-nom { font-size: .82rem; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.rail-compte form { margin: 0 0 0 auto; }
.avatar { width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--rouge), var(--orange));
  color: #fff; font-size: .82rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }

/* ---------- En-tête de page ---------- */
.scene { padding: 1.4rem 1.6rem 1.6rem 0; min-width: 0; }
.scene-tete { display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.scene-titre h1 { font-size: 1.5rem; margin: 0; }
.scene-titre p { margin: .2rem 0 0; }
.scene-outils { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

.recherche-globale { position: relative; display: flex; align-items: center; }
.recherche-globale svg { position: absolute; left: .75rem; width: 16px; height: 16px;
  color: #9a9da5; pointer-events: none; }
.recherche-globale input { width: 15rem; padding: .55rem .8rem .55rem 2.2rem;
  border-radius: var(--rayon-pilule); border: 1px solid transparent;
  background: var(--surface); box-shadow: var(--ombre); font-size: .85rem; }
.recherche-globale input:focus { border-color: var(--rouge); }

.scene-corps { min-width: 0; }

/* ---------- Cartes ---------- */
.bloc, .indicateur, .recherche, .tableau-cadre, .question, .barre-actions, .avis {
  background: var(--surface);
  border: 1px solid #edeef1;
  border-radius: var(--rayon-carte);
  box-shadow: var(--ombre);
}
.bloc { padding: 1.35rem 1.5rem; margin-bottom: 1.1rem; }
.bloc > h2 { font-size: 1.02rem; margin-bottom: .2rem; }
.bloc > h2 + p { margin-bottom: 1rem; }

.grille { display: grid; gap: 1rem; }
.grille.quatre { grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr)); }
.grille.deux { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }

.indicateur { padding: 1.15rem 1.3rem; }
.indicateur .valeur { font-size: 2.1rem; line-height: 1.1; font-weight: 700; letter-spacing: -.03em; }
.indicateur .intitule { color: #6f737c; font-size: .82rem; margin-top: .3rem; }
.indicateur .variation { display: inline-block; margin-top: .55rem; font-size: .74rem;
  font-weight: 600; padding: .12rem .5rem; border-radius: var(--rayon-pilule);
  background: #f1f2f5; color: #5f6166; }
.indicateur .variation.hausse { background: #e8f5ee; color: #1f7a4d; }
.indicateur .variation.baisse { background: #fbeaea; color: #a6191f; }

/* ---------- Tableaux ---------- */
.tableau-cadre { overflow-x: auto; margin-bottom: 1.1rem; }
table { width: 100%; border-collapse: collapse; background: transparent; font-size: .87rem; }
th, td { text-align: left; padding: .8rem 1.1rem; vertical-align: middle; }
thead th { font-weight: 600; color: #8b8f98; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .06em; border-bottom: none; background: #fbfbfc; }
tbody td { border-bottom: none; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafafb; }
td.nombre, th.nombre { text-align: right; font-variant-numeric: tabular-nums; }
.bloc table { margin: 0 -.4rem; width: calc(100% + .8rem); }
.bloc th, .bloc td { padding: .65rem .4rem; }
.bloc thead th { background: transparent; }

/* ---------- Éléments ---------- */
.etiquette { display: inline-block; padding: .18rem .6rem; border-radius: var(--rayon-pilule);
  font-size: .72rem; font-weight: 600; color: #fff; white-space: nowrap; margin: 0 .25rem .2rem 0; }
.puce { display: inline-block; padding: .15rem .6rem; border-radius: var(--rayon-pilule);
  background: #f1f2f5; font-size: .75rem; font-weight: 500; color: #5f6166; }

.avis { border: none; border-left: 4px solid var(--rouge); padding: .9rem 1.1rem;
  margin-bottom: 1rem; border-radius: var(--rayon); }
.avis.attention { border-left-color: var(--orange); }
.avis.erreur { border-left-color: var(--danger); }
.avis p:last-child { margin-bottom: 0; }
.avis ul { margin: .4rem 0 0; padding-left: 1.1rem; font-size: .88rem; }

.jauge { display: inline-block; width: 62%; height: 7px; background: #f1f2f5;
  border-radius: var(--rayon-pilule); overflow: hidden; vertical-align: middle;
  margin-right: .6rem; }
.jauge span { display: block; height: 100%; border-radius: var(--rayon-pilule);
  background: linear-gradient(90deg, var(--rouge), var(--orange)); }

/* ---------- Recherche et filtres ---------- */
.recherche { padding: 1.1rem 1.2rem; margin-bottom: 1.1rem; }
.recherche-ligne { display: flex; gap: .6rem; margin-bottom: .8rem; }
.recherche-champ { flex: 1; font-size: .95rem; padding: .7rem 1rem;
  border-radius: var(--rayon-pilule); background: #f6f7f9; border: 1px solid transparent; }
.recherche-champ:focus { background: var(--surface); border-color: var(--rouge); }
.recherche-listes { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.recherche-listes select, .recherche-listes input { width: auto; min-width: 10.5rem;
  flex: 0 1 auto; font-size: .82rem; padding: .45rem .8rem;
  border-radius: var(--rayon-pilule); border: 1px solid #e6e7eb; background-color: var(--surface); }
.recherche-listes select { padding-right: 2.2rem; }
.recherche-listes input[type="number"] { min-width: 7rem; }
.recherche-avancee { margin-top: .9rem; border-top: none; padding-top: .8rem; }
.recherche-avancee summary { cursor: pointer; font-size: .83rem; font-weight: 600; color: #6f737c; }
.recherche-avancee summary:hover { color: var(--rouge); }

/* ---------- Formulaires ---------- */
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], input[type="file"], select, textarea {
  width: 100%; padding: .6rem .8rem; font: inherit; font-size: .9rem; color: var(--encre);
  background: var(--surface); border: 1px solid #e0e2e7; border-radius: var(--rayon);
}
input:focus, select:focus, textarea:focus { border-color: var(--rouge); outline: none; }
textarea { min-height: 7rem; resize: vertical; }

/* ---------- Boutons : un seul système pour tout le site ----------
   Chaque bouton porte `btn` et UN niveau :
   - `btn-primaire`   l'action principale, une seule par écran ou par zone ;
   - `btn-secondaire` une action utile, en retrait ;
   - `btn-tertiaire`  une action mineure ou une sortie (Annuler, Effacer, pages) ;
   - `btn-danger`     une action irréversible, avec poubelle et confirmation
                      (`data-confirmer`, voir `static/js/boutons.js`) ;
   - `btn-icone`      une icône seule, dans une zone cliquable de 44 × 44 px.
   Tous : 44 px de haut, arrondi en pilule, Montserrat demi-gras. Le rouge plein
   n'appartient qu'au primaire ; le destructif n'est qu'un contour rouge foncé,
   qui ne se remplit qu'au survol (option A, 2026-09-29). Un élément `button`
   sans classe n'a aucun dessin : les listes déroulantes, les statuts cliquables
   et la croix des notifications gardent le leur. */
button { font: inherit; color: inherit; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: 0 1.25rem; border-radius: var(--rayon-pilule);
  border: 1px solid transparent; background: none; color: var(--encre);
  font-family: var(--police); font-size: .875rem; font-weight: 600; line-height: 1.2;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:focus-visible { outline: 2px solid var(--rouge); outline-offset: 2px; }
.btn-primaire { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.btn-primaire:hover { background: var(--rouge-sombre); border-color: var(--rouge-sombre); color: #fff; }
.btn-secondaire { background: var(--surface); border-color: var(--rouge); color: var(--rouge-sombre); }
.btn-secondaire:hover { background: #fdf1f1; border-color: var(--rouge-sombre); color: var(--rouge-sombre); }
.btn-tertiaire { padding: 0 .6rem; color: var(--encre); }
.btn-tertiaire:hover { color: var(--encre); text-decoration: underline; text-underline-offset: 3px; }
.btn-danger { background: var(--surface); border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-icone { width: 44px; height: 44px; padding: 0; border: none; border-radius: 50%;
  background: none; color: #6f737c; }
.btn-icone svg { width: 17px; height: 17px; }
.btn-icone:hover { background: #f1f2f5; color: var(--encre); }
.btn-icone.btn-danger:hover { background: #fbeced; color: var(--danger); }
/* Désactivé : visible, et sans réaction. En cours : le bouton reste lisible, une
   roue tourne à gauche du libellé et un second clic est sans effet. */
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn.en-cours { cursor: progress; pointer-events: none; }
.btn.en-cours::before { content: ""; width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: btn-tourne .7s linear infinite; }
@keyframes btn-tourne { to { transform: rotate(360deg); } }
/* Rangée de boutons : primaire en premier, dans le sens de lecture. */
.groupe-boutons { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.groupe-boutons form { margin: 0; }
/* Aperçu de la signature : le texte, puis l'image, comme à la fin d'un e-mail. */
.apercu-signature { border: 1px solid #e8e9ed; border-radius: var(--rayon); padding: .9rem 1rem;
  background: #fcfcfd; margin-bottom: .8rem; }
.apercu-signature p { margin: 0; }
/* L'e-mail limite l'image à 320 px de large ; ici, jamais plus large que le cadre. */
.apercu-signature img { display: block; width: auto; height: auto; max-width: min(320px, 100%);
  max-height: 120px; margin-top: .8rem; }
/* Champ fichier : son bouton reprend le bouton secondaire. */
input[type="file"]::file-selector-button { font: inherit; font-weight: 600; font-size: .84rem;
  margin-right: .8rem; padding: .5rem 1rem; border-radius: var(--rayon-pilule);
  border: 1px solid var(--rouge); background: var(--surface); color: var(--rouge-sombre);
  cursor: pointer; }
input[type="file"]::file-selector-button:hover { background: #fdf1f1; }
.fin-questionnaire { margin-top: 1.2rem; }

/* Fenêtre de confirmation, au dessin du site : « Annuler » à gauche, l'action
   nommée à droite (`static/js/boutons.js`). */
.fenetre-confirmation { border: none; border-radius: var(--rayon-carte);
  padding: 1.4rem 1.5rem 1.2rem; width: calc(100% - 2rem); max-width: 28rem;
  box-shadow: var(--ombre-forte); font-family: var(--police); color: var(--encre);
  background: var(--surface); }
.fenetre-confirmation::backdrop { background: rgba(20, 22, 26, .45); }
.fenetre-confirmation h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.fenetre-confirmation p { margin: 0 0 1.3rem; color: var(--encre-doux); max-width: none; }
.fenetre-confirmation .groupe-boutons { justify-content: flex-end; }

/* ---------- Questionnaire ---------- */
.question { margin-bottom: .7rem; }
.question > summary { cursor: pointer; padding: 1rem 1.4rem; display: flex;
  justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap;
  border-radius: var(--rayon-carte); }
.question > summary:hover { background: #fafafb; }
.question[open] > summary { border-bottom: none;
  border-radius: var(--rayon-carte) var(--rayon-carte) 0 0; }
.question-titre { font-weight: 600; font-size: .95rem; }
.question-corps { padding: 1.2rem 1.4rem 1.4rem; }
.question-corps table input[type="text"], .question-corps table input[type="number"] {
  padding: .4rem .65rem; font-size: .85rem; }

.barre-actions { position: sticky; bottom: 1rem; padding: .9rem 1.3rem;
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  box-shadow: var(--ombre-forte); }

/* ---------- Fiche ---------- */
.score-total { font-size: 2.5rem; line-height: 1; font-weight: 700; letter-spacing: -.03em;
  color: var(--rouge); }
/* `minmax(0, 1fr)` et non `1fr` : une colonne `1fr` ne descend pas sous la
   largeur de son contenu, et une adresse email longue sortait de l'encadré. */
dl.paires { display: grid; grid-template-columns: max-content minmax(0, 1fr);
  gap: .5rem 1.25rem; margin: 0; }
dl.paires dt { color: #8b8f98; font-size: .82rem; }
dl.paires dd { margin: 0; font-size: .88rem; overflow-wrap: anywhere; }

.champ { margin-bottom: 1.2rem; }
.champ > label, .champ .libelle { display: block; font-weight: 600; margin-bottom: .35rem;
  font-size: .85rem; }
.case { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .8rem; }
.case input { margin-top: .25rem; }
.case label { font-weight: 400; font-size: .88rem; }
.erreur { color: var(--danger); font-size: .84rem; margin-top: .3rem; font-weight: 500; }

.pagination { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

.masque { display: none; }

@media (max-width: 980px) {
  body.app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center;
    flex-wrap: wrap; gap: .3rem; padding: .8rem 1rem; }
  .rail-marque { padding: 0 1rem 0 0; }
  .rail-groupe { display: none; }
  .rail-nav { flex-direction: row; flex-wrap: wrap; }
  .rail-pied { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .scene { padding: 1rem; }
  .grille.deux { grid-template-columns: 1fr; }
  .recherche-globale input { width: 11rem; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Surcharges de fin : priorité sur les règles génériques ---------- */
.recherche-globale input[type="search"] {
  width: 15rem; padding: .55rem .9rem .55rem 2.3rem;
  border-radius: var(--rayon-pilule); border: 1px solid transparent;
  background: var(--surface); box-shadow: var(--ombre); font-size: .85rem;
}
.recherche-globale input[type="search"]:focus { border-color: var(--rouge); }

.recherche input[type="search"].recherche-champ {
  flex: 1; font-size: .95rem; padding: .7rem 1.1rem;
  border-radius: var(--rayon-pilule); background: #f6f7f9; border: 1px solid transparent;
}
.recherche input[type="search"].recherche-champ:focus { background: var(--surface);
  border-color: var(--rouge); }

.recherche-listes select, .recherche-listes input[type="number"],
.scene-outils select {
  width: auto; min-width: 10.5rem; flex: 0 1 auto; font-size: .82rem;
  padding: .5rem 2.2rem .5rem .9rem; border-radius: var(--rayon-pilule);
  /* `background-color` et non `background` : le raccourci effaçait la flèche
     que la règle `select` dessine en image de fond, et le menu ne se lisait plus
     comme un menu. La marge de droite lui laisse la place. */
  border: 1px solid transparent; background-color: var(--surface); box-shadow: var(--ombre);
}
.recherche-listes input[type="number"] { min-width: 7rem; }
.scene-outils select { min-width: 11rem; }

.pastille-score { display: flex; align-items: baseline; gap: .5rem;
  background: var(--surface); border: 1px solid #edeef1; box-shadow: var(--ombre);
  border-radius: var(--rayon-pilule); padding: .35rem 1.1rem .4rem; }
.pastille-score-valeur { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em;
  color: var(--rouge); }
.pastille-score-niveau { font-size: .78rem; color: #6f737c; font-weight: 500; }

/* ---------- Page questionnaire : espacements ---------- */
.question-entete { display: grid; grid-template-columns: minmax(0, 1fr) 10rem;
  gap: 1rem; margin-bottom: .4rem; }
.question-entete .champ { margin-bottom: .6rem; }
/* Question non notée : pas de coeff., l'intitulé prend toute la largeur. */
.question-entete-seule { grid-template-columns: minmax(0, 1fr); }
.question-corps [hidden] { display: none !important; }
.question-entete label { font-size: .78rem; color: #6f737c; font-weight: 500; }

.question-corps .case { margin-bottom: .55rem; }
.question-corps .case:last-of-type { margin-bottom: 1.1rem; }
.question-corps table { margin: 0; }
.question-corps thead th { background: transparent; padding: .5rem .55rem; }
.question-corps tbody td { padding: .35rem .55rem; }
.question-corps tbody tr:hover { background: transparent; }

.question-pied { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center;
  margin-top: 1rem; padding-top: 1rem; border-top: none; }
.question-pied-champ { flex: 1 1 16rem; min-width: 12rem; }
.question-pied-points { width: 7rem; flex: 0 0 auto; }
.bloc > .question-pied { margin-top: 0; padding-top: 0; border-top: none; }

.question > summary::marker { color: #b9bcc3; }
.question[open] > summary { margin-bottom: 0; }

/* Étiquettes en colonne de tableau */
td .etiquette { margin: .1rem .25rem .1rem 0; }
.sans-etiquette { color: #b9bcc3; }

/* Barres d'ajout : les champs partagent la ligne au lieu de s'étaler */
.question-pied input[type="text"].question-pied-champ { width: auto; flex: 1 1 16rem; }
.question-pied input[type="number"].question-pied-points { width: 7rem; flex: 0 0 7rem; }
.question-pied select { width: auto; flex: 0 0 auto; min-width: 11rem; }

/* ---------- En-tête encadré ---------- */
.rail-marque img { height: 55px; }

.scene-tete {
  background: var(--surface);
  border: 1px solid #edeef1;
  border-radius: var(--rayon-carte);
  box-shadow: var(--ombre);
  padding: 1rem 1.4rem;
  margin-bottom: 1.1rem;
  align-items: center;
}
.scene-titre { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.scene-titre h1 { font-size: 1.35rem; }

.retour {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: none;
  border-radius: 50%; border: 1px solid #e6e7eb; background: var(--surface);
  color: #5f6166; text-decoration: none;
}
.retour svg { width: 18px; height: 18px; }
.retour:hover { background: var(--rouge); border-color: var(--rouge); color: #fff; }

/* Groupes d'actions : espacement homogène dans les encadrés */
.grappe { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.grappe form { margin: 0; }
.note-bloc { margin-top: .9rem; }
.bloc dl.paires + .grappe { margin-top: 1rem; }
.bloc .champ:last-child { margin-bottom: 0; }
/* Une rangée de champs garde l'écart d'un champ seul : sans cela, son dernier
   champ perdait sa marge et le champ suivant venait se coller dessous. */
.bloc .grille.quatre { margin-bottom: 1.2rem; }
.bloc .grille.quatre > .champ { margin-bottom: 0; }

/* Respiration sous les titres d'encadré */
.bloc > h2 + .grappe, .bloc > h2 + dl, .bloc > h2 + form,
.bloc > h2 + table, .bloc > h2 + .champ { margin-top: .95rem; }
.bloc > h2 + p.petit { margin-top: .35rem; }
.bloc > h2 + .question-pied { margin-top: .95rem; }
.case-vivier { margin-top: 1.1rem; }
.bloc dl.paires { row-gap: .55rem; }

/* Rangée « libellé au-dessus, champ et bouton côte à côte » : le champ prend la
   place, le bouton garde sa largeur et la même hauteur que le champ. */
.rangee-champ { margin: 0 0 .95rem; }
.rangee-champ > label { display: block; margin-bottom: .35rem; }
.rangee-champ-ligne { display: flex; gap: .5rem; align-items: stretch; flex-wrap: wrap; }
.rangee-champ-ligne > select { flex: 1 1 14rem; width: auto; min-width: 0; }
.rangee-champ-ligne > .btn { flex: none; }
/* Même rangée placée sous une liste « libellé / valeur » : dernière de l'encadré. */
.rangee-champ-apres { margin: 1rem 0 0; }

.fiche .rangee-champ-ligne { align-items: center; }
.fiche .rangee-champ-ligne > select { height: 44px; padding-top: 0; padding-bottom: 0; }
/* Liste déroulante du site dans une rangée « menu + bouton » : elle prend la
   place du menu natif, à la même hauteur que le bouton voisin. */
.rangee-champ-ligne > .liste { flex: 1 1 14rem; min-width: 0; }
.fiche .liste .liste-bouton { height: 44px; padding-top: 0; padding-bottom: 0; line-height: 42px; }

/* Erreurs de validation localisées : pastille sur la question ou la section,
   liseré sur la case ou la ligne, contour rouge sur le champ à corriger. */
.pastille-erreur { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); margin-right: .5rem; vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(166, 25, 31, .15); }
details.question-en-erreur { box-shadow: inset 3px 0 0 var(--danger), var(--ombre); }
input.en-erreur, select.en-erreur { border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(166, 25, 31, .12); background-color: #fffafa; }
tr.ligne-en-erreur td { background: #fffafa; }
tr.ligne-en-erreur td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.liste-erreurs a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.liste-erreurs a:hover { color: var(--danger); }

/* Choix du statut sur la fiche : les étiquettes de Paramètres, telles quelles,
   cliquables. Le statut actuel garde ses couleurs, souligné d'un contour de sa
   teinte et d'une coche ; les autres sont atténués et reprennent vie au survol. */
/* Espacement large : le contour du statut actuel (3,5 px) ne doit pas toucher
   ses voisins. */
.statuts-choix { display: flex; flex-wrap: wrap; gap: .8rem .75rem; margin: 1rem 0 0; }
.statuts-choix .statut-choix { display: inline-flex; align-items: center; gap: .3rem;
  margin: 0; cursor: pointer; opacity: .55; transition: opacity .15s;
  border: 1px solid; position: relative; }
/* Zone cliquable portée à 44 px de haut, sans grossir la pastille. */
.statuts-choix .statut-choix::after { content: ""; position: absolute; left: 0; right: 0;
  top: 50%; height: 44px; transform: translateY(-50%); }
.statuts-choix .statut-choix:hover,
.statuts-choix .statut-choix:focus-visible { opacity: 1; outline: none; }
.statuts-choix .statut-actuel { opacity: 1; cursor: default;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--statut-couleur); }
.statuts-choix .statut-choix svg { width: 11px; height: 11px; }

/* Onglets de Paramètres : des pastilles, l'onglet actif en carte blanche. Sur
   écran étroit, la rangée défile à l'horizontale plutôt que de passer à la ligne. */
.onglets { display: flex; gap: .35rem; margin: 0 0 1.4rem; padding: .3rem;
  background: #eef0f3; border-radius: var(--rayon-pilule); width: max-content; max-width: 100%;
  overflow-x: auto; scrollbar-width: none; }
.onglets::-webkit-scrollbar { display: none; }
.onglet { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
  padding: .5rem 1rem; border-radius: var(--rayon-pilule); font-size: .84rem; font-weight: 600;
  color: var(--encre-doux); text-decoration: none; }
.onglet:hover { color: var(--encre); }
.onglet-actif { background: var(--surface); color: var(--encre); box-shadow: var(--ombre); }
.onglet .pastille-erreur { margin-right: 0; }
.sous-titre-onglet { margin-top: 1.6rem; }
.intro-onglet { margin: 0 0 1rem; max-width: none; }

/* Titre d'encadré avec son état à droite (fiche : Statut + étiquette). */
.bloc-tete { display: flex; justify-content: space-between; align-items: center;
  gap: .75rem; flex-wrap: wrap; }
.bloc-tete h2 { margin: 0; }
/* Doublon : sous le nom du candidat, les autres candidatures de la même adresse. */
.doublons { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .6rem;
  margin: .5rem 0 0; max-width: none; font-size: .85rem; }
.doublon { display: inline-flex; align-items: center; padding: .2rem .6rem;
  border-radius: 6px; background: #f1f2f5; border: 1px solid #e3e5e9; color: #4b4f58;
  font-size: .78rem; font-weight: 600; text-decoration: none; }
.doublon:hover { background: #e8eaee; color: var(--encre); }
/* Nom, point « nouveau » et marque « doublon » sur une seule ligne. */
.nom-ligne { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: nowrap; }
.nom-ligne .point-nouveau, .nom-ligne .marque-doublon { margin-left: 0; flex: none; }
.marque-doublon { display: inline-block; margin-left: .35rem; padding: .05rem .45rem;
  border-radius: 5px; background: #f1f2f5; color: #4b4f58; border: 1px solid #e3e5e9;
  font-size: .68rem; font-weight: 600; vertical-align: middle; }

/* Détail du score (fiche candidat) : score en tête, critères notés en liste,
   autres réponses en grille discrète. */
.score-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.score-tete h2, .score-tete p { margin: 0; }
.score-resultat { display: flex; align-items: center; gap: .75rem; }
.score-niveau { font-size: .9rem; font-weight: 600; }
.score-valeur { font-size: 1.9rem; font-weight: 600; line-height: 1; }
/* `fiche-jauge` : `jauge` (tableau de bord, 62 %) et `score-jauge` (listes,
   62 px) existent déjà ailleurs, et les règles se mélangeaient. */
.fiche-jauge { width: 100%; height: 4px; border-radius: 2px; background: #eceef1;
  overflow: hidden; margin: .3rem 0 .2rem; }
.fiche-jauge > span { display: block; height: 100%; background: var(--encre-doux);
  border-radius: inherit; }
.fiche-jauge-forte { height: 6px; border-radius: 3px; margin: .5rem 0 0; }
.score-rubrique { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: #8b8f98; margin: 1.2rem 0 .2rem; }
.criteres { list-style: none; margin: 0; padding: 0; border-top: none; }
.criteres li { padding: .5rem 0; border-bottom: none; }
.critere-ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.critere-intitule { margin: 0; font-size: .92rem; max-width: none; }
.critere-question { color: var(--encre-doux); }
.critere-points { margin: 0; white-space: nowrap; }
.critere-points strong { font-size: 1rem; }
.critere-calcul { margin: 0; font-size: .76rem; color: #8b8f98; }
.criteres-total { display: flex; justify-content: space-between; align-items: baseline;
  padding-top: .5rem; font-size: .92rem; }
/* Trois colonnes au plus : au-delà, six réponses se rangeaient en 5 + 1. */
.autres-reponses { display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(11rem, 30%), 1fr));
  gap: .8rem 1.25rem; margin: .5rem 0 0; }
.autres-reponses dt { font-size: .78rem; color: var(--encre-doux); }
.autres-reponses dd { margin: 0; font-size: .88rem; }

/* Notifications (messages Django) : petites cartes sombres en bas à droite, par-
   dessus la page, au lieu d'un bandeau qui décalait tout le contenu. */
.toasts { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 50;
  display: flex; flex-direction: column; gap: .5rem; width: min(24rem, calc(100vw - 2.5rem)); }
.toast { display: flex; align-items: flex-start; gap: .65rem; padding: .7rem .6rem .7rem .9rem;
  background: var(--encre); color: #fff; border-radius: var(--rayon); box-shadow: var(--ombre-forte);
  font-size: .86rem; animation: toast-entree .2s ease-out; }
.toast p { margin: 0; flex: 1; max-width: none; line-height: 1.45; }
.toast-pastille { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: .42rem;
  background: #9aa0a9; }
.toast-success .toast-pastille { background: #3fbf7f; }
.toast-warning .toast-pastille { background: var(--orange); }
.toast-error .toast-pastille { background: #ff5a5f; }
.toast-fermer { flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: -.7rem -.8rem -.7rem 0; border-radius: 50%;
  background: none; border: none; padding: 0; color: #b9bcc3; }
.toast-fermer:hover { background: none; color: #fff; }
.toast-fermer svg { width: 15px; height: 15px; display: block; }
.toast-sortie { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
@keyframes toast-entree { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
  .toast-sortie { transition: none; }
}

/* Notes internes de la fiche : saisie compacte, liste sobre, suppression discrète. */
.note-saisie { display: flex; flex-direction: column; align-items: flex-end; gap: .45rem;
  margin: .8rem 0 0; }
.note-saisie textarea { min-height: 0; resize: vertical; }
.notes { list-style: none; margin: .6rem 0 0; padding: 0; }
.notes li { padding: .65rem 0; border-top: none; }
.note-texte { margin: 0; font-size: .9rem; max-width: none; overflow-wrap: anywhere; }
.note-pied { display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  margin-top: .2rem; font-size: .76rem; color: #8b8f98; }
.note-pied form { margin: 0; }

/* Boutons empilés d'une colonne latérale : même taille, pleine largeur. */
.pile-actions { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }
.pile-actions form { margin: 0; }
.pile-actions .btn { width: 100%; }

/* Repère visuel des candidatures pas encore traitées */
.point-nouveau { display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--rouge); vertical-align: middle; margin-left: .35rem; }
tr.ligne-nouvelle td:first-child { box-shadow: inset 3px 0 0 var(--rouge); }
tr.ligne-nouvelle td { background: #fffafa; }
tr.ligne-nouvelle:hover td { background: #fff5f5; }

/* ---------- Un seul cadre pour toute la zone de droite ---------- */
.scene {
  background: var(--surface);
  border: 1px solid #edeef1;
  border-radius: var(--rayon-carte);
  box-shadow: var(--ombre);
  padding: 1.4rem 1.6rem 1.8rem;
  margin: 1.2rem 1.4rem 1.2rem 0;
}
.scene-tete {
  background: transparent; border: none; box-shadow: none;
  border-bottom: none;
  border-radius: 0; padding: 0; margin-bottom: 1.1rem;
}
/* Les blocs internes deviennent de simples zones délimitées */
.bloc, .indicateur, .recherche, .tableau-cadre, .question, .panneau {
  box-shadow: none; border-color: #eceef1;
}
.indicateur { background: #fbfbfc; }
.avis { box-shadow: none; background: #fbfbfc; }

/* ---------- Tableau de liste ---------- */
.panneau { border: 1px solid #eceef1; border-radius: var(--rayon-carte); overflow: hidden; }
.panneau-tete { padding: .9rem 1rem; border-bottom: none; }
.panneau-tete .recherche-ligne { margin-bottom: 0; }
/* Filtre au-dessus d'un tableau (Historique) : de l'air avant le tableau, et un
   menu à sa largeur plutôt qu'étiré sur toute la page. */
form.filtres { margin: 0 0 1.75rem; }
form.filtres label { display: block; margin-bottom: .4rem; }
form.filtres select, form.filtres .liste { width: 100%; max-width: 22rem; }
.filtres-repliables { margin-top: .8rem; padding-top: .8rem; border-top: none; }
.panneau-pied { display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; padding: .8rem 1rem; border-top: none; }
.panneau-pied .pagination { margin: 0; }

.tableau-liste { border-collapse: collapse; }
.tableau-liste thead th { background: #fbfbfc; }
.tableau-liste tbody td { padding: .85rem 1.1rem; }

.score-cellule { display: inline-flex; align-items: center; gap: .55rem; justify-content: flex-end; }
.score-jauge { display: inline-block; width: 62px; height: 6px; border-radius: 999px;
  background: #eceef1; overflow: hidden; }
.score-jauge span { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--rouge), var(--orange)); }

/* Zones de texte courtes (Paramètres) : la hauteur de leurs lignes, pas les 7rem
   par défaut ; elles restent agrandissables à la souris. */
textarea.zone-courte { min-height: 0; line-height: 1.5; }
.bloc dl.paires dd .petit { display: block; }

/* ---------- Retour aux cartes contrastées dans le cadre blanc ---------- */
.bloc, .indicateur, .recherche, .tableau-cadre, .question, .panneau {
  box-shadow: var(--ombre);
  border-color: #e8e9ed;
}
.indicateur { background: var(--surface); }
.avis { box-shadow: var(--ombre); background: var(--surface); }
.scene { background: var(--surface); }
.scene-corps { }

/* Pastilles de statut : fond plein, texte blanc, même contraste partout */
.etiquette {
  padding: .22rem .7rem; font-size: .73rem; font-weight: 600; letter-spacing: .01em;
  color: #fff; border-radius: var(--rayon-pilule); display: inline-block;
}

/* Recherche et filtres détachés du tableau */
.panneau-recherche { background: var(--surface); border: 1px solid #e8e9ed;
  border-radius: var(--rayon-carte); box-shadow: var(--ombre);
  padding: .9rem 1rem; margin-bottom: 1rem; }

/* Colonnes alignées à gauche */
.tableau-liste th, .tableau-liste td { text-align: left; }
.tableau-liste td.nombre, .tableau-liste th.nombre { text-align: left; }
.tableau-liste .score-cellule { justify-content: flex-start; }
.tableau-liste .nom-candidat { font-weight: 700; }


/* Texte pleine largeur dans les encadrés d'information */
.avis p, .bloc > p.petit { max-width: none; }

/* Pastilles pastel : fond clair, texte de la même teinte assombrie */
.etiquette {
  background: #f1f2f5; color: var(--encre-doux);
  border: 1px solid #e6e7eb;
  padding: .2rem .65rem; font-size: .73rem; font-weight: 600;
  border-radius: var(--rayon-pilule); display: inline-block; white-space: nowrap;
}

/* Ajustements des pages publiques */
.public-entete img { height: 40px; }
.section-formulaire:first-of-type > h2 { margin-bottom: .3rem; }
.section-formulaire input[type="file"] { padding: .5rem .6rem; background: #fafbfc; }
.public .radios { margin-top: .2rem; }
.public .case + .case { margin-bottom: 0; }

/* ---------- Ajustements des pages publiques ---------- */
.public-entete { padding: 1.1rem 1.5rem; }
.public-entete img { height: 30px; }
.public-entete h1 { font-size: 1.25rem; }

/* Listes déroulantes : même dessin que les champs de saisie */
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235f6166' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-color: var(--surface);
}
select::-ms-expand { display: none; }

/* Rien de rouge en décoration : le rouge ne signale que l'action ou l'erreur */
/* Zone de dépôt du CV (formulaire public) : une seule ligne cliquable, qui porte
   l'invite, l'aide et, une fois choisi, le nom du fichier. */
.depot-cv { position: relative; display: flex; align-items: center; gap: .85rem;
  padding: .85rem 1rem; border: 1px dashed #cfd2d8; border-radius: var(--rayon);
  background: var(--surface); cursor: pointer; font-weight: 400; margin: 0;
  transition: border-color .15s, background-color .15s; }
.depot-cv:hover, .depot-cv-survol { border-color: var(--rouge); background: #fffafa; }
.depot-cv:focus-within { border-color: var(--rouge); border-style: solid; }
.depot-cv input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0;
  overflow: hidden; }
.depot-cv-icone { flex: none; width: 26px; height: 26px; color: var(--rouge); }
.depot-cv-texte { display: flex; flex-direction: column; min-width: 0; }
.depot-cv-titre { font-size: .92rem; font-weight: 600; color: var(--encre);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.depot-cv-aide { font-size: .8rem; color: var(--encre-doux); }
.depot-cv-rempli { border-style: solid; }
.champ.en-erreur .depot-cv { border-color: var(--danger); }

/* Cases à cocher du formulaire public : sans cadre. Une case oubliée se signale
   par son propre contour rouge, en plus du message d'erreur. */
.public .case { background: none; border: none; padding: 0; }
.public .case.en-erreur input { outline: 2px solid var(--danger); outline-offset: 1px; }
.public .case > div { min-width: 0; }
.public .case .petit { margin: .15rem 0 0; }
.public .section-formulaire input[type="file"] { background: var(--surface); }
.public .avis { border-left: none; border: 1px solid #e6e7eb; }
.public .avis.erreur { border-color: var(--danger); }

/* Bouton d'envoi et sa mention alignés à droite, la mention sous le bouton. */
.public-envoi { display: flex; flex-direction: column; align-items: flex-end; text-align: right;
  border-top: none; padding-top: 0; gap: 0; }
.public-envoi p.petit { margin: .45rem 0 0; }
/* Sur téléphone, le bouton d'envoi prend toute la largeur. */
@media (max-width: 600px) {
  .public-envoi { align-items: stretch; text-align: left; }
  .public-envoi .btn { width: 100%; }
}

/* Logo isolé au-dessus du bandeau de titre */
/* Listes déroulantes du formulaire public (script dans `public/formulaire.html`).
   Le bouton reprend le dessin des champs de saisie ; la liste ouverte, celui des
   cartes. Le <select> d'origine reste dans la page, invisible, pour l'envoi. */
.liste { position: relative; }
.liste-native { position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; pointer-events: none; }
.liste .liste-bouton { display: block; width: 100%; text-align: left;
  padding: .6rem 2.2rem .6rem .8rem; font: inherit; font-size: .9rem; font-weight: 400;
  color: var(--encre); background-color: var(--surface);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235f6166' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center;
  border: 1px solid #e0e2e7; border-radius: var(--rayon); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.liste .liste-bouton:hover { background-color: var(--surface); border-color: #cfd2d8; color: var(--encre); }
.liste .liste-bouton:focus-visible, .liste-ouverte .liste-bouton { outline: none;
  border-color: var(--rouge); }
.liste .liste-bouton.liste-vide { color: #8b8f98; }
.champ.en-erreur .liste-bouton { border-color: var(--danger); }
.liste-options { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
  margin: 0; padding: .35rem; list-style: none; max-height: 18rem; overflow-y: auto;
  background: var(--surface); border: 1px solid #e6e7eb; border-radius: var(--rayon);
  box-shadow: var(--ombre-forte); }
.liste-haut .liste-options { top: auto; bottom: calc(100% + 6px); }
.liste-options:focus { outline: none; }
.liste-options li { padding: .55rem .7rem; border-radius: 6px; font-size: .9rem;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.liste-options li.liste-actif { background: #f4f5f7; }
.liste-options li[aria-selected="true"] { font-weight: 600; }
.liste-options li[aria-selected="true"]::after { content: ""; flex: none; width: 14px; height: 14px;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d21f26' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") no-repeat center / contain; }

/* Variante « pastille » : les menus de l'en-tête du back-office (période du
   tableau de bord). La liste ouverte s'aligne à droite, sous la pastille. */
.liste-pilule { display: inline-block; }
.liste-pilule .liste-bouton { width: auto; min-width: 11rem; font-size: .82rem;
  padding: .5rem 2.2rem .5rem .9rem; border-radius: var(--rayon-pilule);
  border-color: transparent; box-shadow: var(--ombre); }
.liste-pilule .liste-bouton:hover { border-color: #e6e7eb; }
.liste-pilule .liste-options { left: auto; right: 0; min-width: 100%; width: max-content;
  font-size: .85rem; }

/* En-tête du formulaire public, sans bandeau ni carte (un bandeau blanc a été
   essayé et écarté). Trois colonnes : le logo au bord gauche de la page, le titre
   de la barre dans la colonne du formulaire (même largeur et mêmes marges que
   `.public-shell`), à hauteur du logo. */
.public-barre { display: grid; grid-template-columns: 1fr minmax(0, 46rem) 1fr;
  align-items: center; padding-top: 1.5rem; }
.public-barre-logo { grid-column: 1; justify-self: start; margin-left: 2rem;
  height: 46px; width: auto; display: block; }
.public-barre-titre { grid-column: 2; padding: 0 1.5rem; }
.public-barre-titre h1, .public-barre-rappel { font-size: 1.6rem; margin: 0; }
/* Même titre de barre sur la page de confirmation, sans en faire le titre de la
   page (c'est le message de confirmation qui l'est). */
.public-barre-rappel { font-weight: 700; color: var(--encre); letter-spacing: -.015em;
  max-width: none; line-height: 1.15; }

/* Mention d'information (page publique « Traitement de vos données ») : un
   chapeau, puis une section par intitulé (« Base légale », « Vos droits »…),
   l'intitulé en gras et en rouge. */
.mention { padding: 1.9rem 2.1rem; }
.mention p { max-width: none; line-height: 1.65; margin: 0; }
.mention-chapeau { font-size: 1rem; font-weight: 500; color: var(--encre); margin-bottom: 1.5rem !important; }
.mention-section + .mention-section { margin-top: 1.25rem; }
.mention-intitule { font-size: .95rem; font-weight: 700; color: var(--rouge); letter-spacing: 0;
  margin: 0 0 .25rem; line-height: 1.3; }
.mention-section p { color: var(--encre-doux); font-size: .95rem; }

/* Éditeur de la mention dans Paramètres : au dessin de la page publique, mais
   chaque texte se lit comme un champ (fond gris clair, contour), pour qu'on voie
   ce qui se modifie. */
.mention-editeur { margin: 1rem 0 1.2rem; }
/* Les zones de texte prennent la hauteur de leur contenu (script de l'onglet) :
   ni ascenseur, ni poignée de redimensionnement. */
.mention-editeur textarea { min-height: 0; line-height: 1.55; overflow: hidden; resize: none; }
.libelle-rubriques { font-weight: 600; margin: 1.2rem 0 .5rem; }
.rubrique-edition { position: relative; border: 1px solid #e8e9ed; border-radius: var(--rayon);
  padding: .9rem 1rem; margin-bottom: .7rem; background: #fcfcfd; }
/* « Supprimer la rubrique » en haut à droite de la carte : il vise toute la carte. */
.rubrique-edition .retirer-rubrique { position: absolute; top: .35rem; right: .5rem;
  color: var(--danger); font-weight: 500; font-size: .8rem; min-height: 36px; }
.rubrique-edition .retirer-rubrique svg { width: 15px; height: 15px; }
.rubrique-libelle { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .7rem; }
.rubrique-libelle:last-child { margin-bottom: 0; }
.rubrique-libelle input, .rubrique-libelle textarea { display: block; width: 100%; margin-top: .35rem;
  font-weight: 400; }
.rubrique-libelle textarea { min-height: 0; }
#ajouter-rubrique { margin: .3rem 0 1.2rem; }
#ajouter-rubrique { margin-top: 1.3rem; }

/* Page d'erreur (404) : le code en grand et discret, une phrase, des sorties. */
.erreur-page-code { font-size: 3.2rem; font-weight: 700; line-height: 1; letter-spacing: -.03em;
  color: #e4e6ea; margin: 0 0 .9rem; }
.erreur-page p { max-width: none; }
.erreur-page-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }

/* Page centrée (confirmation) : pas de titre, la carte au milieu, son contenu et
   le pied de page centrés. */
.page-centree .public-titre { display: none; }
.page-centree .public-shell { padding-top: 4rem; }
.page-centree .confirmation { flex-direction: column; align-items: center; text-align: center;
  max-width: 34rem; margin: 0 auto; padding: 2.25rem 2rem; }
.page-centree .confirmation-coche { width: 44px; height: 44px; }
.page-centree .public-pied { text-align: center; }

/* Page de confirmation : une carte, une coche, le message. */
.confirmation { display: flex; align-items: flex-start; gap: 1rem; }
.confirmation-coche { flex: none; width: 34px; height: 34px; color: #1f7a4d; }
.confirmation-texte { font-size: 1.1rem; font-weight: 600; line-height: 1.45; margin: .3rem 0 .35rem; }
.confirmation .petit { margin: 0; }
.public-barre-titre:empty { display: none; }
/* Quand la colonne de gauche n'a plus la place du logo, on empile : le logo,
   puis le titre, tous deux sur le bord du formulaire. */
@media (max-width: 1080px) {
  .public-barre { display: block; max-width: 46rem; margin: 0 auto; padding: 1.25rem 1.5rem 0; }
  .public-barre-logo { margin-left: 0; }
  .public-barre-titre { padding: 1.4rem 0 0; }
}
.public-titre { padding: .4rem .25rem 1.5rem; }
.public-titre h1 { font-size: 1.6rem; margin: 0 0 .45rem; }
/* Formulaire : son titre est dans la barre du logo ; l'introduction et le
   formulaire remontent juste dessous. */
.page-titre-barre .public-shell { padding-top: .9rem; }
.page-titre-barre .public-titre { padding-top: 0; padding-bottom: 1.1rem; }
/* « Lire l'information » ne se coupe jamais en deux lignes. */
.lien-insecable { white-space: nowrap; }
/* Texte réservé aux lecteurs d'écran. */
.visuellement-cache { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* État d'un e-mail : brouillon gris, envoyé vert, échec rouge. */
.etat-courriel { display: inline-block; padding: .15rem .6rem; border-radius: var(--rayon-pilule);
  font-size: .76rem; font-weight: 600; white-space: nowrap;
  background: #f1f2f5; color: #4b4f58; border: 1px solid #e3e5e9; }
.etat-sent { background: #e8f3ec; color: #165536; border-color: #b9dcc6; }
.etat-failed { background: #f8e6e7; color: #741115; border-color: #e6b3b6; }
.cellule-action { width: 44px; padding-top: 0; padding-bottom: 0; }
.cellule-action form { margin: 0; }
/* E-mails de la fiche : de l'air entre les colonnes ; la date sur deux lignes
   courtes (jour, puis heure) ; « Ouvrir » et la corbeille côte à côte. */
.tableau-courriels td, .tableau-courriels th { padding-left: .9rem; padding-right: .9rem;
  vertical-align: middle; }
.tableau-courriels td:first-child, .tableau-courriels th:first-child { padding-left: 0; }
.tableau-courriels td:last-child, .tableau-courriels th:last-child { padding-right: 0; }
.tableau-courriels td { padding-top: .8rem; padding-bottom: .8rem; }
.cellule-date { white-space: nowrap; line-height: 1.35; }
.cellule-actions { white-space: nowrap; text-align: right; }
.cellule-actions > a, .cellule-actions > form { display: inline-flex; vertical-align: middle; }
.cellule-actions form { margin: 0 0 0 .3rem; }
/* Action secondaire d'une ligne écrite comme les liens du site (rouge, souligné). */
.btn-tertiaire.lien-action { padding: 0 .3rem; color: var(--rouge-sombre); font-weight: 400;
  font-size: inherit; text-decoration: underline; text-underline-offset: .15em; }
.btn-tertiaire.lien-action:hover { color: var(--rouge); }
/* Écrit comme un lien, il en prend la hauteur : la ligne ne gonfle plus. */
.btn-tertiaire.lien-action { min-height: 0; line-height: inherit; }
.tableau-modeles td { padding-top: .7rem; padding-bottom: .7rem; vertical-align: middle; }

/* Palette de couleurs (statuts, niveaux) : une pastille qui ouvre une grille. */
.palette { position: relative; display: inline-block; }
.palette-choix { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px;
  padding: 0 .7rem; border: 1px solid #e0e2e7; border-radius: var(--rayon);
  background: var(--surface); cursor: pointer; list-style: none; }
.palette-choix::-webkit-details-marker { display: none; }
.palette-choix:hover { border-color: #cfd2d8; }
.palette[open] > .palette-choix { border-color: var(--rouge); }
.palette-apercu { width: 22px; height: 22px; border-radius: 6px; flex: none; }
.palette-choix svg { width: 14px; height: 14px; color: #8b8f98; }
.palette-grille { position: absolute; top: calc(100% + .35rem); left: 0; z-index: 25; margin: 0;
  display: grid; grid-template-columns: repeat(6, 32px); gap: .4rem; padding: .7rem;
  background: var(--surface); border: 1px solid #eceef1; border-radius: var(--rayon-carte);
  box-shadow: var(--ombre-forte); min-width: 0; }
/* Grille poussée contre le bord droit : elle s'ouvre vers la gauche. */
.palette-a-gauche .palette-grille { left: auto; right: 0; }
.question-pied > .liste { flex: 0 0 13rem; }
.palette-case { position: relative; display: block; width: 32px; height: 32px; cursor: pointer; }
.palette-case input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.palette-pastille { display: block; width: 100%; height: 100%; border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.palette-case input:checked + .palette-pastille { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--encre); }
.palette-case input:focus-visible + .palette-pastille { outline: 2px solid var(--rouge); outline-offset: 3px; }
/* Vérification anti-robot : une réponse de deux chiffres, un champ étroit. */
.champ-verification { max-width: 7rem; }
.public-titre p { margin: 0; max-width: none; color: var(--encre-doux); font-size: .95rem;
  line-height: 1.6; }

/* Pied de page aligné à gauche sur le même bord que le logo : centré dans un
   paragraphe de largeur limitée, il flottait entre les deux. */
.public-pied { text-align: left; padding: 0 .25rem; }
.public-pied p { max-width: none; margin: 0; }
.public-logo { padding: .2rem .25rem 1.1rem; }
.public-logo img { height: 34px; width: auto; display: block; }
.public-entete { display: block; }
.public-entete h1 { margin-bottom: .35rem; }
.public-entete p { margin: 0; color: var(--encre-doux); font-size: .9rem; }

/* Encadré CV : remplacement replié */
/* Bloc CV de la fiche : le fichier en carte cliquable, qui l'ouvre ; puis les
   actions ; le dépôt d'un nouveau PDF se déplie dessous. */
.fichier-cv { display: flex; align-items: center; gap: .8rem; padding: .75rem .9rem;
  border: 1px solid #e6e7eb; border-radius: var(--rayon); background: #fafbfc;
  color: var(--encre); text-decoration: none; margin-top: .9rem; }
.fichier-cv:hover { border-color: var(--rouge); background: var(--surface); color: var(--encre); }
.fichier-cv-icone { width: 22px; height: 22px; flex: none; color: var(--rouge); }
.fichier-cv-texte { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.fichier-cv-nom { font-weight: 600; font-size: .88rem; overflow-wrap: anywhere; }
.fichier-cv:hover .fichier-cv-nom { text-decoration: underline; text-underline-offset: 3px; }
.remplacer-cv { margin-top: 1rem; }
/* « Télécharger le CV », puis « Remplacer le CV » écrit comme les liens du site
   (« Ouvrir », « Relire ») : rouge, souligné, sans graisse. */
.groupe-cv { gap: .6rem; flex-wrap: nowrap; }
.groupe-cv .btn-secondaire { padding: 0 1rem; }
.groupe-cv .btn-tertiaire { padding: 0 .3rem; color: var(--rouge-sombre); font-weight: 400;
  font-size: .88rem; text-decoration: underline; text-underline-offset: .15em;
  white-space: normal; text-align: left; min-width: 0; }
.groupe-cv .btn-tertiaire:hover { color: var(--rouge); }
@media (max-width: 1180px) { .groupe-cv { flex-wrap: wrap; } }
.remplacer-cv .champ { margin-bottom: .8rem; }
.marque-archive { font-weight: 600; color: var(--encre); }

/* Filtres à sélection multiple */
.grille-filtres { display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.grille-filtres fieldset { border: 1px solid #eceef1; border-radius: var(--rayon);
  padding: .7rem .9rem; margin: 0; min-width: 0; }
.grille-filtres legend { font-size: .76rem; font-weight: 600; color: #6f737c;
  text-transform: uppercase; letter-spacing: .05em; padding: 0 .3rem; }
.grille-filtres select[multiple] { width: 100%; padding: .35rem; font-size: .82rem;
  background-image: none; border-radius: var(--rayon); }
.grille-filtres .recherche-listes select,
.grille-filtres .recherche-listes input { min-width: 100%; }
.coche { display: flex; align-items: center; gap: .5rem; padding: .18rem 0;
  font-size: .85rem; cursor: pointer; }
.coche input { flex: none; }

/* Comptes : champ de mot de passe replié */
form.masque { display: none; }
form.note-bloc:not(.masque) { display: flex; gap: .45rem; align-items: center;
  flex-wrap: wrap; }

/* Score seul, sans pastille */
.score-nu { font-size: 2rem; font-weight: 700; letter-spacing: -.03em; line-height: 1; }

/* Filtres : des listes homogènes */
.filtre { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.filtre label { font-size: .76rem; font-weight: 600; color: #6f737c;
  text-transform: uppercase; letter-spacing: .05em; }
.filtre select { width: 100%; }
.filtre select[multiple] { padding: .3rem; font-size: .84rem; background-image: none;
  border-radius: var(--rayon); }
.filtre + .filtre { margin-top: 0; }
.filtre label + select + label { margin-top: .5rem; }

/* Statuts : une carte par statut */
/* Une liste simple : une ligne par statut, séparées par un filet clair. */
.liste-statuts { display: grid; gap: 0; margin-bottom: 1.1rem; background: var(--surface);
  border: 1px solid #e8e9ed; border-radius: var(--rayon-carte); padding: .2rem 1.2rem; }
.carte-statut { padding: .45rem 0; border-top: 1px solid #f0f1f4; }
.carte-statut:first-child { border-top: none; }
.carte-statut.inactive { opacity: .6; }
.carte-statut-tete { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.carte-statut-meta { flex: 1; min-width: 12rem; }
.carte-statut-edition { margin-top: .9rem; padding-top: .9rem; border-top: none;
  display: grid; gap: .8rem; grid-template-columns: minmax(0, 2fr) 7rem; align-items: end; }
.carte-statut-edition .case, .carte-statut-edition .btn { grid-column: 1 / -1; }
.carte-statut-edition .champ { margin: 0; }
.carte-statut-edition .btn { justify-self: start; }
form.carte-statut-edition.masque { display: none; }

/* Tableau des réponses du questionnaire : tout à gauche, cellules alignées en
   haut — la précision « ouvre un champ de saisie libre » se glisse sous le
   libellé sans décaler le champ des points de la même ligne. */
.table-reponses th, .table-reponses td { text-align: left; vertical-align: top; }
.table-reponses td { padding-top: .35rem; padding-bottom: .35rem; }
.table-reponses .reponse-aide { display: block; margin-top: .3rem; font-size: .78rem;
  color: var(--encre-doux); }
/* Case « Affichée » et bouton « Retirer » centrés sur la hauteur d'un champ. */
.table-reponses .reponse-case input { margin: .85rem 0 0; }
.table-reponses th.colonne-centree, .table-reponses td.reponse-case { text-align: center; }
/* Retirer une réponse : une corbeille, pas un bouton par ligne. */
.table-reponses td.reponse-retirer { width: 44px; padding-left: 0; }


/* En-têtes de tableau triables (`backoffice/_entetes_tri.html`) : chaque colonne
   triable porte une double flèche discrète, qui fonce au survol ; la colonne
   triée est plus foncée, avec la flèche de son sens. */
th a.tri { color: inherit; text-decoration: none; display: inline-flex; align-items: center;
  gap: .3rem; white-space: nowrap; }
th a.tri:hover { color: var(--encre); }
th a.tri::after { content: ""; width: 10px; height: 10px; flex: none; opacity: .45;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c1c20' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain; }
th a.tri:not(.tri-actif)::after { background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c1c20' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9 5-5 5 5M7 15l5 5 5-5'/%3E%3C/svg%3E") no-repeat center / contain; }
th a.tri:hover::after { opacity: .7; }
th a.tri:hover { text-decoration: underline; text-underline-offset: 3px; }
th a.tri-actif { color: var(--encre); }
th a.tri-actif::after { opacity: 1; }
th a.tri-asc::after { transform: rotate(180deg); }


/* ---------- Barre de filtres de la liste des candidatures ----------
   Une pastille par filtre (44 px, comme les boutons) ; son menu s'ouvre dessous,
   à cases à cocher. Une pastille utilisée passe en rouge pâle et compte ses
   choix. Les filtres actifs suivent, chacun avec sa croix. */
.barre-filtres { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .2rem; }
.menu-filtre { position: relative; }
.puce-filtre { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px;
  padding: 0 .95rem; border-radius: var(--rayon-pilule); border: 1px solid #e0e2e7;
  background: var(--surface); font-size: .84rem; font-weight: 600; color: var(--encre);
  cursor: pointer; list-style: none; user-select: none; white-space: nowrap; }
.puce-filtre::-webkit-details-marker { display: none; }
.puce-filtre:hover { border-color: #cfd2d8; background: #f8f9fa; }
.puce-filtre:focus-visible { outline: 2px solid var(--rouge); outline-offset: 2px; }
.puce-filtre svg { width: 15px; height: 15px; flex: none; }
.puce-filtre-chevron { color: #8b8f98; transition: transform .15s; }
.menu-filtre[open] .puce-filtre-chevron { transform: rotate(180deg); }
.menu-filtre[open] > .puce-filtre { border-color: var(--rouge); }
.puce-filtre-active { border-color: var(--rouge); background: #fdf1f1; color: var(--rouge-sombre); }
.puce-filtre-active:hover { background: #fbe7e7; border-color: var(--rouge-sombre); }
.puce-filtre-plus { border-style: dashed; }
.puce-filtre-plus.puce-filtre-active { border-style: solid; }
.menu-filtre-liste { position: absolute; top: calc(100% + .35rem); left: 0; z-index: 20;
  min-width: 15rem; max-width: 22rem; max-height: 20rem; overflow-y: auto;
  background: var(--surface); border-radius: var(--rayon-carte); box-shadow: var(--ombre-forte);
  border: 1px solid #eceef1; padding: .4rem; }
.menu-filtre-plus .menu-filtre-liste { left: auto; right: 0; }
.menu-filtre-large { min-width: 18rem; }
.menu-filtre-option { display: flex; align-items: center; gap: .6rem; min-height: 40px;
  padding: 0 .6rem; border-radius: var(--rayon); font-size: .86rem; font-weight: 500;
  cursor: pointer; }
.menu-filtre-option:hover { background: #f5f6f8; }
.menu-filtre-option input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--rouge); }
.menu-filtre-titre { margin: .6rem .6rem .2rem; font-size: .72rem; font-weight: 600;
  color: #6f737c; text-transform: uppercase; letter-spacing: .05em; }
.menu-filtre-titre:first-child { margin-top: .3rem; }
.menu-filtre-vide { margin: .5rem .6rem; }
.filtres-actifs { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  margin-top: .8rem; }
.filtres-actifs > .petit { margin-right: .2rem; }
.filtre-actif { display: inline-flex; align-items: center; gap: .35rem; min-height: 32px;
  padding: 0 .45rem 0 .8rem; border-radius: var(--rayon-pilule); background: #f1f2f5;
  color: var(--encre); font-size: .8rem; font-weight: 600; text-decoration: none; }
.filtre-actif svg { width: 14px; height: 14px; color: #6f737c; }
.filtre-actif:hover { background: #fbe7e7; color: var(--rouge-sombre); }
.filtre-actif:hover svg { color: var(--rouge-sombre); }
