/* Rubrique « Mots de passe au travail » — Un ami sur place
   Couleurs de la collection : vert d'eau (titres, actions), encre (texte), crème (fond chaud),
   rouge cape (alerte), jaune cadenas (accent). */
:root {
  --encre: #16302d; --discret: #4d6a66; --fond: #fffdf9; --creme: #fbebdd; --creme-2: #f6dfcb;
  --vert: #0d8a85; --vert-fonce: #0a6f6b; --vert-doux: #dcefed;
  --rouge: #c8442a; --rouge-doux: #fbe3dc; --jaune: #f2b632; --jaune-doux: #fdf0cf;
  --trait: #e3d6c8; --blanc: #ffffff;
  --f-titre: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --f-texte: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 106%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--fond); color: var(--encre); font-family: var(--f-texte); line-height: 1.6; }
img { max-width: 100%; height: auto; }
a { color: var(--vert-fonce); }
.largeur { max-width: 1080px; margin: 0 auto; padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--f-titre); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 12px; }
.sur-titre { font-size: .82rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--vert); margin-bottom: 10px; }
.intro { font-size: 1.15rem; max-width: 62ch; }
.discret { color: var(--discret); }

/* En-tête */
.entete { background: var(--blanc); border-bottom: 1px solid var(--trait); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; }
.entete .largeur { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 68px; flex-wrap: wrap; padding-block: 8px; }
.marque { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--encre); }
.marque img { width: 42px; }
.marque span { display: flex; flex-direction: column; line-height: 1.15; }
.marque b { font-family: var(--f-titre); font-weight: 600; font-size: 1.1rem; }
.marque small { color: var(--discret); font-size: .78rem; }
nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--encre); font-weight: 700; font-size: .95rem; padding: 6px 0; border-bottom: 3px solid transparent; }
nav a:hover, nav a[aria-current="page"] { border-bottom-color: var(--jaune); }
nav .connexion { color: var(--discret); font-weight: 400; }
.bouton { display: inline-block; font: inherit; font-weight: 700; text-decoration: none; border: 0; border-radius: 12px; padding: 13px 22px; background: var(--vert); color: var(--blanc); cursor: pointer; line-height: 1.2; }
.bouton:hover { background: var(--vert-fonce); }
.bouton.clair { background: var(--blanc); color: var(--vert-fonce); box-shadow: inset 0 0 0 2px var(--vert); }
.bouton.petit { padding: 9px 16px; font-size: .92rem; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--jaune); outline-offset: 2px; }
@media (max-width: 760px) { nav { width: 100%; gap: 4px 14px; } nav .bouton { margin-left: auto; } }

/* Sections */
section { padding-block: 56px; }
section.creme { background: var(--creme); }
section.vert { background: var(--vert); color: var(--blanc); }
section.vert .sur-titre { color: var(--jaune); }
section.vert a:not(.bouton) { color: var(--blanc); }
.titre-section { margin-bottom: 28px; max-width: 760px; }
.titre-section p { margin-top: 12px; }

