@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --navy: #1B3A5C;
  --ink: #25344A;
  --blue: #3AA6D6;
  --blue-pastel: #E7F4FB;
  --orange: #F2994A;
  --orange-form: #D97720;
  --orange-pastel: #FDECDC;
  --vert: #A7D63A;
  --muted: #8593A3;
  --line: #E7ECF1;
  --erreur: #D64545;
  --erreur-pastel: #FCEAEA;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 650px at 5% 0%, #D5EFFB 0%, rgba(213, 239, 251, .65) 35%, rgba(213, 239, 251, 0) 70%),
    radial-gradient(1000px 650px at 100% 100%, #FADCC0 0%, rgba(250, 220, 192, .65) 35%, rgba(250, 220, 192, 0) 70%),
    #F2F5F8;
  background-attachment: fixed;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
}

.conteneur {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* =========================================================
   EN-TETE ET PIED DE PAGE
   ========================================================= */
.entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.logos {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logos img {
  height: 46px;
  width: auto;
}

.separateur-logos {
  display: none;
}

.thanks {
  text-align: center;
  font-style: italic;
  margin-top: 2rem;
}

h1 {
  margin: 18px 0 4px;
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.5rem;
  color: var(--navy);
}

.sous-titre {
  margin-bottom: 14px;
  color: var(--ink);
  font-size: .9rem;
}

.sous-titre-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  background: #FFF8EE;
  border: 1px solid #F7D8B8;
  border-radius: 14px;
  line-height: 1.4;
}

.sous-titre-icone {
  flex: 0 0 auto;
  color: var(--orange-form);
  font-size: 2rem;
  line-height: 1.25;
}


/* Navigation flottante : reste visible hors du questionnaire pendant le défilement. */
.navigation-flottante {
  position: fixed;
  right: max(14px, calc((100vw - 760px) / 2 - 58px));
  top: 50%;
  z-index: 50;
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--navy);
  box-shadow: 0 7px 20px rgba(27, 58, 92, .16);
  text-decoration: none;
  transform: translateY(-50%);
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}

.navigation-flottante:hover,
.navigation-flottante:focus-visible {
  background: var(--orange-pastel);
  border-color: var(--orange);
  color: var(--orange-form);
  outline: none;
  transform: translateY(-50%) scale(1.08);
}

.navigation-flottante-fleche {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1;
}

.navigation-flottante.vers-haut {
  background: var(--blue-pastel);
  border-color: #CFE7F3;
}


/* =========================================================
   PROGRESSION
   ========================================================= */
.progression {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 20px 18px 14px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 6px 18px rgba(27, 58, 92, .06);
}

.etape {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.etape .bulle {
  position: relative;
  z-index: 1;
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: #E9EDF1;
  border-radius: 50%;
  font-size: 1.15rem;
  transition: transform .2s, background .2s;
}

.etape.actif .bulle {
  background: var(--blue);
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(58, 166, 214, .4);
}

.etape.atteinte .bulle {
  background: var(--vert);
}

.etape .libelle {
  max-width: 80px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
}

.etape.actif .libelle {
  color: var(--navy);
  font-weight: 700;
}

.etape:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 22px;
  left: 60%;
  z-index: 0;
  width: 80%;
  height: 3px;
  background: var(--line);
}

.etape.liaison-atteinte:not(:last-child)::after {
  background: var(--vert);
}

/* Navigation par les pastilles déjà atteintes */
a.etape {
  cursor: pointer;
}

a.etape:hover .bulle {
  transform: scale(1.06);
}

a.etape:hover .libelle {
  color: var(--navy);
}

.barre-progression {
  height: 8px;
  margin: 14px 0 30px;
  overflow: hidden;
  background: #E4E9EF;
  border-radius: 10px;
}

.barre-progression .remplissage {
  height: 100%;
  background: linear-gradient(90deg, var(--vert), var(--blue));
  border-radius: 10px;
  transition: width .3s;
}

.progression-partie-1 {
  width: 25%;
}

.progression-partie-2 {
  width: 50%;
}

.progression-partie-3 {
  width: 75%;
}

.progression-partie-4 {
  width: 100%;
}

