/* ============================================================
   Questionnaire — feuille propre à cette page.

   Elle ne redéfinit rien du site : elle s'appuie sur assets/style.css
   (couleurs, polices, en-tête, pied de page) et n'ajoute que ce qui est
   spécifique à un formulaire de plusieurs pages. Les variables --bleu,
   --rouge-texte, --f-titre et --f-texte viennent de là.

   Trois principes :
   - une question = un cadre identifiable, avec son code (S1, A3…) ;
   - les cibles tactiles font au moins 44 px (le seuil de la recette) ;
   - rien ne dépend de la couleur seule : chaque état a aussi une forme.
   ============================================================ */

.page-questionnaire{scroll-padding-top:96px}

/* ---------- ouverture ---------- */
.q-head{padding-bottom:52px}
.q-head h1{font-size:clamp(32px,5vw,56px);max-width:26ch}
.q-head .diag{max-width:62ch}

/* ---------- encadrés ---------- */
.q-encadre{
  border:1px solid var(--filet);border-left:6px solid var(--bleu);
  padding:26px 28px 22px;margin:0 0 34px;background:#fff;
}
.q-encadre h2{font-size:clamp(19px,2.1vw,23px);margin-bottom:12px}
.q-encadre p{margin:0 0 12px;font-size:16.5px;color:var(--gris);max-width:72ch}
.q-encadre p:last-child{margin-bottom:0}
.q-encadre--rassure{border-left-color:var(--rouge-texte);background:#FFF8F6}
.q-encadre--rassure h2{color:var(--rouge-texte)}
.q-encadre--alerte{border-left-color:var(--rouge-texte);background:#FDEDE9;
  padding:20px 22px;margin-top:22px}
.q-encadre--alerte p{color:#7A2410;margin:0}

.q-h2{font-size:clamp(19px,2.1vw,23px);margin-bottom:16px}

.q-deux{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
  gap:34px;margin:0 0 34px}

.q-puces{margin:0;padding-left:22px;display:grid;gap:11px;max-width:66ch}
.q-puces li{font-size:16.5px;color:var(--encre)}
.q-puces strong{font-weight:800}

/* Les mentions obligatoires : une liste de définitions, pas un paragraphe,
   parce qu'il faut pouvoir retrouver d'un coup d'œil qui contacter. */
.q-modalites{margin:0;padding:0;display:grid;gap:0;border-top:1px solid var(--filet)}
.q-modalites dt{
  font-family:var(--f-titre);font-size:13.5px;text-transform:uppercase;
  letter-spacing:.08em;color:var(--bleu);padding:16px 0 0;
}
.q-modalites dd{margin:6px 0 0;padding:0 0 16px;font-size:16.5px;
  border-bottom:1px solid var(--filet);color:var(--encre);max-width:74ch}

.q-avert{margin:22px 0 0;padding-left:22px;display:grid;gap:10px}
.q-avert li{font-size:15.5px;color:var(--gris);max-width:72ch}

/* ---------- bloc repliable (les cinq mentions) ----------
   Repli par case à cocher, sans JavaScript : le contenu reste dans le
   document, donc accessible même si le script ne tourne pas. Mesuré : un
   <details> fermé ne s'imprime pas, cette technique-là s'imprime. */
.q-repli{border:1px solid var(--filet);border-left:6px solid var(--bleu);
  background:#fff;margin:0 0 34px}
.q-repli-case{position:absolute;opacity:0;width:1px;height:1px;
  margin:-1px;overflow:hidden;clip-path:inset(50%);pointer-events:none}
.q-repli-titre{
  display:flex;align-items:center;justify-content:space-between;gap:18px;
  cursor:pointer;padding:22px 26px;margin:0;
  font-family:var(--f-titre);font-size:clamp(19px,2.1vw,23px);
  line-height:var(--interligne-titre);text-transform:uppercase;
  letter-spacing:.005em;color:#fff;background:var(--bleu);
}
.q-repli-tete{display:block;min-width:0}
.q-repli-texte{display:block}
/* La ligne de résumé reste en Manrope, pas en Anton : c'est du texte à lire,
   pas un titre — et elle ne doit pas hériter des capitales du titre. */
.q-repli-resume{
  display:block;margin-top:9px;
  font-family:var(--f-texte);font-size:15.5px;font-weight:600;
  line-height:1.45;letter-spacing:0;text-transform:none;
  color:var(--sur-bleu-clair);max-width:62ch;
}
.q-repli-chevron{
  flex:none;font-size:20px;line-height:1;transition:transform .2s var(--ease);
}
.q-repli-case:checked ~ .q-repli-titre .q-repli-chevron{transform:rotate(180deg)}
/* La case reçoit le focus, l'anneau doit se voir sur le titre. */
.q-repli-case:focus-visible ~ .q-repli-titre{outline:3px solid var(--rouge);
  outline-offset:-3px}
.q-repli-titre:hover{background:#132B62}
.q-repli-corps{padding:26px 26px 6px}
.q-repli-case:not(:checked) ~ .q-repli-corps{display:none}

/* ---------- jauge ---------- */
.q-jauge{position:sticky;top:82px;z-index:30;background:var(--bleu);color:#fff;
  padding:11px 0}
.q-jauge .wrap{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.q-jauge-txt{margin:0;font-size:14.5px;font-weight:600;color:var(--sur-bleu-clair);
  min-height:1.4em}
.q-jauge-txt b{color:#fff;font-family:var(--f-titre);font-size:17px;
  letter-spacing:.03em}
.q-jauge-barre{flex:1;min-width:120px;height:6px;background:rgba(255,255,255,.24)}
.q-jauge-barre span{display:block;height:100%;width:0;background:var(--rouge);
  transition:width .25s var(--ease)}

/* ---------- tête de section ---------- */
.q-tete{display:grid;grid-template-columns:auto minmax(0,1fr);gap:20px;
  align-items:start;margin-bottom:34px}
.q-num{
  font-family:var(--f-titre);font-size:26px;line-height:1;color:#fff;
  background:var(--bleu);width:52px;height:52px;display:flex;align-items:center;
  justify-content:center;flex:none;
}
.q-tete h2{font-size:clamp(24px,3.1vw,36px);max-width:26ch}
.q-tete h2::after{content:"";display:block;width:56px;height:5px;
  background:var(--rouge);margin-top:14px}
.q-tete .q-aide{margin-top:14px}

/* ---------- une question ---------- */
.q-q{
  border:0;border-top:1px solid var(--filet);margin:0;padding:28px 0 6px;
  min-width:0;
}
.q-q:first-of-type{border-top:0;padding-top:8px}
.q-legende{padding:0;display:grid;grid-template-columns:auto minmax(0,1fr);
  gap:14px;align-items:baseline;margin-bottom:14px}
/* Le code de la question (S1, A3, H2…) n'est pas une décoration : c'est ce
   qui permet de s'y référer au dépouillement. Il reste discret mais lisible. */
.q-code{font-family:var(--f-titre);font-size:12.5px;letter-spacing:.06em;
  color:var(--bleu);background:var(--gris-fond);border:1px solid var(--filet);
  padding:4px 8px;white-space:nowrap}
.q-intitule{font-size:18.5px;font-weight:700;line-height:1.42;color:var(--encre);
  max-width:64ch;text-wrap:pretty}

.q-aide{font-size:15px;color:var(--gris);margin:0 0 16px;max-width:68ch}
.q-aide--bas{margin-top:22px;margin-bottom:0}
.q-legende + .q-aide{margin-left:0}

/* ---------- choix ---------- */
.q-opts{display:grid;gap:9px;grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.q-opts--multi{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}
.q-opts--sans{grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  margin-top:14px;padding-top:14px;border-top:1px dashed var(--filet-fort)}

.q-opt{
  display:grid;grid-template-columns:26px minmax(0,1fr);gap:13px;
  align-items:start;padding:13px 15px;border:1.5px solid var(--filet);
  background:#fff;cursor:pointer;min-height:48px;
  transition:border-color .15s var(--ease),background .15s var(--ease);
}
.q-opt:hover{border-color:var(--bleu);background:var(--gris-fond)}
.q-opt input{width:22px;height:22px;margin:2px 0 0;accent-color:var(--bleu);
  cursor:pointer}
.q-opt span{font-size:16.5px;line-height:1.4}
/* L'état choisi se voit à la bordure ET au fond : pas par la seule couleur. */
.q-opt:has(input:checked){border-color:var(--bleu);background:#EEF2FB;
  box-shadow:inset 4px 0 0 var(--bleu)}
.q-opt:has(input:focus-visible){outline:3px solid var(--rouge);outline-offset:1px}

/* ---------- échelle 0–10 ---------- */
.q-notes{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:0}
.q-note{
  display:flex;align-items:center;justify-content:center;position:relative;
  width:60px;height:52px;border:1.5px solid var(--filet);background:#fff;
  cursor:pointer;
}
.q-note input{position:absolute;opacity:0;width:100%;height:100%;margin:0;
  cursor:pointer}
.q-note span{font-family:var(--f-titre);font-size:19px;color:var(--encre)}
.q-note:hover{border-color:var(--bleu);background:var(--gris-fond)}
.q-note:has(input:checked){background:var(--bleu);border-color:var(--bleu)}
.q-note:has(input:checked) span{color:#fff}
.q-note:has(input:focus-visible){outline:3px solid var(--rouge);outline-offset:1px}

/* ---------- réponse libre ---------- */
.q-q textarea,.q-q input[type="text"]{
  width:100%;max-width:72ch;font-family:var(--f-texte);font-size:16.5px;
  padding:13px 14px;border:1.5px solid var(--filet-fort);background:#fff;
  color:var(--encre);line-height:1.5;resize:vertical;
}
.q-q textarea:focus,.q-q input[type="text"]:focus{
  border-color:var(--bleu);outline:3px solid rgba(10,31,77,.25);outline-offset:1px;
}

.q-cases{display:grid;gap:11px;max-width:72ch}
.q-case{display:grid;grid-template-columns:30px minmax(0,1fr);gap:11px;
  align-items:center}
.q-case-n{font-family:var(--f-titre);font-size:16px;color:var(--bleu);
  text-align:center}

/* ---------- grille (une ligne par situation) ---------- */
.q-grille-zone{overflow-x:auto;margin:0 0 10px;border:1px solid var(--filet);
  background:#fff}
.q-grille{border-collapse:collapse;width:100%;min-width:640px}
.q-grille caption{text-align:left}
.q-grille th,.q-grille td{padding:12px 10px;border-bottom:1px solid var(--filet);
  text-align:center;vertical-align:middle}
.q-grille thead th{font-family:var(--f-titre);font-size:12.5px;
  text-transform:uppercase;letter-spacing:.05em;color:var(--bleu);
  background:var(--gris-fond);font-weight:400;border-bottom:2px solid var(--bleu)}
.q-grille tbody th{text-align:left;font-size:16px;font-weight:600;
  color:var(--encre);min-width:200px;max-width:32ch}
.q-grille tr:last-child th,.q-grille tr:last-child td{border-bottom:0}
.q-grille tbody tr:hover{background:var(--gris-fond)}

.q-cellule{display:flex;align-items:center;justify-content:center;
  min-height:44px;cursor:pointer;position:relative}
.q-cellule input{position:absolute;opacity:0;width:100%;height:100%;margin:0;
  cursor:pointer}
/* La forme du bouton change avec l'état, pas seulement sa couleur :
   rond vide → rond plein avec coche. */
.q-visuel{width:26px;height:26px;border:2px solid var(--filet-fort);
  border-radius:50%;background:#fff;position:relative;transition:all .15s var(--ease)}
.q-cellule:hover .q-visuel{border-color:var(--bleu)}
.q-cellule input:checked + .q-visuel{background:var(--bleu);border-color:var(--bleu)}
.q-cellule input:checked + .q-visuel::after{
  content:"";position:absolute;left:8px;top:4px;width:6px;height:11px;
  border-right:2.5px solid #fff;border-bottom:2.5px solid #fff;
  transform:rotate(45deg)}
.q-cellule input:focus-visible + .q-visuel{outline:3px solid var(--rouge);
  outline-offset:2px}

/* ---------- choix des modules ---------- */
.q-profils{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(300px,1fr))}
.q-profil{
  display:grid;grid-template-columns:26px minmax(0,1fr);gap:13px;
  align-items:start;padding:16px;border:1.5px solid var(--filet);background:#fff;
  cursor:pointer;min-height:56px;
}
.q-profil:hover{border-color:var(--bleu);background:var(--gris-fond)}
.q-profil input{width:24px;height:24px;margin:2px 0 0;accent-color:var(--bleu);
  cursor:pointer}
.q-profil span{font-size:16.5px;line-height:1.42}
.q-profil:has(input:checked){border-color:var(--bleu);background:#EEF2FB;
  box-shadow:inset 4px 0 0 var(--bleu)}
.q-profil:has(input:focus-visible){outline:3px solid var(--rouge);outline-offset:1px}

.q-vide{border:1px dashed var(--filet-fort);background:var(--gris-fond);
  padding:24px 26px;margin-top:8px}
.q-vide p{margin:0;font-size:16.5px;color:var(--gris);max-width:64ch}
.q-vide p + p{margin-top:12px}
.q-vide a{font-weight:700}

/* ---------- un module ---------- */
.q-module{margin-top:44px;border-top:4px solid var(--bleu);padding-top:30px}
.q-module-tete{display:grid;grid-template-columns:auto minmax(0,1fr);gap:18px;
  align-items:start;margin-bottom:22px}
.q-module-code{
  font-family:var(--f-titre);font-size:30px;line-height:1;color:#fff;
  background:var(--bleu);width:56px;height:56px;display:flex;align-items:center;
  justify-content:center;flex:none;
}
.q-module-tete h3{font-size:clamp(21px,2.5vw,29px);max-width:26ch}
.q-module-tete .q-aide{margin-top:12px;margin-bottom:0}

/* ---------- actions ---------- */
.q-actions .q-btns{display:flex;gap:12px;flex-wrap:wrap;margin:26px 0 0}
.q-actions .q-btns .btn{min-height:48px}
.q-label{display:block;font-weight:700;font-size:15.5px;margin:30px 0 8px}
.q-recap{
  width:100%;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:14px;line-height:1.5;padding:16px;border:1.5px solid var(--filet-fort);
  background:#fff;color:var(--encre);resize:vertical;
}
/* Vert de confirmation, défini ici et non dans style.css : cette teinte ne
   sert qu'à cette page, et l'ajouter à la feuille partagée ferait peser un
   choix local sur tout le site. 5,9:1 sur le fond gris, 6,5:1 sur blanc. */
.page-questionnaire{--vert:#0F6B45}

/* Pas de style « merci » ici : la confirmation est rendue par repondre.php,
   dans une page autonome. Un style laissé pour un bloc supprimé est une
   invitation à le faire revenir. */

/* Bouton qui se présente comme un lien : il déclenche une action (fabriquer
   un fichier), il ne mène donc nulle part — un vrai <a> vers « # » aurait été
   une fausse promesse, et c'est ce que la recette signale. */
.q-lien-bouton{
  background:none;border:0;padding:0;margin:0;font:inherit;cursor:pointer;
  color:var(--bleu-vif);text-decoration:underline;text-decoration-thickness:2px;
  text-underline-offset:3px;text-decoration-color:rgba(20,52,156,.32);
}
.q-lien-bouton:hover{color:var(--rouge-texte);text-decoration-color:var(--rouge)}
.q-lien-bouton:focus-visible{outline:3px solid var(--rouge);outline-offset:2px}

.q-reperes{max-width:76ch}
.q-reperes h2{font-size:clamp(19px,2.1vw,23px);margin-bottom:14px}
.q-reperes p{font-size:15.5px;color:var(--gris);margin:0 0 14px}
.q-reperes a{font-size:15.5px}

/* Réservé aux lecteurs d'écran, mais réellement présent : il ne s'agit pas
   de masquer de l'information, seulement de l'annoncer sans l'afficher. */
.q-sr{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}

/* ---------- écrans étroits ----------
   Une grille à sept colonnes ne tient pas dans 390 px. Plutôt que de réduire
   les cibles sous le seuil tactile, on empile : chaque ligne de la grille
   devient un bloc, chaque option garde 44 px de hauteur. */
@media (max-width:760px){
  .q-jauge{top:0}
  .q-jauge .wrap{gap:10px}
  .q-tete{grid-template-columns:auto minmax(0,1fr);gap:14px}
  .q-num{width:44px;height:44px;font-size:22px}
  .q-module-code{width:48px;height:48px;font-size:26px}
  .q-opts,.q-opts--multi,.q-opts--sans,.q-profils{grid-template-columns:1fr}
  .q-notes{gap:6px}
  .q-note{width:calc(20% - 6px);min-width:56px;height:48px}
  .q-opt,.q-profil{padding:14px}

  /* La grille passe en bloc : plus de défilement horizontal. */
  .q-grille-zone{overflow-x:visible;border:0;background:none}
  .q-grille{min-width:0;display:block}
  .q-grille thead{display:none}
  .q-grille tbody,.q-grille tr,.q-grille th,.q-grille td{display:block;width:auto}
  .q-grille tbody tr{border:1px solid var(--filet);background:#fff;
    margin-bottom:14px;padding:4px 0 10px}
  .q-grille tbody tr:hover{background:#fff}
  .q-grille tbody th{background:var(--gris-fond);border-bottom:1px solid var(--filet);
    padding:12px 14px;max-width:none;min-width:0}
  .q-grille td{padding:0;border-bottom:0;text-align:left}
  .q-cellule{justify-content:flex-start;gap:12px;padding:11px 14px;
    min-height:48px;position:relative}
  .q-cellule::after{
    content:attr(title);font-size:16px;color:var(--encre);
  }
  .q-visuel{flex:none;order:-1}
}

@media (max-width:520px){
  .q-encadre{padding:20px 18px 18px}
  .q-q{padding-top:24px}
  .q-intitule{font-size:17.5px}
  .q-note{width:calc(25% - 6px)}
}

/* ---------- impression ----------
   Une version imprimée doit rester utilisable seule : toutes les questions
   et tous les choix, y compris ceux que le JavaScript n'affiche pas. */
@media print{
  .maquette-bar,.site-head,.site-foot,.q-jauge,.q-actions .q-btns,
  #q-recap-zone,.q-vide,.evitement{display:none!important}
  body{font-size:11pt;background:#fff}
  .wrap{max-width:none;padding:0}
  .section,.section--serre{padding:10pt 0}
  .rub-head{background:#fff;color:#000;border-bottom:2pt solid #000;padding:0 0 8pt}
  .rub-head h1,.rub-head .diag,.rub-head .etiquette{color:#000}
  .q-tete h2::after,.q-module{border-color:#000}
  .q-module{border-top-width:1.5pt}
  .q-q{break-inside:avoid;page-break-inside:avoid}
  .q-encadre{border:1pt solid #000;border-left-width:3pt}
  .q-num,.q-module-code{background:#000}
  .q-grille{min-width:0}
  .q-opts,.q-opts--multi,.q-profils{grid-template-columns:1fr 1fr}
  a{text-decoration:none;color:#000}
}
/* ---------- page autonome ----------
   Le questionnaire vit sur sa propre adresse. Son en-tête ne porte donc pas
   de menu : les liens du site mèneraient à des pages qui n'existent pas là où
   il est publié. La marque reste, mais sans lien. */
.site-head--simple .wrap{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.brand--statique{display:inline-flex;align-items:center;color:var(--encre)}
.brand-suite{font-size:14.5px;letter-spacing:.02em;opacity:.72;
  border-left:1px solid currentColor;padding-left:16px}
.site-foot--simple .wrap{display:block}
.site-foot--simple .bas{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}

/* ---------- consentement et envoi ---------- */
.q-envoi{scroll-margin-top:24px}
.q-opt--consent{align-items:flex-start;gap:12px;padding:14px 0;
  border-top:1px solid var(--filet)}
.q-opt--consent input{margin-top:3px;flex:none;width:20px;height:20px}
.q-opt--consent span{line-height:1.5}
.q-coord{margin-top:22px;padding-top:18px;border-top:1px solid var(--filet)}
.q-h3{font-size:15px;text-transform:uppercase;letter-spacing:.09em;
  margin:0 0 6px;color:var(--encre)}
.q-coord-champs{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:14px}
.q-champ{display:flex;flex-direction:column;gap:6px}
.q-champ span{font-size:13px;letter-spacing:.04em;text-transform:uppercase;
  color:var(--gris)}
.q-champ input{padding:10px 12px;border:1px solid var(--filet);
  background:#fff;font:inherit;font-size:16px;color:var(--encre)}
.q-envoi-etat{margin:16px 0 0;font-weight:600;min-height:1.4em}
.q-envoi-etat--erreur{color:var(--rouge-texte)}
.q-envoi .q-btns{margin-top:18px}
.q-piege{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.q-reperes{max-width:74ch}
.q-reperes summary{cursor:pointer;font-weight:600;padding:6px 0}
.q-reperes[open] summary{margin-bottom:8px}

@media (max-width:760px){
  .q-coord-champs{grid-template-columns:1fr}
  .brand-suite{border-left:0;padding-left:0}
}
@media print{
  .q-envoi,.q-piege,.q-reperes{display:none!important}
}
