:root {
  --sauge: #92ae90;
  --sauge-fonce: #46663f;
  --sauge-tres-fonce: #36502f;
  --sauge-clair: #eef3ed;
  --sauge-bord: #c9d8c7;
  --gris: #565656;
  --encre: #2b2b2b;
  --texte-doux: #5f5f5f;
  --fond: #f7f8f6;
  --carte: #ffffff;
  --bord: #dcdfda;
  --erreur: #a3271d;
  --rayon: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

a { color: var(--sauge-fonce); }

.entete {
  background: var(--carte);
  border-bottom: 1px solid var(--bord);
  padding: 14px 16px;
  text-align: center;
}
.logo-lien { display: inline-block; }
.entete img { width: min(300px, 80vw); height: auto; display: block; }

main {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

h1 { font-size: 1.9rem; line-height: 1.2; margin: 8px 0 12px; color: var(--gris); }
h2 { font-size: 1.35rem; line-height: 1.25; margin: 4px 0 18px; color: var(--gris); display: flex; align-items: center; gap: 10px; }
.bloc {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--sauge); color: #fff; font-size: 1rem; flex: none;
}
.suite { font-weight: 400; color: var(--texte-doux); font-size: 1rem; }

.chapeau { font-size: 1.15rem; color: var(--sauge-tres-fonce); font-weight: 600; }
.points { padding-left: 1.2em; }
.points li { margin: 4px 0; }
.note, .aide { color: var(--texte-doux); font-size: 0.93rem; }
.aide { font-weight: 400; }
legend .aide { display: block; margin-top: 2px; }

/* Progression */
.progression { height: 6px; background: var(--sauge-bord); border-radius: 3px; overflow: hidden; display: none; }
.progression-barre { height: 100%; width: 0; background: var(--sauge-fonce); transition: width .25s ease; }
.etape-texte { margin: 8px 0 0; font-size: 0.9rem; color: var(--texte-doux); min-height: 1.3em; }
.js .progression { display: block; }

/* Étapes : sans JavaScript, tout s'affiche sur une page */
.etape { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 20px 16px; margin: 14px 0; }
.js .etape { display: none; }
.js .etape.active { display: block; }

fieldset { border: 0; margin: 0 0 26px; padding: 0; min-width: 0; }
fieldset:last-child { margin-bottom: 0; }
legend { font-weight: 650; font-size: 1.05rem; margin-bottom: 10px; padding: 0; }
.num {
  display: inline-block; min-width: 1.7em; padding: 0 6px; margin-right: 6px;
  border-radius: 6px; background: var(--sauge-clair); color: var(--sauge-tres-fonce);
  text-align: center; font-size: 0.95rem;
}
.requis { font-size: 0.75rem; font-weight: 600; color: var(--sauge-fonce); text-transform: uppercase; letter-spacing: .03em; margin-left: 4px; }
.sous-question { margin: 14px 0 8px; font-weight: 500; }

/* Choix sous forme de tuiles */
.choix { display: grid; gap: 8px; }
.choix.ligne { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.choix.echelle { grid-template-columns: repeat(5, 1fr); }
.choix label, .niveaux label, .case { position: relative; display: block; cursor: pointer; }
.choix input, .niveaux input {
  position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0;
}
.choix span {
  display: flex; align-items: center; min-height: 48px;
  padding: 10px 14px; border: 1.5px solid var(--bord); border-radius: 8px;
  background: var(--carte); transition: background .15s, border-color .15s;
}
.choix.ligne span { justify-content: center; text-align: center; }
.choix input[type="checkbox"] + span::before,
.choix input[type="radio"] + span::before {
  content: ""; flex: none; width: 18px; height: 18px; margin-right: 10px;
  border: 1.5px solid var(--gris); background: #fff;
}
.choix input[type="radio"] + span::before { border-radius: 50%; }
.choix input[type="checkbox"] + span::before { border-radius: 4px; }
.choix.ligne input + span::before { display: none; }
.choix input:checked + span { background: var(--sauge-clair); border-color: var(--sauge-fonce); font-weight: 600; }
.choix input[type="radio"]:checked + span::before { background: var(--sauge-fonce); box-shadow: inset 0 0 0 3px #fff; border-color: var(--sauge-fonce); }
.choix input[type="checkbox"]:checked + span::before {
  background-color: var(--sauge-fonce); border-color: var(--sauge-fonce);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 14px 14px; background-position: center; background-repeat: no-repeat;
}
.choix input:focus-visible + span, .niveaux input:focus-visible + span { outline: 3px solid var(--sauge-fonce); outline-offset: 2px; }
.choix input:disabled + span { opacity: .45; cursor: not-allowed; }
.echelle-legende { display: flex; justify-content: space-between; gap: 12px; font-size: 0.85rem; color: var(--texte-doux); margin: 6px 0 0; }

/* Question 7 : tâches par domaine */
.choix.colonnes { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.domaine { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--bord); }
.domaine:first-of-type { margin-top: 8px; }
.domaine-titre { font-size: 1rem; margin: 0 0 10px; color: var(--sauge-tres-fonce); }

/* Grille de la question 5 */
.tache { padding: 12px 0; border-top: 1px solid var(--bord); }
.tache:first-of-type { border-top: 0; }
.tache-nom { margin: 0 0 8px; font-weight: 500; }
.niveaux { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.niveaux span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 44px; padding: 6px 4px; font-size: 0.82rem; line-height: 1.2;
  border: 1.5px solid var(--bord); border-radius: 8px; background: var(--carte);
}
.niveaux label:nth-child(1) input:checked + span { background: #f0f0f0; border-color: var(--gris); font-weight: 600; }
.niveaux label:nth-child(2) input:checked + span { background: var(--sauge-clair); border-color: var(--sauge-fonce); font-weight: 600; }
.niveaux label:nth-child(3) input:checked + span { background: #fbf0d9; border-color: #8a6412; color: #5c430c; font-weight: 600; }
.niveaux label:nth-child(4) input:checked + span { background: #f8e1de; border-color: var(--erreur); color: #7a1d16; font-weight: 600; }

/* Champs texte */
.champ { display: block; margin-top: 12px; font-weight: 500; }
.champ input { display: block; width: 100%; margin-top: 4px; }
.champ.court input { max-width: 180px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea {
  font: inherit; color: inherit; padding: 10px 12px; min-height: 46px;
  border: 1.5px solid var(--bord); border-radius: 8px; background: #fff; width: 100%;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus { outline: 3px solid var(--sauge-bord); border-color: var(--sauge-fonce); }
[aria-invalid="true"] { border-color: var(--erreur) !important; }

.js .revele { display: none; }
.js .revele.visible { display: block; }
.contact { margin-top: 10px; padding: 4px 14px 14px; background: var(--sauge-clair); border-radius: 8px; }

.consentement { border-top: 1px solid var(--bord); padding-top: 18px; }
.case { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.case input { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--sauge-fonce); }
details { margin-top: 12px; font-size: 0.92rem; color: var(--texte-doux); }
summary { cursor: pointer; color: var(--sauge-fonce); font-weight: 600; min-height: 32px; }
details p { margin: 8px 0; }

.cache { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.erreur { background: #fbe9e7; color: var(--erreur); border-radius: 8px; padding: 10px 14px; font-weight: 500; }

/* Boutons */
.navigation { display: flex; gap: 10px; justify-content: space-between; margin-top: 18px; flex-wrap: wrap; }
.bouton {
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
  min-height: 50px; padding: 12px 22px; border-radius: 8px; border: 2px solid var(--sauge-fonce);
  background: var(--sauge-fonce); color: #fff; flex: 1 1 160px;
}
.bouton:hover { background: var(--sauge-tres-fonce); border-color: var(--sauge-tres-fonce); }
.bouton:focus-visible { outline: 3px solid var(--sauge-bord); outline-offset: 2px; }
.bouton.secondaire { background: #fff; color: var(--sauge-fonce); }
.bouton.secondaire:hover { background: var(--sauge-clair); }
.bouton[disabled] { opacity: .6; cursor: wait; }
.js .navigation [data-action] { display: none; }
.js .navigation [data-action].visible { display: block; }
.navigation [data-action="precedent"], .navigation [data-action="suivant"] { display: none; }

/* Résultat */
.resultat { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 22px 16px; margin-top: 14px; }
.resultat:focus { outline: none; }
.cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 18px 0; }
.carte { background: var(--sauge-clair); border-radius: var(--rayon); padding: 14px 16px; }
.carte-titre { margin: 0; font-size: 0.9rem; color: var(--texte-doux); }
.carte-valeur { margin: 4px 0 0; font-size: 1.6rem; font-weight: 700; color: var(--sauge-tres-fonce); line-height: 1.2; }
.carte-detail { margin: 4px 0 0; font-size: 0.92rem; color: var(--texte-doux); }
.bloc-resultat { margin-top: 18px; }
.bloc-resultat h2 { font-size: 1.1rem; margin-bottom: 8px; }
.bloc-resultat ol, .bloc-resultat ul { margin: 0; padding-left: 1.3em; }
.bloc-resultat li { margin: 4px 0; }
.suite-etape { border-top: 1px solid var(--bord); padding-top: 14px; }
.navigation.finale .bouton { display: block; }

.pied { text-align: center; font-size: 0.85rem; color: var(--texte-doux); padding: 10px 16px 30px; }
.pied p { margin: 4px 0; }

@media (min-width: 600px) {
  .etape, .resultat { padding: 28px 30px; }
  h1 { font-size: 2.2rem; }
  .niveaux span { font-size: 0.88rem; }
}

@media print {
  body { background: #fff; font-size: 12pt; }
  .entete { border: 0; }
  form, .progression, .etape-texte, .navigation, .pied a[href^="mailto"] { display: none !important; }
  .resultat { border: 0; padding: 0; }
  .carte { border: 1px solid #ccc; }
}

/* ---------- Test PME ---------- */
/* Question 7 : statut par norme (5 choix) */
.statuts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.statuts label { position: relative; display: block; cursor: pointer; }
.statuts input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.statuts span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 48px; padding: 6px 3px; font-size: 0.78rem; line-height: 1.2; hyphens: auto;
  border: 1.5px solid var(--bord); border-radius: 8px; background: var(--carte);
}
.statuts input:checked + span { background: var(--sauge-clair); border-color: var(--sauge-fonce); color: var(--sauge-tres-fonce); font-weight: 600; }
.statuts input:focus-visible + span { outline: 3px solid var(--sauge-fonce); outline-offset: 2px; }
@media (min-width: 600px) { .statuts span { font-size: 0.86rem; } }

/* Résultat : indice */
.indice { background: var(--sauge-clair); border-radius: var(--rayon); padding: 16px; margin: 18px 0; }
.indice-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.indice-titre { margin: 0; font-weight: 600; color: var(--sauge-tres-fonce); }
.indice-valeur { margin: 0; font-size: 2.4rem; font-weight: 700; color: var(--sauge-tres-fonce); line-height: 1; }
.indice-sur { font-size: 1rem; font-weight: 500; color: var(--texte-doux); }
.jauge { height: 12px; background: #fff; border-radius: 6px; margin: 12px 0 10px; overflow: hidden; }
.jauge-remplie { height: 100%; width: 0; border-radius: 0 6px 6px 0; background: var(--sauge-fonce); transition: width .6s ease; }
.jauge-remplie.moyen { background: #8a6412; }
.jauge-remplie.haut { background: var(--erreur); }
.indice-niveau { margin: 0; font-weight: 600; }
.indice-detail { margin: 6px 0 0; font-size: 0.85rem; color: var(--texte-doux); }
.carte-valeur.petite { font-size: 1.05rem; line-height: 1.35; }
.conseils { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.conseils li { border-left: 3px solid var(--sauge); padding: 4px 0 4px 12px; }
@media (prefers-reduced-motion: reduce) { .jauge-remplie { transition: none; } }

/* Résultat : services recommandés et demande d'échange */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.service { border: 1.5px solid var(--sauge-bord); border-radius: var(--rayon); padding: 14px 16px; background: var(--carte); min-width: 0; }
.service-nom { margin: 0 0 4px; font-weight: 700; color: var(--sauge-tres-fonce); }
.service-texte { margin: 0; font-size: 0.93rem; color: var(--texte-doux); }
.appel { margin-top: 22px; padding: 18px 16px; border-radius: var(--rayon); background: var(--sauge-tres-fonce); color: #fff; }
.appel h2 { color: #fff; margin: 0 0 6px; font-size: 1.2rem; }
.appel p { margin: 0 0 12px; }
.appel .aide { color: #dfe8dd; }
.appel .champ { color: #fff; }
.appel input, .appel textarea { border-color: transparent; }
.appel .bouton { background: #fff; color: var(--sauge-tres-fonce); border-color: #fff; width: 100%; }
.appel .bouton:hover { background: var(--sauge-clair); }
.appel .erreur { background: #fff; }
.champs-contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 12px; }
.merci-contact { font-weight: 600; font-size: 1.05rem; margin: 0; }
@media (min-width: 600px) { .appel { padding: 22px 26px; } }
@media print { .appel { display: none !important; } }