/* =========================================================
   BLOCS ET QUESTIONS
   ========================================================= */
.bloc-questions {
  margin-bottom: 22px;
  padding: 26px 24px;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 8px 24px rgba(27, 58, 92, .06);
}

.etiquette-bloc {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 5px 14px;
  background: var(--blue-pastel);
  border-radius: 20px;
  color: var(--blue);
  font-family: 'Baloo 2', sans-serif;
  font-size: .8rem;
  font-weight: 600;
}

.question {
  margin-bottom: 26px;
}

.question:last-child {
  margin-bottom: 0;
}

.question.masquee,
.masquee {
  display: none !important;
}

.enonce-question {
  display: flex;
  align-items: flex-start;
  text-align: justify;
  color: var(--navy);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.numero-question {
  display: inline-flex;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  background: var(--orange);
  border-radius: 50%;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
}

.aide-question {
  margin: 4px 0 14px 34px;
  color: var(--muted);
  font-size: .82rem;
}

.note-question {
  margin: 10px 0 14px 34px;
  padding: 12px 14px;
  background: var(--blue-pastel);
  border-radius: 12px;
  color: var(--ink);
  font-size: .84rem;
  line-height: 1.45;
}

/* =========================================================
   OPTIONS GENERIQUES
   ========================================================= */
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-left: 34px;
}

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  font-size: .92rem;
  transition: .15s;
}

.option:hover {
  background: var(--orange-pastel);
  border-color: var(--orange);
}

.option input {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: var(--orange-form);
}

.option.coche {
  background: var(--orange-pastel);
  border-color: #F8CCA4;
}

/* Matrices */
.matrice-question {
  margin-top: 14px;
}

.sous-question {
  margin-left: 34px;
  margin-bottom: 16px;
}

.sous-question:last-child {
  margin-bottom: 0;
}

.libelle-sous-question {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 500;
}

.sous-question .options {
  margin-left: 0;
  flex-direction: row;
  flex-wrap: wrap;
}

.sous-question .option {
  flex: 1;
  min-width: 110px;
  justify-content: center;
  text-align: center;
}

.options-echelle .option {
  min-width: 125px;
}


/* Q2, Q9 et Q18 : seuls les boutons de réponse sont mis en retrait.
   Les libellés des affirmations gardent leur alignement normal. */
.reponses-retrait .matrice-question {
  margin-left: 0;
  margin-right: 0;
}

.reponses-retrait .sous-question {
  margin-left: 34px;
}

.reponses-retrait .sous-question .options {
  margin-left: 24px;
  margin-right: 24px;
}

/* Questions simples ou matrices à réponses courtes côte à côte */
.question.reponses-en-ligne>.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: calc(100% - 34px);
  margin-left: 34px;
}

.question.reponses-en-ligne>.options .option,
.question.reponses-en-ligne .sous-question .option {
  width: 100%;
  min-width: 0;
  justify-content: center;
  padding: 9px 14px;
  text-align: center;
}

.question.reponses-en-ligne .sous-question .options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Question conditionnelle de la partie I */
.conditionnelle {
  margin-top: 10px;
  margin-left: 34px;
  padding: 14px 16px;
  background: #F5F8FA;
  border-left: 4px solid var(--blue);
  border-radius: 14px;
}

.conditionnelle .enonce-question {
  font-size: .9rem;
}

.conditionnelle .options {
  margin-top: 10px;
  margin-left: 0;
  flex-direction: row;
}

.conditionnelle .option {
  flex: 1;
  justify-content: center;
}

/* Champs texte / listes */
select.champ-liste,
textarea.champ-texte {
  width: calc(100% - 34px);
  margin-left: 34px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: .92rem;
}

select.champ-liste {
  background: #fff;
}

textarea.champ-texte {
  min-height: 90px;
  resize: vertical;
}

select.champ-liste:focus,
textarea.champ-texte:focus {
  outline: none;
  border-color: var(--orange);
}

/* Info-bulle / note contextuelle */
.note-tooltip {
  position: relative;
  display: inline-block;
  margin: 8px 0 12px 34px;
}

.note-tooltip-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--blue-pastel);
  border: 1px solid #CFE7F3;
  border-radius: 999px;
  color: var(--navy);
  font-family: 'Inter', sans-serif;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}