/* Héros */
.heros { background: var(--creme); padding-block: 48px 0; overflow: hidden; }
.heros .largeur { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 32px; align-items: end; }
.heros .texte { padding-bottom: 52px; }
.heros h1 em { font-style: normal; color: var(--rouge); }
.heros .intro { margin-top: 18px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.heros figure { margin: 0; position: relative; }
.heros figure img { display: block; width: 100%; max-width: 380px; margin-left: auto; }
.bulle { position: absolute; top: 0; left: -10%; background: var(--blanc); border: 3px solid var(--encre); border-radius: 18px; padding: 10px 16px; font-family: var(--f-titre); font-weight: 600; font-size: 1.15rem; box-shadow: 4px 4px 0 var(--encre); }
.prix-depart { display: inline-flex; gap: 8px; align-items: baseline; margin-top: 18px; background: var(--blanc); border-radius: 999px; padding: 6px 16px; font-size: .95rem; }
.prix-depart b { font-family: var(--f-titre); font-size: 1.15rem; color: var(--vert-fonce); }
@media (max-width: 760px) {
  .heros .largeur { grid-template-columns: 1fr; }
  .heros .texte { padding-bottom: 0; }
  .heros figure img { max-width: 240px; margin: 0 auto; }
  .bulle { left: 4%; top: 12%; font-size: 1rem; }
}

/* Grilles et cartes */
.grille { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grille > * { min-width: 0; }
.carte { background: var(--blanc); border: 1px solid var(--trait); border-radius: 16px; padding: 22px; }
.carte h3 { margin-bottom: 8px; }
.carte p:last-child { margin-bottom: 0; }
.carte .chiffre { font-family: var(--f-titre); font-size: 2.2rem; font-weight: 600; color: var(--rouge); line-height: 1; margin-bottom: 10px; }
.carte.alerte { border-left: 6px solid var(--rouge); }
ul.coches { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
ul.coches li { padding-left: 30px; position: relative; }
ul.coches li::before { content: ""; position: absolute; left: 0; top: .32em; width: 18px; height: 18px; border-radius: 50%; background: var(--jaune); border: 3px solid var(--encre); }

/* Parcours en trois parties (badges) */
.parcours { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 820px) { .parcours { grid-template-columns: 1fr; } }
.etape-badge { background: var(--blanc); border-radius: 16px; padding: 20px; border-top: 8px solid var(--c); }
.etape-badge.apprenti { --c: #c8803e; } .etape-badge.gardien { --c: #8e9aa1; } .etape-badge.coffre { --c: var(--jaune); }
.etape-badge .nom { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--discret); }
.etape-badge ol { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.etape-badge li { display: grid; grid-template-columns: 2.2em minmax(0, 1fr); gap: 8px; align-items: baseline; }
.etape-badge li b { font-family: var(--f-titre); font-size: 1.3rem; color: var(--vert); }

/* Étapes numérotées */
.etapes { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: e; }
.etapes li { counter-increment: e; background: var(--blanc); color: var(--encre); border-radius: 16px; padding: 20px; }
.etapes li::before { content: counter(e); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--jaune); color: var(--encre); font-family: var(--f-titre); font-weight: 600; font-size: 1.3rem; margin-bottom: 10px; }
.etapes h3 { margin-bottom: 6px; }

/* Tableaux */
.tableau { overflow-x: auto; background: var(--blanc); border-radius: 16px; border: 1px solid var(--trait); }
table { border-collapse: collapse; width: 100%; min-width: 520px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--trait); vertical-align: top; }
thead th { background: var(--vert); color: var(--blanc); font-size: .9rem; }
tbody tr:last-child td { border-bottom: 0; }
td.prix, th.prix { white-space: nowrap; font-variant-numeric: tabular-nums; }
td.prix b { font-family: var(--f-titre); font-size: 1.35rem; color: var(--vert-fonce); }

/* Formules */
.formules { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.formule { background: var(--blanc); border: 2px solid var(--trait); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.formule.mise-en-avant { border-color: var(--vert); box-shadow: 6px 6px 0 var(--vert-doux); }
.formule .montant { font-family: var(--f-titre); font-size: 2.4rem; font-weight: 600; color: var(--vert-fonce); line-height: 1; }
.formule .montant small { font-family: var(--f-texte); font-size: .95rem; color: var(--discret); font-weight: 400; }
.formule .bouton { margin-top: auto; text-align: center; }

/* Aperçus du livret */
.apercus { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.apercus figure { margin: 0; }
.apercus img { display: block; width: 100%; border-radius: 6px; box-shadow: 0 4px 16px rgba(22, 48, 45, .18); background: #fff; }
.apercus figcaption { font-size: .9rem; color: var(--discret); margin-top: 8px; }

/* Jeu d'essai */
.jeu { background: var(--blanc); border-radius: 18px; border: 2px solid var(--vert); padding: 24px; max-width: 720px; }
.jeu .progression { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; color: var(--discret); margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.mdp { font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; font-size: clamp(1.4rem, 5vw, 2rem); font-weight: 700; background: var(--creme); border-radius: 12px; padding: 16px; text-align: center; overflow-wrap: anywhere; letter-spacing: .04em; }
.choix { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.choix button { font: inherit; font-weight: 700; font-size: 1.1rem; border-radius: 12px; padding: 14px; cursor: pointer; border: 3px solid var(--encre); background: var(--blanc); color: var(--encre); }
.choix button[data-r="solide"]:hover { background: var(--vert-doux); }
.choix button[data-r="fragile"]:hover { background: var(--rouge-doux); }
.choix button:disabled { cursor: default; opacity: .55; }
.verdict { margin-top: 16px; border-radius: 12px; padding: 14px 16px; }
.verdict.bon { background: var(--vert-doux); }
.verdict.faux { background: var(--rouge-doux); }
.verdict b { display: block; font-family: var(--f-titre); font-size: 1.2rem; margin-bottom: 4px; }
.verdict .bouton { margin-top: 10px; }

/* Questions */
details.question { background: var(--blanc); border: 1px solid var(--trait); border-radius: 14px; padding: 0 20px; }
details.question + details.question { margin-top: 10px; }
details.question summary { cursor: pointer; font-weight: 700; padding: 16px 0; font-size: 1.05rem; list-style-position: outside; }
details.question[open] { padding-bottom: 16px; }
details.question p:last-child { margin-bottom: 0; }

/* Formulaire */
.formulaire { background: var(--blanc); border: 1px solid var(--trait); border-radius: 18px; padding: 24px; max-width: 760px; }
.champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.champs > div { min-width: 0; }
.champ-large { grid-column: 1 / -1; }
label { display: block; font-weight: 700; margin-bottom: 6px; }
label small { font-weight: 400; color: var(--discret); }
input[type=text], input[type=email], input[type=tel], select, textarea { font: inherit; width: 100%; padding: 11px 13px; border: 2px solid var(--trait); border-radius: 10px; background: var(--blanc); color: var(--encre); }
textarea { min-height: 120px; resize: vertical; }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.message { border-radius: 14px; padding: 16px 18px; margin-bottom: 18px; }
.message.ok { background: var(--vert-doux); border: 2px solid var(--vert); }
.message.erreur { background: var(--rouge-doux); border: 2px solid var(--rouge); }

/* Appel final et pied */
.appel { text-align: center; }
.appel h2 { margin-bottom: 12px; }
.appel .actions { justify-content: center; }
.pied { background: var(--encre); color: #d6e4e2; padding-block: 32px; font-size: .92rem; }
.pied .largeur { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.pied a { color: #ffffff; }
.pied nav { gap: 6px 18px; }
.pied nav a { color: #ffffff; font-weight: 400; font-size: .92rem; }

/* Lien de retour vers l'accueil Un ami sur place */
.retour-maison { background: var(--encre); font-size: .88rem; }
.retour-maison .largeur { padding-block: 7px; }
.retour-maison a { color: #ffffff; text-decoration: none; font-weight: 700; }
.retour-maison a:hover { text-decoration: underline; }
