/* Charte du test de recrutement (couleurs regroupées ici) */
:root {
  --vert: #1f8a4c;
  --vert-clair: #e8f5ee;
  --rouge: #c8372d;
  --rouge-clair: #fbeceb;
  --orange: #c77700;
  --orange-clair: #fff4e0;
  --encre: #22282e;
  --gris: #65707a;
  --bord: #dde2e6;
  --fond: #f5f7f6;
  --carte: #ffffff;
  --rayon: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--encre); background: var(--fond); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
a { color: var(--vert); }
.cache { display: none !important; }
.discret { color: var(--gris); font-size: .9rem; }

/* En-tête */
.entete { background: var(--vert); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.entete .marque { font-weight: 800; letter-spacing: .08em; }
.entete .sous { opacity: .9; font-size: .9rem; }
.entete .droite { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.contenu { max-width: 860px; margin: 0 auto; padding: 20px 16px 80px; }
.large { max-width: 1180px; }

/* Cartes et formulaires */
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 18px; margin-bottom: 16px; }
label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .92rem; }
input[type=text], input[type=password], input[type=search], textarea, select {
  width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--bord); border-radius: 8px; background: #fff; color: var(--encre);
}
textarea { min-height: 130px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--vert); outline-offset: 0; border-color: var(--vert); }
.ligne { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }

.bouton { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--vert); background: var(--vert); color: #fff; cursor: pointer; text-decoration: none; }
.bouton:hover { filter: brightness(1.08); }
.bouton:disabled { opacity: .5; cursor: default; }
.bouton.second { background: #fff; color: var(--vert); }
.bouton.danger { background: #fff; color: var(--rouge); border-color: var(--rouge); }
.bouton.petit { padding: 5px 10px; font-size: .85rem; }
.entete .bouton.second { border-color: #fff; }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .8rem; font-weight: 600; background: #eef0f2; color: var(--gris); white-space: nowrap; }
.badge.vert { background: var(--vert-clair); color: var(--vert); }
.badge.rouge { background: var(--rouge-clair); color: var(--rouge); }
.badge.orange { background: var(--orange-clair); color: var(--orange); }

/* ---------- Page candidat ---------- */
.barre-test { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--bord); padding: 10px 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.chrono { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.3rem; }
.chrono.orange { color: var(--orange); } .chrono.rouge { color: var(--rouge); }
.progression { flex: 1; min-width: 120px; height: 8px; background: #eef0f2; border-radius: 99px; overflow: hidden; }
.progression > div { height: 100%; background: var(--vert); width: 0; transition: width .3s; }
.etat-sauvegarde { font-size: .85rem; color: var(--gris); min-width: 90px; text-align: right; }
.partie-titre { margin: 28px 0 4px; color: var(--vert); }
.question .numero { font-weight: 800; color: var(--vert); }
.question .points { float: right; }
.options { display: grid; gap: 8px; margin-top: 10px; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--bord); border-radius: 8px; cursor: pointer; font-weight: 400; margin: 0; }
.option:hover { border-color: var(--vert); }
.option input { margin-top: 4px; accent-color: var(--vert); }
.option:has(input:checked) { border-color: var(--vert); background: var(--vert-clair); }
.consignes li { margin-bottom: 6px; }
.centre { text-align: center; }
.grand { font-size: 1.1rem; }

/* ---------- Espace recruteur ---------- */
.tableau { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tableau th, .tableau td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.tableau th { font-size: .8rem; color: var(--gris); text-transform: uppercase; letter-spacing: .03em; cursor: pointer; user-select: none; }
.tableau tr.cliquable { cursor: pointer; }
.tableau tr.cliquable:hover td { background: var(--vert-clair); }
.defile { overflow-x: auto; }
.note { font-weight: 800; font-variant-numeric: tabular-nums; }
.mini-axes { display: flex; gap: 3px; }
.mini-axes span { width: 18px; height: 22px; background: #eef0f2; border-radius: 3px; position: relative; overflow: hidden; }
.mini-axes span i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--vert); }

.lien-genere { background: var(--vert-clair); border: 1px solid var(--vert); }
.lien-genere code { display: block; word-break: break-all; background: #fff; padding: 8px 10px; border-radius: 6px; margin: 8px 0; font-size: .9rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.synthese { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start; }
@media (max-width: 640px) { .synthese { grid-template-columns: 1fr; } }
.grosse-note { font-size: 2.6rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.grosse-note small { font-size: 1.1rem; color: var(--gris); }
.axe { margin-bottom: 10px; }
.axe .tete { display: flex; justify-content: space-between; font-size: .9rem; }
.jauge { height: 10px; background: #eef0f2; border-radius: 99px; overflow: hidden; }
.jauge > div { height: 100%; background: var(--vert); }
.jauge.faible > div { background: var(--orange); }
.alerte { padding: 8px 12px; border-radius: 8px; margin-bottom: 6px; font-size: .92rem; }
.alerte.rouge { background: var(--rouge-clair); color: var(--rouge); }
.alerte.orange { background: var(--orange-clair); color: var(--orange); }

.reponse-texte { white-space: pre-wrap; background: var(--fond); border-radius: 8px; padding: 10px 12px; margin: 8px 0 12px; font-size: .95rem; }
.reponse-texte mark { background: #fff1a8; padding: 0 1px; border-radius: 2px; }
.reponse-vide { color: var(--gris); font-style: italic; }
.critere { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-weight: 400; margin: 0; border-top: 1px dashed var(--bord); }
.critere input { margin-top: 5px; accent-color: var(--vert); width: 18px; height: 18px; }
.critere .detail { font-size: .82rem; color: var(--gris); }
.qcm-choix { padding: 6px 10px; border-radius: 6px; margin: 4px 0; font-size: .92rem; }
.qcm-choix.juste { background: var(--vert-clair); }
.qcm-choix.faux { background: var(--rouge-clair); }
.qcm-choix.attendu { border: 1px dashed var(--vert); }
.choix-avis { display: flex; gap: 8px; flex-wrap: wrap; }
.choix-avis label { font-weight: 400; display: flex; gap: 6px; align-items: center; border: 1px solid var(--bord); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.choix-avis label:has(input:checked) { border-color: var(--vert); background: var(--vert-clair); }
.message { padding: 10px 14px; border-radius: 8px; background: var(--rouge-clair); color: var(--rouge); margin-bottom: 12px; }

@media print {
  body { background: #fff; font-size: 12px; }
  .entete, .pas-imprimer, .bouton, .barre-test { display: none !important; }
  .contenu { max-width: none; padding: 0; }
  .carte { border: none; padding: 6px 0; break-inside: avoid; }
  .critere input { display: none; }
  .critere:not(.retenu) { color: #999; text-decoration: line-through; }
  textarea { border: none; min-height: 0; }
}
.espace-haut { margin-top: 16px; }
.actions h2 { margin: 0; flex: 1; }
.filtre { max-width: 220px; }