.note-tooltip-trigger:hover,
.note-tooltip-trigger:focus-visible {
  border-color: var(--blue);
  outline: none;
}

.note-tooltip-bulle {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  display: none;
  width: min(520px, calc(100vw - 64px));
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(27, 58, 92, .16);
  color: var(--ink);
  font-size: .82rem;
  line-height: 1.45;
}

.note-tooltip:hover .note-tooltip-bulle,
.note-tooltip:focus-within .note-tooltip-bulle,
.note-tooltip.ouverte .note-tooltip-bulle {
  display: block;
}

/* Info-bulle attachée directement à un item de matrice (Q10). */
.note-item-tooltip {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  margin-left: 5px;
  cursor: help;
  outline: none;
}

.note-item-tooltip-icone {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--blue);
  font-size: .9rem;
  font-weight: 700;
}

.note-item-tooltip-bulle {
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: calc(100% + 9px);
  display: none;
  width: 360px;
  max-width: calc(100vw - 70px);
  padding: 11px 13px;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(27, 58, 92, .16);
  color: var(--ink);
  font-size: .8rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
}

.note-item-tooltip:hover .note-item-tooltip-bulle,
.note-item-tooltip:focus .note-item-tooltip-bulle,
.note-item-tooltip:focus-within .note-item-tooltip-bulle {
  display: block;
}

.note-mobile-apres {
  display: none;
}

/* =========================================================
   NAVIGATION BAS DE PAGE
   ========================================================= */
.boutons-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.groupe-boutons-droite {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.bouton {
  padding: 13px 26px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-family: 'Baloo 2', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  transition: .15s;
}

.bouton-primaire {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 6px 14px rgba(27, 58, 92, .25);
}

.bouton-primaire:hover {
  background: #132B45;
}

.bouton-secondaire {
  background: #fff;
  border: 2px solid var(--line);
  color: var(--navy);
}

.bouton-secondaire:hover {
  background: var(--blue-pastel);
  border-color: var(--blue);
}

.bouton-tertiaire {
  background: #fff;
  border: 2px solid var(--blue);
  color: var(--navy);
}

.bouton-tertiaire:hover {
  background: var(--blue-pastel);
  border-color: var(--blue);
}

.bouton-fantome {
  background: transparent;
  color: var(--muted);
}

.message-succes {
  margin-bottom: 20px;
  padding: 14px 18px;
  background: #EAF7EF;
  border-radius: 14px;
  color: #287A48;
  font-size: .9rem;
  font-weight: 500;
}

.bloc-fin {
  padding: 42px 28px;
  text-align: center;
}

.bloc-fin h2 {
  margin: 8px 0;
  color: var(--navy);
  font-family: 'Baloo 2', sans-serif;
}

.bloc-fin p {
  color: var(--muted);
}

/* =========================================================
   PARTIE I
   ========================================================= */

/* S1 : sous-question Médecine générale */
.conditionnelle-dans-options {
  margin: 0 0 2px 18px;
  padding: 12px 14px;
  background: #F5FAFD;
  border-left: 3px solid var(--blue);
  border-radius: 0 0 14px 14px;
}

.conditionnelle-dans-options .libelle-conditionnelle {
  color: var(--navy);
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.4;
}

.options-compactes {
  flex-direction: row !important;
  gap: 8px !important;
  margin: 9px 0 0 !important;
}

.options-compactes .option {
  flex: 0 0 auto;
  min-width: 84px;
  justify-content: center;
  padding: 8px 14px;
}

/* S2 : semestres */
.pastilles-semestres {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 7px;
  margin: 12px 0 0 34px;
}

.pastille-semestre {
  position: relative;
  cursor: pointer;
}

.pastille-semestre input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pastille-semestre span {
  display: flex;
  min-width: 34px;
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 50%;
  color: var(--navy);
  font-size: .86rem;
  font-weight: 700;
  transition: .15s;
}

.pastille-semestre:hover span {
  background: var(--orange-pastel);
  border-color: var(--orange);
}

.pastille-semestre.coche span,
.pastille-semestre input:checked+span {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  box-shadow: 0 3px 8px rgba(242, 153, 74, .24);
}

.pastille-semestre input:focus-visible+span {
  outline: 3px solid rgba(58, 166, 214, .25);
  outline-offset: 2px;
}

/* S4 / S5 */
.sous-question-carte {
  margin: 14px 0 16px 34px;
  padding: 14px 16px 15px;
  background: #F8FAFC;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 14px;
}

.sous-question-carte .libelle-sous-question {
  margin: 0 0 11px;
  color: var(--navy);
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.45;
}

.sous-question-carte .options {
  gap: 8px;
}

.sous-question-carte .option {
  min-height: 44px;
  padding: 9px 11px;
  font-size: .84rem;
}

/* F1 */
.tableau-f1 {
  margin: 14px 0 0 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.tableau-f1-entete,
.tableau-f1-ligne {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) 150px 150px;
  align-items: stretch;
}

.tableau-f1-entete {
  background: var(--navy);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.25;
}

.tableau-f1-entete>div {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 9px;
  text-align: center;
}

.tableau-f1-entete>div:first-child {
  justify-content: flex-start;
  text-align: left;
}

.tableau-f1-ligne {
  background: #fff;
  border-top: 1px solid var(--line);
}

.tableau-f1-libelle {
  display: flex;
  min-height: 50px;
  align-items: center;
  padding: 10px 12px;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 500;
  line-height: 1.35;
}

.case-f1 {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--line);
  cursor: pointer;
  transition: .15s;
}

