/* ─── Guide /comment-ca-marche (19.11.2026) ───────────────────────────────
   Choix « J'achète / Je vends », puis une fiche illustrée par étape. Les
   illustrations sont des SVG en ligne animés en CSS : rien à télécharger,
   suivent le thème clair/sombre (currentColor + variables), et s'arrêtent
   net avec prefers-reduced-motion (on montre l'état final). Les animations
   ne partent qu'à l'écran (classe .vu posée par public/js/guide.js) ; sans
   JS, les deux parcours sont visibles et les fiches statiques. */

.content-block:has(> .guide) { max-width: 1080px; }
.guide { --g-pad: clamp(18px, 14px + 1.2vw, 26px); }
.guide-head { max-width: 760px; }

/* ── Choix du parcours ─────────────────────────────────────────────── */
.guide-choix { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 26px 0 8px; }
.guide-choix button {
  all: unset; box-sizing: border-box; cursor: pointer; position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px;
  padding: 18px 20px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line-2);
  box-shadow: var(--lift-hi), var(--shadow); transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.guide-choix button:hover { transform: translateY(-2px); box-shadow: var(--lift-hi), var(--shadow-lg); }
.guide-choix button:focus-visible { box-shadow: var(--ring); }
.guide-choix button[aria-selected="true"] { border-color: var(--or); background: linear-gradient(160deg, var(--surface) 30%, var(--accent-wash)); }
.guide-choix .gc-ico { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--nap); color: var(--or); }
.guide-choix .gc-ico svg { width: 28px; height: 28px; }
.guide-choix b { display: block; font-family: var(--font-display); font-size: 1.22rem; color: var(--text); line-height: 1.2; }
.guide-choix small { display: block; color: var(--muted); font-size: .9rem; margin-top: 3px; }
.guide-choix button[aria-selected="true"]::after {
  content: ""; position: absolute; right: 16px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--or);
  box-shadow: 0 0 0 4px var(--accent-wash);
}
@media (max-width: 560px) {
  .guide-choix { grid-template-columns: 1fr; }
}

/* Sans JS : tout est visible. Avec JS : un seul parcours. */
.guide.js .guide-parcours[hidden] { display: none; }
.guide-parcours { margin-top: 30px; }
.guide-parcours + .guide-parcours { margin-top: 56px; }
.guide.js .guide-parcours + .guide-parcours { margin-top: 30px; }
.guide-parcours > h2 { font-family: var(--font-display); font-size: clamp(1.4rem, 1.2rem + .8vw, 1.9rem); margin: 0 0 6px; }
.guide-total { display: inline-flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: .98rem; margin: 0 0 22px; }
.guide-total .icon { color: var(--or); width: 18px; height: 18px; }
.guide.js .guide-parcours:not([hidden]) { animation: g-entre .45s var(--ease) both; }
@keyframes g-entre { from { transform: translateY(10px); } }

/* ── Fiches ────────────────────────────────────────────────────────── */
.guide-fiches { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); counter-reset: fiche; }
.guide-fiches.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .guide-fiches.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .guide-fiches { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 521px) and (max-width: 720px) { .guide-fiches.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .guide-fiches.n4 { grid-template-columns: minmax(0, 1fr); } }
.guide-fiche {
  counter-increment: fiche; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; box-shadow: var(--lift-hi), var(--shadow);
  opacity: 0; transform: translateY(16px); transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.guide:not(.js) .guide-fiche, .guide-fiche.apparue { opacity: 1; transform: none; }
.guide-fiche:nth-child(2) { transition-delay: .08s; } .guide-fiche:nth-child(3) { transition-delay: .16s; } .guide-fiche:nth-child(4) { transition-delay: .24s; }
.guide-scene { position: relative; aspect-ratio: 16 / 10; background: var(--nap); color: var(--or); display: grid; place-items: center; overflow: hidden; }
.guide-scene::before {
  content: counter(fiche, decimal-leading-zero); position: absolute; left: 14px; top: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: .95rem; color: var(--or-deep); opacity: .75;
}
:root[data-theme="dark"] .guide-scene::before { color: var(--blush); }
.guide-scene svg { width: 78%; height: 86%; overflow: visible; }
.guide-duree {
  position: absolute; right: 12px; top: 10px; display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface); color: var(--text); border-radius: 999px; padding: 4px 10px 4px 8px; font-size: .78rem; font-weight: 600;
  box-shadow: 0 4px 14px -6px rgba(70,25,30,.35);
}
.guide-duree .icon { width: 14px; height: 14px; color: var(--or); }
.guide-fiche-corps { padding: 16px var(--g-pad) 20px; }
.guide-fiche h3 { font-family: var(--font-display); font-size: 1.15rem; margin: 0 0 6px; color: var(--text); }
.guide-fiche p { margin: 0; color: var(--text-dim); line-height: 1.55; font-size: .97rem; }

