/*
  Guides d'utilisation (Espace Parent, Espace Élève) : une étape = un texte + une capture
  d'écran de téléphone, l'élément à toucher entouré en rouge et numéroté comme dans le texte.
  Identité du kit : noir de l'interface, papier clair, rouge du correcteur pour les repères.
*/
:root {
  --papier: #f4f5f7;
  --feuille: #ffffff;
  --encre: #101828;
  --encre-douce: #344054;
  --ardoise: #5d6470;
  --trait: #e4e7ec;
  --correcteur: #d23f3f;
  --correcteur-pale: #fdecec;
  --vert: #1e8a5a;
  --vert-pale: #e7f5ee;
  --jaune: #f6c445;
  --titre: 'Familjen Grotesk', 'Segoe UI', system-ui, sans-serif;
  --texte: 'Lexend', 'Segoe UI', system-ui, sans-serif;
  --main: 'Kalam', 'Comic Sans MS', cursive;
}
* { box-sizing: border-box; }
html { -webkit-print-color-adjust: exact; print-color-adjust: exact; scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--papier); color: var(--encre); font-family: var(--texte); font-size: 16px; line-height: 1.6; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--titre); margin: 0; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
strong { font-weight: 600; }

/* --- Barre d'outils --- */
.barre { position: sticky; top: 0; z-index: 20; background: rgba(16, 24, 40, .97); color: #fff; }
.barre-in { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 14px; }
.barre a, .barre button { font: inherit; color: #fff; text-decoration: none; background: transparent; border: 1px solid rgba(255, 255, 255, .28); border-radius: 9px; padding: 6px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.barre a:hover, .barre button:hover { background: rgba(255, 255, 255, .1); }
.barre .principal { background: #fff; color: var(--encre); border-color: #fff; font-weight: 600; }
.barre .groupe { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Couverture --- */
.couverture { background: var(--encre); color: #fff; position: relative; overflow: hidden; }
.couverture::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px); background-size: 100% 30px; pointer-events: none; }
.couverture-in { position: relative; max-width: 1100px; margin: 0 auto; padding: 48px 16px 56px; display: grid; grid-template-columns: 1.25fr .75fr; gap: 40px; align-items: center; }
.marque { display: inline-flex; align-items: center; gap: 10px; font-family: var(--titre); font-weight: 700; font-size: 17px; }
.marque img { height: 36px; width: auto; }
.surtitre { font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #f6a3a3; margin-top: 28px; }
.couverture h1 { font-size: clamp(34px, 5.4vw, 56px); margin-top: 10px; }
.couverture .chapeau { color: rgba(255, 255, 255, .78); font-size: 18px; margin-top: 14px; max-width: 600px; }
.pastilles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.pastilles span { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.pastilles b { color: var(--jaune); font-weight: 600; }
.couverture .ecran { justify-self: center; transform: rotate(3deg); }
.annotation { font-family: var(--main); color: var(--jaune); font-size: 24px; transform: rotate(-4deg); display: inline-block; margin-top: 18px; }

/* --- Téléphone --- */
.telephone { width: 270px; max-width: 100%; border-radius: 40px; background: #0b0f17; padding: 9px; box-shadow: 0 24px 50px -18px rgba(16, 24, 40, .45), inset 0 0 0 1.5px #2b3240; position: relative; flex: none; }
.telephone img { border-radius: 32px; width: 100%; aspect-ratio: 390 / 844; object-fit: cover; background: #fff; }
.duo { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.duo .telephone { width: 230px; }

/* --- Corps --- */
.contenu { max-width: 1100px; margin: 0 auto; padding: 40px 16px 72px; }
.avant { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 40px; }
.carte { background: var(--feuille); border: 1px solid var(--trait); border-radius: 18px; padding: 20px; }
.carte h3 { font-size: 18px; margin-bottom: 8px; }
.carte p, .carte li { font-size: 15px; color: var(--encre-douce); }
.carte ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

.sommaire { background: var(--feuille); border: 1px solid var(--trait); border-radius: 20px; padding: 22px; margin-bottom: 48px; }
.sommaire h2 { font-size: 22px; margin-bottom: 14px; }
.sommaire ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 18px; counter-reset: partie; }
.sommaire li { counter-increment: partie; }
.sommaire a { display: flex; gap: 10px; align-items: baseline; text-decoration: none; padding: 8px 10px; border-radius: 10px; }
.sommaire a:hover { background: var(--papier); }
.sommaire a::before { content: counter(partie); font-family: var(--titre); font-weight: 700; color: var(--correcteur); min-width: 16px; }
.sommaire small { display: block; color: var(--ardoise); font-size: 13px; }

.partie { margin-top: 56px; }
.partie-titre { display: flex; align-items: baseline; gap: 14px; padding-bottom: 14px; border-bottom: 2px solid var(--encre); margin-bottom: 26px; }
.partie-titre span { font-family: var(--titre); font-weight: 700; font-size: 15px; color: #fff; background: var(--encre); border-radius: 8px; padding: 2px 10px; }
.partie-titre h2 { font-size: clamp(26px, 3.4vw, 34px); }
.partie-intro { color: var(--encre-douce); max-width: 760px; margin: -10px 0 24px; }

.etape { display: grid; grid-template-columns: 1fr auto; gap: 36px; align-items: center; background: var(--feuille); border: 1px solid var(--trait); border-radius: 24px; padding: 28px 32px; margin-bottom: 20px; break-inside: avoid; page-break-inside: avoid; }
.etape:nth-of-type(even) { grid-template-columns: auto 1fr; }
.etape:nth-of-type(even) .figure { order: -1; }
.numero { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--correcteur); }
.etape h3 { font-size: clamp(22px, 2.6vw, 28px); margin: 6px 0 10px; }
.etape > div > p { color: var(--encre-douce); }
.actions { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.actions li { display: flex; gap: 12px; align-items: flex-start; }
.actions .rond { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--correcteur); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; margin-top: 1px; box-shadow: 0 0 0 4px var(--correcteur-pale); }
.actions .rond--simple { background: var(--encre); box-shadow: 0 0 0 4px #eef0f3; }
.astuce { margin-top: 16px; background: var(--vert-pale); border-radius: 14px; padding: 12px 14px; font-size: 14.5px; color: #15583b; }
.astuce strong { color: var(--vert); }
.attention { margin-top: 16px; background: #fff6e6; border-radius: 14px; padding: 12px 14px; font-size: 14.5px; color: #7a4a06; }

.faq { display: grid; gap: 10px; }
.faq details { background: var(--feuille); border: 1px solid var(--trait); border-radius: 16px; padding: 14px 18px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { color: var(--encre-douce); margin-top: 8px; font-size: 15px; }

.fin { margin-top: 56px; background: var(--encre); color: #fff; border-radius: 24px; padding: 32px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.fin h2 { font-size: 28px; }
.fin p { color: rgba(255, 255, 255, .78); margin-top: 6px; }
.fin a { background: #fff; color: var(--encre); text-decoration: none; font-weight: 600; border-radius: 12px; padding: 12px 18px; }
.pied { text-align: center; font-size: 13px; color: var(--ardoise); margin-top: 28px; }

@media (max-width: 820px) {
  .barre { position: static; }
  .barre-in { padding: 8px 12px; gap: 6px; }
  .barre a, .barre button { padding: 5px 10px; font-size: 13px; }
  .barre .masque-mobile { display: none; }
  .couverture-in { grid-template-columns: 1fr; }
  .couverture .ecran { display: none; }
  .etape, .etape:nth-of-type(even) { grid-template-columns: 1fr; padding: 22px 18px; gap: 22px; }
  .etape .figure, .etape:nth-of-type(even) .figure { order: 2; justify-self: center; }
}

@media print {
  @page { size: A4; margin: 12mm 12mm 14mm; }
  body { background: #fff; font-size: 11pt; }
  .barre, .sommaire a::after { display: none !important; }
  .couverture { border-radius: 0; break-after: page; }
  .couverture-in { padding: 34mm 10mm; grid-template-columns: 1.2fr .8fr; }
  .couverture .ecran { display: block; }
  .contenu { padding: 0; }
  .avant { break-after: page; }
  .sommaire { break-after: page; }
  .partie { margin-top: 0; break-before: page; }
  .etape { border: 1px solid var(--trait); padding: 16px 20px; gap: 22px; margin-bottom: 10px; grid-template-columns: 1fr auto !important; }
  .etape .figure { order: 2 !important; }
  .telephone { width: 200px; box-shadow: none; }
  .duo .telephone { width: 170px; }
  .faq details { break-inside: avoid; }
  .faq details:not([open]) p { display: block; }
  .fin { break-inside: avoid; }
}