.case-f1:hover {
  background: var(--orange-pastel);
}

.case-f1 input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.case-f1-visuelle {
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid #C9D2DC;
  border-radius: 8px;
  color: transparent;
  font-size: 1rem;
  font-weight: 700;
  transition: .15s;
}

.case-f1.coche .case-f1-visuelle,
.case-f1 input:checked+.case-f1-visuelle {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.case-f1 input:focus-visible+.case-f1-visuelle {
  outline: 3px solid rgba(58, 166, 214, .25);
  outline-offset: 2px;
}

.case-f1-mobile {
  display: none;
}

/* =========================================================
   MINI-ECHELLES LIKERT
   ========================================================= */
.legende-mini-likert {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 12px 34px;
}

.legende-mini-likert-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.25;
  text-align: center;
}

.legende-mini-likert-numero {
  display: flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  background: #EDF2F7;
  border-radius: 50%;
  color: var(--navy);
  font-size: .73rem;
  font-weight: 700;
}

.options-mini-likert {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.option-mini-likert {
  min-width: 0 !important;
  justify-content: center !important;
  padding: 8px 6px !important;
  text-align: center;
}

.option-mini-likert input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mini-likert-badge {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 50%;
  color: var(--navy);
  font-weight: 700;
  transition: .15s;
}

.option-mini-likert:hover .mini-likert-badge {
  background: var(--orange-pastel);
  border-color: var(--orange);
}

.option-mini-likert.coche .mini-likert-badge,
.option-mini-likert input:checked+.mini-likert-badge {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  box-shadow: 0 4px 10px rgba(242, 153, 74, .22);
}

.mini-likert-texte-mobile {
  display: none;
}

.matrice-mini-likert .sous-question {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 360px);
  gap: 16px;
  align-items: center;
}

.matrice-mini-likert .libelle-sous-question {
  margin: 0;
}

.matrice-mini-likert .options {
  margin-left: 0;
}

/* =========================================================
   QUESTIONS COMPACTES SPECIFIQUES
   ========================================================= */

/* Q7 : item à gauche, Oui/Non à droite sur grand écran */
.question[data-question-code="Q7"] .sous-question {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 18px;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.question[data-question-code="Q7"] .sous-question:last-child {
  border-bottom: 0;
}

.question[data-question-code="Q7"] .libelle-sous-question {
  margin: 0;
  font-size: .9rem;
  line-height: 1.35;
}

.question[data-question-code="Q7"] .options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}

.question[data-question-code="Q7"] .option {
  min-width: 0;
  justify-content: center;
  padding: 8px 10px;
  font-size: .82rem;
  text-align: center;
}