/* ── Confiance ─────────────────────────────────────────────────────── */
.guide-confiance { margin-top: 56px; }
.guide-confiance > h2, .guide-tarif > h2 { font-family: var(--font-display); font-size: clamp(1.3rem, 1.15rem + .6vw, 1.7rem); margin: 0 0 18px; }
.guide-badges { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 720px) { .guide-badges { grid-template-columns: minmax(0, 1fr); } }
.guide-badge { display: grid; grid-template-columns: 54px 1fr; gap: 14px; align-items: start; padding: 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.guide-badge .gb-ico { width: 54px; height: 54px; border-radius: 14px; background: var(--nap); color: var(--or); display: grid; place-items: center; }
.guide-badge .gb-ico svg { width: 34px; height: 34px; overflow: visible; }
.guide-badge b { display: block; color: var(--text); margin-bottom: 3px; }
.guide-badge span { color: var(--text-dim); font-size: .94rem; line-height: 1.5; }
.guide-plus { margin-top: 14px; }

.guide-tarif { margin-top: 48px; max-width: 760px; }

/* ═══ Animations des scènes ═══════════════════════════════════════════
   Trait : currentColor (rouge Weared) ; aplats : --surface ; détails : --muted.
   Tout est en boucle douce (≈ 4–6 s), décalée pour ne pas clignoter ensemble. */
.gs-fond { fill: var(--surface); }
.gs-trait { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.gs-fin { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.gs-plein { fill: currentColor; }
.gs-doux { fill: var(--blush); }
:root[data-theme="dark"] .gs-doux { fill: var(--grenat); }
.gs-texte { fill: var(--text); font-family: var(--font-display); font-weight: 700; }

.vu .gs-anim, .guide:not(.js) .gs-anim { animation-play-state: running; }
.gs-anim { animation-play-state: paused; transform-box: fill-box; transform-origin: center; }

/* choisir : la tuile choisie se soulève, le cœur bat */
.gs-tuile-choisie { animation: g-souleve 4s var(--ease) infinite; }
.gs-coeur { animation: g-bat 4s var(--ease) infinite; }
.gs-doigt { animation: g-tape 4s var(--ease) infinite; }
@keyframes g-souleve { 0%, 30% { transform: none; } 40%, 85% { transform: translateY(-4px) scale(1.06); } 100% { transform: none; } }
@keyframes g-bat { 0%, 38% { transform: scale(0); opacity: 0; } 46% { transform: scale(1.3); opacity: 1; } 54%, 85% { transform: scale(1); opacity: 1; } 100% { transform: scale(0); opacity: 0; } }
@keyframes g-tape { 0% { transform: translate(30px, 30px); opacity: 0; } 20% { opacity: 1; } 34% { transform: none; } 40% { transform: scale(.9); } 46%, 70% { transform: none; opacity: 1; } 90%, 100% { transform: translate(30px, 30px); opacity: 0; } }

/* payer : la carte glisse, le cadenas se ferme, la coche se trace */
.gs-carte { animation: g-glisse 4.5s var(--ease) infinite; }
.gs-anse { animation: g-ferme 4.5s var(--ease) infinite; }
.gs-coche { stroke-dasharray: 40; stroke-dashoffset: 40; animation: g-trace 4.5s var(--ease) infinite; }
@keyframes g-glisse { 0% { transform: translateX(-46px); opacity: 0; } 15% { opacity: 1; } 35%, 88% { transform: none; opacity: 1; } 100% { transform: none; opacity: 0; } }
@keyframes g-ferme { 0%, 38% { transform: translateY(-6px); } 46%, 100% { transform: none; } }
@keyframes g-trace { 0%, 50% { stroke-dashoffset: 40; } 64%, 90% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }

/* recevoir / envoyer : le colis roule le long du trajet */
.gs-colis-route { animation: g-route 5s var(--ease) infinite; }
.gs-trajet { stroke-dasharray: 5 7; animation: g-pointille 1.2s linear infinite; }
.gs-pin { animation: g-pin 5s var(--ease) infinite; }
@keyframes g-route { 0% { transform: translateX(0); } 70%, 100% { transform: translateX(118px); } }
@keyframes g-pointille { to { stroke-dashoffset: -24; } }
@keyframes g-pin { 0%, 62% { transform: translateY(-8px); opacity: .35; } 72%, 100% { transform: none; opacity: 1; } }

/* vérifier : la ligne de lecture balaie le visage, la pièce entre, le badge apparaît */
.gs-balai { animation: g-balai 3.2s ease-in-out infinite alternate; }
.gs-piece { animation: g-piece 6s var(--ease) infinite; }
.gs-badge { animation: g-bat 6s var(--ease) infinite; }
@keyframes g-balai { from { transform: translateY(-26px); } to { transform: translateY(26px); } }
@keyframes g-piece { 0%, 10% { transform: translateX(40px) rotate(8deg); opacity: 0; } 25%, 85% { transform: rotate(-6deg); opacity: 1; } 100% { transform: translateX(40px) rotate(8deg); opacity: 0; } }

/* publier : les photos tombent dans la grille, l'étiquette prix se pose */
.gs-photo { animation: g-tombe 5s var(--ease) infinite; }
.gs-photo.p2 { animation-delay: .25s; } .gs-photo.p3 { animation-delay: .5s; }
.gs-prix { animation: g-bat 5s var(--ease) infinite; animation-delay: .4s; }
@keyframes g-tombe { 0% { transform: translateY(-30px); opacity: 0; } 18%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; } }

/* envoyer : étiquette collée, deux flashs (colis + étiquette) */
.gs-etiquette { animation: g-colle 5s var(--ease) infinite; }
.gs-flash { opacity: 0; animation: g-flash 5s linear infinite; }
.gs-flash.f2 { animation-delay: .6s; }
@keyframes g-colle { 0%, 10% { transform: translate(-20px, -24px) rotate(-14deg); opacity: 0; } 28%, 90% { transform: none; opacity: 1; } 100% { opacity: 0; } }
@keyframes g-flash { 0%, 44% { opacity: 0; } 47% { opacity: .95; } 56%, 100% { opacity: 0; } }

/* encaisser : les pièces tombent, la jauge monte */
.gs-piecette { animation: g-chute 3.6s cubic-bezier(.5,0,.7,1) infinite; }
.gs-piecette.c2 { animation-delay: .5s; } .gs-piecette.c3 { animation-delay: 1s; }
.gs-jauge { transform-origin: left center; animation: g-jauge 3.6s var(--ease) infinite; }
@keyframes g-chute { 0% { transform: translateY(-40px); opacity: 0; } 15% { opacity: 1; } 55%, 100% { transform: none; opacity: 0; } 50% { opacity: 1; } }
@keyframes g-jauge { 0% { transform: scaleX(.15); } 70%, 100% { transform: scaleX(1); } }

/* badges confiance : petite respiration au survol / à l'apparition */
.guide-badge .gb-ico svg { transition: transform var(--dur) var(--ease); }
.guide-badge:hover .gb-ico svg { transform: scale(1.12) rotate(-4deg); }

@media (prefers-reduced-motion: reduce) {
  .guide-fiche { opacity: 1; transform: none; transition: none; }
  .guide.js .guide-parcours:not([hidden]) { animation: none; }
  .gs-anim, .gs-trajet { animation: none !important; opacity: 1 !important; transform: none !important; }
  .gs-coche { stroke-dashoffset: 0; }
  .gs-flash, .gs-doigt { opacity: 0 !important; }
}
