/* ==========================================================================
   Famille « test » : /test-de-niveau/ (maquette 02 validée le 26/11/2026) et mini-test.
   Planches : validees/02-test-de-niveau/ (Main, Question, Resultat, Mobile, Mobile-question,
   Mobile-resultat). Variables du socle (maquettes.css) ; point de rupture 768px.
   ========================================================================== */

/* ---------- Haut de page : fil d'Ariane + héros (texte à gauche, outil à droite) ---------- */
.tfm-test-haut { padding: 22px 0 var(--tf-section); }
.tfm-test-heros {
  margin-top: 40px !important;
  display: grid; grid-template-columns: minmax(0, 1fr) 536px; grid-template-rows: 1fr 1fr;
  grid-template-areas: "intro outil" "confiance outil";
  column-gap: 64px; row-gap: 32px; align-items: center;
}
.tfm-test-heros:not(:has(.tfm-test-outil)) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "confiance"; grid-template-rows: auto auto; }
.tfm-test-intro { grid-area: intro; align-self: end; display: flex; flex-direction: column; gap: 10px; }
.tfm-test-intro h1 { margin-bottom: 22px; }
.tfm .tfm-test-vert { background: none; color: var(--tf-emeraude); white-space: nowrap; }
.tfm .tfm-test-bref { max-width: 560px; font-size: 22px; line-height: 33px; font-weight: 500; color: var(--tf-encre); margin-top: 0; }
.tfm .tfm-test-confiance { grid-area: confiance; align-self: start; max-width: 520px; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--tf-encre-secondaire); }

/* ---------- Zone de l'outil (carte émeraude pâle) ---------- */
.tfm-test-outil { grid-area: outil; background: var(--tf-emeraude-pale); border-radius: 24px; padding: 44px; }
.tfm-test-outil[hidden] { display: none; }
.tfm-test-depart { display: flex; flex-direction: column; gap: 28px; }
.tfm-test-depart[hidden] { display: none; }
.tfm .tfm-test-depart-titre { margin-top: -12px; font-size: 36px; line-height: 40px; }

.tfm .tfm-test-atouts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.tfm .tfm-test-atouts li {
  position: relative; min-height: 40px; padding-left: 56px;
  font-size: 17px; line-height: 24px; font-weight: 500; color: var(--tf-encre-secondaire);
}
.tfm .tfm-test-atouts li strong { display: block; font-size: 20px; line-height: 26px; font-weight: 800; color: var(--tf-marine); margin-bottom: 2px; }
.tfm .tfm-test-atouts li::before {
  content: ""; position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: var(--tf-rayon-pilule);
  background: var(--tf-emeraude) no-repeat center / 20px 20px;
}
.tfm .tfm-test-atouts li:nth-child(1)::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6h11M9 12h11M9 18h11M4 6h.01M4 12h.01M4 18h.01'/%3E%3C/svg%3E"); }
.tfm .tfm-test-atouts li:nth-child(2)::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='13' r='8'/%3E%3Cpath d='M12 9v4l2.5 2M10 2h4'/%3E%3C/svg%3E"); }
.tfm .tfm-test-atouts li:nth-child(3)::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }

.tfm-test-lancer { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.tfm-test-mobile { display: none; }
.tfm .tfm-test-lancer-note { font-size: 16px; line-height: 22px; font-weight: 600; color: var(--tf-encre-secondaire); }

/* Commandes de l'outil (pas des appels à l'action) */
.tfm-test-commencer, .tfm-test-suivant {
  display: inline-flex; align-items: center; gap: 12px; border: none; border-radius: var(--tf-rayon-pilule);
  font-family: var(--tf-police); font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; cursor: pointer; white-space: nowrap;
}
.tfm-test-commencer { min-height: 60px; padding: 0 34px; background: var(--tf-emeraude-fonce); color: #FFFFFF; font-size: 19px; }
.tfm-test-commencer:hover { background: var(--tf-marine); }
.tfm-test-suivant { min-height: 56px; padding: 0 30px; background: var(--tf-marine); color: #FFFFFF; font-size: 18px; }
.tfm-test-suivant:hover { background: var(--tf-emeraude-fonce); }
.tfm-test-commencer:focus-visible, .tfm-test-suivant:focus-visible, .tfm-test-refaire:focus-visible { outline: 3px solid var(--tf-marine); outline-offset: 3px; }
.tfm-test-suivant [hidden] { display: none; }

/* ---------- Écran Question ---------- */
.tfm-test-question { margin: 0; display: flex; flex-direction: column; gap: 26px; }
.tfm-test-entete { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tfm .tfm-test-compteur { font-size: 18px; line-height: 24px; font-weight: 800; color: var(--tf-marine); }
.tfm-test-compteur:focus { outline: none; }
.tfm .tfm-test-competence { background: var(--tf-fond); color: var(--tf-emeraude-fonce); border-radius: var(--tf-rayon-pilule); padding: 6px 14px; font-size: 14px; line-height: 18px; font-weight: 800; margin: 0; }
.tfm-test-competence[hidden] { display: none; }
.tfm-test-progression { height: 10px; border-radius: var(--tf-rayon-pilule); background: var(--tf-fond); overflow: hidden; margin-top: -14px; }
.tfm-test-barre { width: 0; height: 100%; border-radius: var(--tf-rayon-pilule); background: var(--tf-emeraude); transition: width .2s ease; }
.tfm-test-texte { background: var(--tf-fond); border-radius: 16px; padding: 18px 22px; }
.tfm-test-texte[hidden] { display: none; }
.tfm .tfm-test-texte p { font-size: 17px; line-height: 26px; }
.tfm-test-champ { margin: 0; padding: 0; border: none; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tfm-test-champ legend { padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 8px; }
.tfm-test-consigne { display: block; font-size: 16px; line-height: 22px; font-weight: 700; color: var(--tf-encre-secondaire); }
.tfm-test-consigne[hidden] { display: none; }
.tfm-test-enonce { display: block; font-size: 28px; line-height: 36px; font-weight: 800; letter-spacing: -0.02em; color: var(--tf-marine); }
.tfm-test-reponses { display: flex; flex-direction: column; gap: 14px; }
.tfm-test-choix {
  min-height: 60px; display: flex; align-items: center; gap: 16px; padding: 10px 22px;
  border: 2px solid var(--tf-bordure); border-radius: 16px; background: var(--tf-fond); cursor: pointer;
  font-size: 19px; line-height: 24px; font-weight: 600; color: var(--tf-encre);
}
.tfm-test-choix input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--tf-emeraude-fonce); }
.tfm-test-choix:hover { border-color: var(--tf-emeraude); }
.tfm-test-choix:has(input:checked) { border: 3px solid var(--tf-emeraude); padding: 9px 21px; font-weight: 800; color: var(--tf-marine); }
.tfm-test-choix:has(input:focus-visible) { outline: 3px solid var(--tf-marine); outline-offset: 2px; }
.tfm .tfm-test-alerte { margin: -10px 0 0; font-size: 16px; line-height: 22px; font-weight: 700; color: var(--tf-marine); }
.tfm-test-alerte[hidden] { display: none; }
.tfm-test-actions { display: flex; justify-content: flex-end; }

/* ---------- Écran Résultat ---------- */
.tfm-test-resultat { display: flex; flex-direction: column; gap: 26px; }
.tfm-test-resultat-titre:focus { outline: none; }
.tfm-test-resultat .tfm-test-resultat-titre { margin-bottom: -20px; }
.tfm-test-niveau { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 22px; row-gap: 14px; align-items: center; }
.tfm .tfm-test-code { font-size: 112px; line-height: 104px; font-weight: 900; letter-spacing: -0.06em; color: var(--tf-emeraude); }
.tfm .tfm-test-nom { margin: 0; font-size: 18px; line-height: 24px; font-weight: 600; color: var(--tf-encre-secondaire); }
.tfm .tfm-test-nom strong { display: block; font-size: 32px; line-height: 36px; font-weight: 900; letter-spacing: -0.03em; color: var(--tf-marine); margin-bottom: 4px; }
.tfm-test-niveau .tfm-test-savoir, .tfm-test-niveau .tfm-test-puces, .tfm-test-niveau p:not(.tfm-test-code):not(.tfm-test-nom) { grid-column: 1 / -1; }
.tfm .tfm-test-savoir { margin-top: 12px; font-size: 22px; line-height: 28px; letter-spacing: -0.02em; }
.tfm .tfm-test-puces { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tfm .tfm-test-puces li {
  position: relative; padding-left: 44px; font-size: 18px; line-height: 27px; font-weight: 500; color: var(--tf-encre);
}
.tfm .tfm-test-puces li::before {
  content: ""; position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: var(--tf-rayon-pilule);
  background: var(--tf-emeraude) no-repeat center / 16px 16px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
.tfm-test-niveau .tfm-lien-fleche { font-size: 17px; line-height: 24px; }
.tfm-test-suite { display: flex; flex-direction: column; gap: 14px; padding-top: 24px; border-top: 1px solid var(--tf-bordure); }
.tfm .tfm-test-suite-titre { margin: 0; font-size: 24px; line-height: 30px; font-weight: 900; letter-spacing: -0.02em; color: var(--tf-emeraude-fonce); }
.tfm .tfm-test-suite p { margin-top: 0; }
.tfm .tfm-test-suite-note { font-size: 16px; line-height: 24px; font-weight: 500; color: var(--tf-encre-secondaire); }
.tfm .tfm-test-refaire-ligne { margin: -6px 0 0; font-size: 15px; line-height: 21px; font-weight: 600; color: var(--tf-encre-secondaire); }
.tfm-test-refaire {
  border: none; background: none; padding: 0; font: inherit; color: var(--tf-emeraude-fonce);
  text-decoration: underline; cursor: pointer;
}
.tfm-test-refaire:hover { color: var(--tf-marine); }

/* ---------- Comment est calculé votre niveau ? ---------- */
.tfm-test-calcul { display: flex; flex-direction: column; gap: 40px; }
.tfm-test-chiffres {
  background: var(--tf-emeraude); border-radius: 24px; padding: 40px 32px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 24px; text-align: center;
}
.tfm .tfm-test-chiffres p { margin: 0; color: #FFFFFF; font-size: 19px; line-height: 25px; font-weight: 700; }
.tfm .tfm-test-chiffres strong { display: block; color: #FFFFFF; font-size: 52px; line-height: 56px; font-weight: 900; letter-spacing: -0.05em; white-space: nowrap; margin-bottom: 8px; }
.tfm-test-calcul-texte { max-width: 820px; }
.tfm .tfm-test-calcul-texte p + p { margin-top: 20px; }
.tfm .tfm-test-calcul-texte a, .tfm .tfm-test-tableau-intro a { font-weight: 600; }

/* ---------- Les 6 niveaux (tableau ; cartes en mobile) ---------- */
.tfm-test-tableau { display: flex; flex-direction: column; gap: 16px; }
.tfm .tfm-test-tableau-intro { max-width: 760px; }
.tfm-test-niveaux { margin: 16px 0 0; }
.tfm-test-niveaux table { width: 100%; border-collapse: collapse; text-align: left; border: none; }
.tfm-test-niveaux th, .tfm-test-niveaux td { border: none; }
.tfm-test-niveaux thead th {
  padding: 0 24px 16px 0; font-size: 14px; line-height: 18px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--tf-emeraude-fonce); border-bottom: 2px solid var(--tf-marine); background: none;
}
.tfm-test-niveaux thead th:nth-child(1) { width: 230px; }
.tfm-test-niveaux thead th:nth-child(3) { width: 170px; }
.tfm-test-niveaux thead th:nth-child(4), .tfm-test-niveaux thead th:nth-child(5) { width: 150px; }
.tfm-test-niveaux tbody th, .tfm-test-niveaux tbody td { padding: 22px 24px 22px 0; border-bottom: 1px solid var(--tf-bordure); vertical-align: middle; background: none; }
.tfm-test-niveaux tbody th { font-size: 18px; line-height: 24px; font-weight: 800; color: var(--tf-marine); }
.tfm-test-niveaux tbody th strong { font-size: 34px; line-height: 36px; font-weight: 900; letter-spacing: -0.04em; color: var(--tf-emeraude); margin-right: 8px; }
.tfm-test-niveaux tbody th em {
  display: table; margin-top: 6px; font-style: normal; background: var(--tf-fond-doux); color: var(--tf-encre-secondaire);
  border-radius: var(--tf-rayon-pilule); padding: 4px 12px; font-size: 13px; line-height: 17px; font-weight: 800;
}
.tfm-test-hors th strong { color: var(--tf-encre-secondaire) !important; }
.tfm-test-niveaux tbody td { font-size: 18px; line-height: 27px; color: var(--tf-encre); }
.tfm-test-niveaux tbody td:nth-child(3) { font-weight: 700; color: var(--tf-marine); white-space: nowrap; }
.tfm-test-niveaux tbody td:nth-child(4) { font-size: 17px; line-height: 25px; font-weight: 600; }
.tfm-test-niveaux tbody td:last-child { padding-right: 0; text-align: right; white-space: nowrap; }
.tfm .tfm-test-tableau .tfm-petit { font-size: 15px !important; line-height: 22px !important; color: var(--tf-encre-secondaire); }
.tfm .tfm-test-citation { margin: 48px auto 0; max-width: 960px; padding: 0; border: none; text-align: center; }
.tfm .tfm-test-citation p { font-size: 38px; line-height: 46px; font-weight: 900; letter-spacing: -0.03em; color: var(--tf-emeraude-fonce); font-style: normal; }

/* ---------- Et après le test ? ---------- */
.tfm .tfm-test-apres h2 { font-size: 52px; line-height: 54px; letter-spacing: -0.045em; }
.tfm .tfm-test-apres-intro { max-width: 760px; font-size: 20px; line-height: 30px; font-weight: 500; margin-top: 18px; }
.tfm-test-chemins { margin-top: 40px !important; }
.tfm-test-chemin { border: 3px solid var(--tf-emeraude); border-radius: 24px; padding: 28px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.tfm .tfm-test-num {
  width: 56px; height: 56px; border-radius: var(--tf-rayon-pilule); background: var(--tf-emeraude); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center; font-size: 28px; line-height: 1; font-weight: 900;
}
.tfm .tfm-test-chemin p { margin-top: 0; font-size: 18px; line-height: 27px; }
.tfm .tfm-test-chemin-lien { margin-top: auto !important; }
.tfm .tfm-test-chemin-lien a { color: #FFFFFF; font-size: 18px; line-height: 24px; text-decoration: underline; }

/* ---------- FAQ ---------- */
.tfm-test-faq { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 64px; align-items: start; }
.tfm-test-faq-liste { border-top: 2px solid var(--tf-marine); }

/* ---------- Bande finale (émeraude, bouton blanc) ---------- */
.tfm-test-final { background: var(--tf-emeraude); }
.tfm-test-final-wrap { display: flex; align-items: center; justify-content: space-between; gap: 48px; }
.tfm-test-final-texte { display: flex; flex-direction: column; gap: 18px; }
.tfm .tfm-test-final h2 { color: #FFFFFF; font-size: 60px; line-height: 62px; letter-spacing: -0.045em; }
.tfm .tfm-test-final-texte p { margin: 0; color: #FFFFFF; font-size: 22px; line-height: 29px; font-weight: 800; letter-spacing: -0.02em; }
.tfm .tfm-test-final-texte a { color: #FFFFFF; white-space: nowrap; }
.tfm .tfm-test-final-bouton { flex: none; }
.tfm .tfm-test-final .tfm-btn { min-height: 64px; padding: 0 38px; background: #FFFFFF; color: var(--tf-emeraude-fonce); font-size: 20px; font-weight: 900; }
.tfm .tfm-test-final .tfm-btn:hover { background: var(--tf-marine); color: #FFFFFF; }

/* ==========================================================================
   Mobile (planches 390px : Mobile, Mobile-question, Mobile-resultat)
   ========================================================================== */
@media (max-width: 767px) {
  .tfm-test-haut { padding: 16px 0 56px; }
  .tfm-test-heros, .tfm-test-heros:not(:has(.tfm-test-outil)) {
    margin-top: 22px !important; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto;
    grid-template-areas: "intro" "outil" "confiance"; row-gap: 20px;
  }
  .tfm-test-intro h1 { margin-bottom: 12px; }
  .tfm .tfm-test-bref { font-size: 19px; line-height: 28px; }
  .tfm .tfm-test-confiance { font-size: 15px; line-height: 22px; }

  .tfm-test-outil { border-radius: 20px; padding: 24px 20px; }
  .tfm-test-depart { gap: 18px; }
  .tfm .tfm-test-depart-titre { margin-top: -8px; font-size: 26px; line-height: 30px; }
  .tfm .tfm-test-atouts { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .tfm .tfm-test-atouts li { min-height: 0; padding: 8px 14px; background: var(--tf-fond); border-radius: var(--tf-rayon-pilule); font-size: 0; line-height: 0; }
  .tfm .tfm-test-atouts li strong { margin: 0; font-size: 15px; line-height: 19px; }
  .tfm .tfm-test-atouts li::before { display: none; }
  .tfm-test-lancer { flex-direction: column; align-items: stretch; gap: 12px; }
  .tfm-test-commencer { justify-content: center; min-height: 56px; font-size: 18px; }
  .tfm-test-mobile { display: inline; }
  .tfm .tfm-test-lancer-note { text-align: center; font-size: 15px; line-height: 21px; }

  .tfm-test-question { gap: 20px; }
  .tfm .tfm-test-compteur { font-size: 16px; }
  .tfm-test-progression { margin-top: -8px; }
  .tfm-test-champ legend { margin-bottom: 10px; }
  .tfm-test-enonce { font-size: 22px; line-height: 29px; }
  .tfm-test-choix { min-height: 56px; padding: 8px 18px; font-size: 17px; }
  .tfm-test-choix:has(input:checked) { padding: 7px 17px; }
  .tfm-test-suivant { width: 100%; justify-content: center; }

  .tfm-test-resultat { gap: 20px; }
  .tfm .tfm-test-code { font-size: 80px; line-height: 76px; }
  .tfm .tfm-test-nom { font-size: 16px; line-height: 22px; }
  .tfm .tfm-test-nom strong { font-size: 24px; line-height: 28px; }
  .tfm .tfm-test-savoir { font-size: 20px; line-height: 26px; }
  .tfm .tfm-test-puces li { font-size: 17px; line-height: 25px; }
  .tfm .tfm-test-suite-titre { font-size: 22px; line-height: 28px; }

  .tfm-test-calcul { gap: 24px; }
  .tfm-test-chiffres { border-radius: 20px; padding: 26px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 10px; }
  .tfm .tfm-test-chiffres p { font-size: 16px; line-height: 21px; }
  .tfm .tfm-test-chiffres strong { font-size: 30px; line-height: 34px; margin-bottom: 6px; }

  /* Tableau → liste de cartes */
  .tfm-test-niveaux { margin-top: 0; }
  .tfm-test-niveaux table, .tfm-test-niveaux tbody, .tfm-test-niveaux tr, .tfm-test-niveaux th, .tfm-test-niveaux td { display: block; width: auto; }
  .tfm-test-niveaux thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tfm-test-niveaux tbody { border-top: 2px solid var(--tf-marine); }
  .tfm-test-niveaux tbody tr { padding: 18px 0 8px; border-bottom: 1px solid var(--tf-bordure); }
  .tfm-test-niveaux tbody th, .tfm-test-niveaux tbody td { padding: 0; border: none; }
  .tfm-test-niveaux tbody th { font-size: 17px; line-height: 22px; margin-bottom: 6px; }
  .tfm-test-niveaux tbody th strong { font-size: 30px; line-height: 32px; }
  .tfm-test-niveaux tbody th em { display: inline-block; margin: 0 0 0 6px; }
  .tfm-test-niveaux tbody td { font-size: 17px; line-height: 25px; }
  .tfm-test-niveaux tbody td:nth-child(3), .tfm-test-niveaux tbody td:nth-child(4) { display: inline; margin-top: 6px; font-size: 15px; line-height: 21px; font-weight: 700; color: var(--tf-marine); }
  .tfm-test-niveaux tbody td:nth-child(3)::after { content: "* · "; }
  .tfm-test-niveaux tbody td:last-child { text-align: left; }
  .tfm-test-niveaux tbody td:last-child a { min-height: 44px; display: flex; align-items: center; font-size: 16px; }
  .tfm .tfm-test-tableau .tfm-petit { font-size: 14px !important; line-height: 21px !important; }
  .tfm .tfm-test-citation { margin-top: 24px; }
  .tfm .tfm-test-citation p { font-size: 25px; line-height: 31px; }

  .tfm .tfm-test-apres h2 { font-size: 34px; line-height: 37px; }
  .tfm .tfm-test-apres-intro { font-size: 17px; line-height: 26px; }
  .tfm-test-chemins { margin-top: 20px !important; gap: 16px; }
  .tfm-test-chemin { border-radius: 20px; padding: 20px 20px 20px 80px; position: relative; gap: 8px; }
  .tfm .tfm-test-num { position: absolute; left: 20px; top: 20px; width: 44px; height: 44px; font-size: 22px; }
  .tfm .tfm-test-chemin h3 { font-size: 21px; line-height: 26px; }
  .tfm .tfm-test-chemin p { font-size: 17px; line-height: 26px; }
  .tfm .tfm-test-chemin-lien a { min-height: 44px; display: flex; align-items: center; font-size: 17px; }

  .tfm-test-faq { grid-template-columns: minmax(0, 1fr); gap: 20px; }

  .tfm-test-final-wrap { flex-direction: column; align-items: stretch; gap: 24px; }
  .tfm .tfm-test-final h2 { font-size: 36px; line-height: 39px; }
  .tfm .tfm-test-final-texte p { font-size: 18px; line-height: 26px; }
}