/* Q27 : item à gauche, Groupe 2 / Groupe 3 / NSP à droite */
.question[data-question-code="Q25"] .sous-question {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 18px;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.question[data-question-code="Q25"] .sous-question:last-child {
  border-bottom: 0;
}

.question[data-question-code="Q25"] .libelle-sous-question {
  margin: 0;
  font-size: .9rem;
  line-height: 1.35;
}

.question[data-question-code="Q25"] .options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}

.question[data-question-code="Q25"] .option {
  min-width: 0;
  justify-content: center;
  padding: 8px 7px;
  font-size: .78rem;
  text-align: center;
}

/* Page Merci */
.message-incomplet {
  margin: 20px 0;
  padding: 16px 18px;
  background: #FFF8EE;
  border: 1px solid #F7D8B8;
  border-radius: 14px;
  color: var(--ink);
  text-align: left;
  line-height: 1.45;
}

.message-incomplet strong {
  color: var(--navy);
}

.message-incomplet p {
  margin: 7px 0 0;
  color: var(--ink);
}

.bouton-retour-questionnaire {
  display: inline-block;
  text-decoration: none;
}

.actions-fin-questionnaire {
  margin-top: 22px;
}

.bouton-corrections {
  display: inline-block;
  text-decoration: none;
  border-color: var(--orange-form);
}

/* =========================================================
   RESPONSIVE <= 900 PX
   ========================================================= */
@media (max-width:900px) {
  .options-echelle {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .options-echelle .option {
    min-width: 0;
  }

  .matrice-mini-likert .sous-question {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Q27 passe en deux lignes avant le téléphone pour éviter l'écrasement. */
  .question[data-question-code="Q25"] .sous-question {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* =========================================================
   RESPONSIVE <= 700 PX
   ========================================================= */
@media (max-width:700px) {

  /* Partie I */
  .pastilles-semestres {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .tableau-f1 {
    overflow: visible;
    border: 0;
  }

  .tableau-f1-entete {
    display: none;
  }

  .tableau-f1-ligne {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .tableau-f1-libelle {
    grid-column: 1 / -1;
    min-height: 0;
    padding: 10px 12px;
    background: #F8FAFC;
    color: var(--navy);
    font-weight: 600;
  }

  .case-f1 {
    min-height: 48px;
    gap: 7px;
    padding: 8px;
    border-top: 1px solid var(--line);
  }

  .case-f1:first-of-type {
    border-left: 0;
  }

  .case-f1-mobile {
    display: block;
    color: var(--ink);
    font-size: .72rem;
    line-height: 1.2;
  }

  /* Likert : la légende globale est redondante sur téléphone. */
  .legende-mini-likert {
    display: none;
  }

  .options-mini-likert {
    grid-template-columns: 1fr;
  }

  .option-mini-likert {
    justify-content: flex-start !important;
    align-items: center;
    gap: 10px;
    padding: 10px 12px !important;
    text-align: left;
  }

  .mini-likert-texte-mobile {
    display: block;
    flex: 1;
    min-width: 0;
    color: var(--ink);
    font-size: .84rem;
    line-height: 1.3;
    text-align: left;
  }
}

/* =========================================================
   RESPONSIVE <= 600 PX
   ========================================================= */
@media (max-width:600px) {
  .etape .libelle {
    display: none;
  }

  .reponses-retrait .sous-question .options {
    margin-left: 10px;
    margin-right: 10px;
  }

  .note-tooltip {
    display: block;
    margin-left: 34px;
  }

  .note-tooltip-bulle {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
  }

  /* Q10 : sur mobile, pas de survol. La définition est affichée sous les réponses. */
  .note-item-tooltip {
    display: none;
  }

  .note-mobile-apres {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0 0 34px;
    padding: 11px 13px;
    background: var(--blue-pastel);
    border-radius: 12px;
    color: var(--ink);
    font-size: .82rem;
    line-height: 1.45;
  }

  .note-mobile-apres-icone {
    flex: 0 0 auto;
    color: var(--blue);
    font-size: 1rem;
    font-weight: 700;
  }

  .boutons-navigation {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .bouton {
    width: 100%;
  }

  .groupe-boutons-droite {
    flex-direction: column;
    width: 100%;
  }

  /* Matrices standard : réponses empilées sur petit écran. */
  .sous-question .options {
    flex-direction: column;
  }

  .options-echelle {
    grid-template-columns: 1fr;
  }

  /* Les questions marquées reponses-en-ligne gardent 2 colonnes. */
  .question.reponses-en-ligne>.options,
  .question.reponses-en-ligne .sous-question .options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .question.reponses-en-ligne .option {
    min-width: 0;
    align-items: center;
    justify-content: center;
  }

  /* Si un libellé standard passe sur plusieurs lignes,
     le contrôle reste aligné sur sa première ligne. */
  .option:not(.option-mini-likert) {
    align-items: flex-start;
  }

  .option:not(.option-mini-likert)>input[type="radio"],
  .option:not(.option-mini-likert)>input[type="checkbox"] {
    margin-top: 2px;
  }

  .options-compactes .option {
    align-items: center;
  }

  /* Q7 : item sur toute la largeur, puis Oui/Non côte à côte. */
  .question[data-question-code="Q7"] .sous-question {
    display: block;
    padding: 10px 0 12px;
  }

  .question[data-question-code="Q7"] .libelle-sous-question {
    margin-bottom: 8px;
  }

  .question[data-question-code="Q7"] .options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .question[data-question-code="Q7"] .option {
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  /* Q27 : item au-dessus, 3 réponses côte à côte. */
  .question[data-question-code="Q25"] .sous-question {
    display: block;
    padding: 10px 0 12px;
  }

  .question[data-question-code="Q25"] .libelle-sous-question {
    margin-bottom: 8px;
  }

  .question[data-question-code="Q25"] .options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .question[data-question-code="Q25"] .option {
    min-width: 0;
    align-items: center;
    justify-content: center;
    padding: 8px 5px;
    text-align: center;
  }
}

/* =========================================================
   RESPONSIVE <= 480 PX
   ========================================================= */
@media (max-width:480px) {
  .pastilles-semestres {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sous-question-carte,
  .tableau-f1 {
    margin-left: 0;
  }

  .conditionnelle-dans-options {
    margin-left: 10px;
  }
}

@media (max-width:600px) {

  .navigation-flottante {
    right: 10px;
    top: auto;
    bottom: 18px;
    width: 42px;
    height: 42px;
    transform: none;
  }

  .navigation-flottante:hover,
  .navigation-flottante:focus-visible {
    transform: scale(1.05);
  }
}


/* =========================================================
   CODE DE REPRISE
   ========================================================= */
.encart-code-reprise {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 14px;
  align-items: center;
  margin: 0 0 18px;
  padding: 12px 14px;
  background: #F6FAFD;
  border: 1px solid #D7EAF4;
  border-radius: 14px;
}

.encart-code-reprise-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.encart-code-reprise-label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
}

.encart-code-reprise-code {
  color: var(--navy);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.08rem;
  letter-spacing: .08em;
}

.encart-code-reprise p {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.35;
}

.bouton-copier-code {
  padding: 7px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--navy);
  cursor: pointer;
  font: 600 .78rem 'Inter', sans-serif;
  white-space: nowrap;
}

.bouton-copier-code:hover {
  border-color: var(--blue);
  background: var(--blue-pastel);
}

.bloc-reprise h2 {
  margin: 4px 0 8px;
  color: var(--navy);
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.25rem;
}

.texte-reprise {
  margin: 0 0 18px;
  color: var(--ink);
  font-size: .9rem;
  line-height: 1.5;
}

.formulaire-reprise label {
  display: block;
  margin-bottom: 6px;
  color: var(--navy);
  font-size: .84rem;
  font-weight: 600;
}

.ligne-code-reprise {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.ligne-code-reprise input {
  min-width: 0;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  color: var(--navy);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ligne-code-reprise input:focus {
  outline: none;
  border-color: var(--blue);
}

.aide-code-reprise {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .74rem;
}

.message-alerte-reprise {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: var(--erreur-pastel);
  border-radius: 10px;
  color: var(--erreur);
  font-size: .84rem;
}

.separateur-reprise {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  color: var(--muted);
  font-size: .78rem;
}

.separateur-reprise::before,
.separateur-reprise::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.bouton-nouveau-questionnaire {
  width: 100%;
}

@media (max-width:600px) {
  .ligne-code-reprise {
    grid-template-columns: 1fr;
  }

  .ligne-code-reprise .bouton {
    width: 100%;
  }

  .encart-code-reprise {
    grid-template-columns: 1fr auto;
  }
}

/*----------------------------*/
/* Page debrief explicative */
/*----------------------------*/
.bloc-corrections {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto
}

.intro-corrections {
  margin-bottom: 24px
}

.theme-corrections {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden
}

.theme-corrections>summary {
  cursor: pointer;
  list-style: none;
  padding: 17px 20px;
  font-weight: 700;
  color: var(--navy);
  background: var(--blue-pastel)
}

.theme-corrections>summary::-webkit-details-marker,
.carte-correction>summary::-webkit-details-marker {
  display: none
}

.theme-corrections>summary::after {
  content: "+";
  float: right;
  font-size: 1.35rem
}

.theme-corrections[open]>summary::after {
  content: "−"
}

.theme-corrections-contenu {
  padding: 12px
}

.carte-correction {
  margin: 10px 0;
  border: 2px solid var(--line);
  border-radius: 13px;
  overflow: hidden
}

.carte-correction>summary {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  padding: 15px 16px
}

.numero-correction {
  flex: 0 0 auto;
  min-width: 42px;
  padding: 5px 8px;
  border-radius: 999px;
  text-align: center;
  font-weight: 700;
  color: var(--navy);
  background: var(--blue-pastel)
}

.titre-correction {
  flex: 1;
  font-weight: 650;
  color: var(--blue)
}

.contenu-correction {
  padding: 0 16px 18px;
  text-align: justify
}

.encart-reponse,
.encart-pratique,
.explication-correction,
.a-retenir {
  margin-top: 14px;
  padding: 15px 17px;
  border-radius: 12px
}

.encart-reponse {
  background: var(--green-pastel)
}

.encart-pratique {
  background: var(--blue-pastel)
}

.explication-correction {
  background: #fafafa;
  border: 1px solid var(--line)
}

.explication-correction p:last-child {
  margin-bottom: 0;
}

.explication-correction h3,
.a-retenir h3 {
  margin-top: 0;
  margin-bottom: 9px;
  font-size: 1rem;
  color: var(--navy)
}

.a-retenir {
  background: var(--orange-pastel)
}

.liste-propositions {
  margin: 12px 0 0;
  padding: 0;
  list-style: none
}

.liste-propositions li {
  margin: 7px 0;
  padding: 8px 10px;
  border-radius: 9px
}

.reponse-correcte {
  font-weight: 700;
  background: rgba(140, 197, 66, .18)
}

.reponse-incorrecte {
  background: rgba(133, 147, 163, .10)
}

.reponse-correcte span,
.reponse-incorrecte span {
  display: inline-block;
  width: 24px;
  font-weight: 700
}

.liste-items-correction {
  margin-top: 12px
}

.item-correction {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, .08)
}

.item-correction:last-child {
  border-bottom: 0
}

.item-correction strong {
  flex: 0 0 auto;
  color: var(--navy)
}

.a-retenir ul {
  margin-bottom: 0
}

.actions-corrections {
  margin-top: 24px;
}

/*.actions-fin-questionnaire {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px
}*/

@media(max-width:700px) {
  .theme-corrections>summary {
    padding: 14px 15px
  }

  .carte-correction>summary {
    padding: 13px
  }

  .contenu-correction {
    padding: 0 13px 15px;
    text-align: left
  }

  .explication-correction {  /* allège sur mobile les cadres et diminue la police du bloc pourquoi ? */
    padding: 12px 10px;
    border-left: 2px solid var(--blue);
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
    background: #fafafa;
    font-size: .88rem;
    line-height: 1.5;
  }

  .item-correction {
    display: block
  }

  .item-correction strong {
    display: inline-block;
    margin-top: 5px
  }

  .a-retenir ul {
    /*pour enlever le retrait des puces sur mobile*/
    padding-left: 14px;
  }

  .actions-fin-questionnaire {
    flex-direction: column
  }

  .actions-fin-questionnaire .bouton {
    width: 100%;
    text-align: center
  }
}