/* ==========================================================================
   LastCommit — Page « Comment ça marche » (parcours Avant / Après)

   Toutes les règles de ce fichier sont préfixées par « .commentcamarche »,
   la classe portée par le conteneur de contenu de la page. Rien n'en sort,
   rien n'est redéfini ailleurs : css/style.css reste intact et les autres
   pages du template ne sont pas impactées.

   Les noms de classes internes sont également préfixés « lp- » pour ne pas
   entrer en collision avec les composants existants (.step, .steps…).
   ========================================================================== */

.commentcamarche {
  --accent:        var(--violet);
  --accent-soft:   #efeafe;
  --accent-tint:   #f7f5ff;
  --green:         #10b981;
  --green-600:     #0f9c74;
  --green-soft:    #dcfaee;
  --green-tint:    #f2fbf7;
  --rule:          #f0eff7;
}

/* ==========================================================================
   1. Cadres de captures d'écran
   Chaque capture est recadrée via 3 variables exprimées en fraction de
   l'image source :  --cx (bord gauche), --cy (bord haut), --cw (largeur).
   La hauteur visible découle du ratio du cadre (--ar).
   ========================================================================== */

.commentcamarche .shot {
  --cx: 0;
  --cy: 0;
  --cw: 1;
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--ar, 4 / 3);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(33, 29, 71, .07);
  margin: 0;
}
.commentcamarche .shot img {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% / var(--cw));
  max-width: none;
  transform: translate(calc(var(--cx) * -100%), calc(var(--cy) * -100%));
}

/* Fenêtre composée : bandeau applicatif + contenu, dans un seul cadre */
.commentcamarche .shot-window {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-lg);
  margin: 0;
}
.commentcamarche .shot-window .shot {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.commentcamarche .shot-window .shot + .shot { border-top: 1px solid #f1f0f8; }

/* ==========================================================================
   2. Hero
   ========================================================================== */

.commentcamarche .lp-hero {
  position: relative;
  padding: 64px 0 72px;
  background:
    radial-gradient(1200px 420px at 78% -10%, #f0ecff 0%, rgba(240, 236, 255, 0) 70%),
    linear-gradient(180deg, #fbfaff 0%, #ffffff 100%);
  overflow: hidden;
}
.commentcamarche .lp-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 46%) minmax(0, 54%);
  align-items: center;
  gap: 56px;
}

.commentcamarche .lp-hero h1 {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -.03em;
  color: var(--navy);
}
.commentcamarche .lp-hero-lead {
  margin-top: 20px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 38ch;
}

.commentcamarche .lp-hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.commentcamarche .lp-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: .95rem;
  color: var(--ink);
  transition: color .18s ease;
}
.commentcamarche .lp-link-arrow i {
  font-size: .8rem;
  color: var(--violet);
  transition: transform .18s ease;
}
.commentcamarche .lp-link-arrow:hover { color: var(--violet); }
.commentcamarche .lp-link-arrow:hover i { transform: translateX(4px); }

/* Les 4 promesses sous les boutons */
.commentcamarche .lp-usp {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 42px 0 0;
  padding: 0;
  list-style: none;
  max-width: 512px;
}
.commentcamarche .lp-usp li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 9px;
}
.commentcamarche .lp-usp-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1.5px solid #e4e0f7;
  background: #fff;
  color: var(--violet);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
}
.commentcamarche .lp-usp li > span:last-child {
  font-size: .72rem;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 500;
}

.commentcamarche .lp-hero-shot { position: relative; z-index: 0; }
.commentcamarche .lp-hero-shot::before {
  content: "";
  position: absolute;
  inset: -26px -26px -18px -18px;
  border-radius: 32px;
  background: linear-gradient(140deg, rgba(109, 94, 252, .10), rgba(109, 94, 252, 0) 60%);
  z-index: -1;
}

/* ==========================================================================
   3. Phases « AVANT » / « APRÈS »
   ========================================================================== */

.commentcamarche .lp-phase { padding: 14px 0; }

.commentcamarche .lp-phase-card {
  border-radius: 26px;
  background: var(--accent-tint);
  padding: 26px;
}
.commentcamarche .lp-phase--after {
  --accent: var(--green);
  --accent-soft: var(--green-soft);
  --accent-tint: var(--green-tint);
}

.commentcamarche .lp-phase-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: -26px -26px 0;
  padding: 26px 30px 22px;
  border-radius: 26px 26px 0 0;
  overflow: hidden;
}
.commentcamarche .lp-phase-ico {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  box-shadow: 0 8px 18px rgba(33, 29, 71, .12);
}
.commentcamarche .lp-phase-label {
  display: block;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}
.commentcamarche .lp-phase-sub {
  font-size: .9rem;
  color: var(--muted);
  margin: 2px 0 0;
}

/* Paysage décoratif du bandeau « APRÈS » */
.commentcamarche .lp-phase-scenery {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(58%, 640px);
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 24%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 24%);
}
.commentcamarche .lp-phase-scenery svg { width: 100%; height: 100%; display: block; }
.commentcamarche .lp-phase-head > *:not(.lp-phase-scenery) { position: relative; z-index: 1; }

/* Corps : la barre verticale colorée + la grille des étapes */
.commentcamarche .lp-phase-body {
  position: relative;
  background: #fff;
  border-radius: 18px;
  padding: 30px 30px 30px 34px;
}
.commentcamarche .lp-phase-body::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

/* ==========================================================================
   4. Étapes
   ========================================================================== */

.commentcamarche .lp-steps {
  display: grid;
  gap: 34px 44px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.commentcamarche .lp-steps--two {
  grid-template-columns: 1fr 1fr;
  background-image: linear-gradient(var(--rule), var(--rule));
  background-size: 1px calc(100% - 12px);
  background-position: center 6px;
  background-repeat: no-repeat;
}
.commentcamarche .lp-steps--three {
  grid-template-columns: repeat(3, 1fr);
  background-image:
    linear-gradient(var(--rule), var(--rule)),
    linear-gradient(var(--rule), var(--rule));
  background-size: 1px calc(100% - 12px), 1px calc(100% - 12px);
  background-position: 33.333% 6px, 66.666% 6px;
  background-repeat: no-repeat;
}

.commentcamarche .lp-step {
  min-width: 0;
  max-width: none;
  flex: none;
  text-align: left;
}
.commentcamarche .lp-step-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.commentcamarche .lp-step-num {
  position: static;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.commentcamarche .lp-step-head h3 {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--navy);
  margin: 0;
}
.commentcamarche .lp-step-text {
  font-size: .875rem;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
}

/* Étapes « AVANT » : texte à gauche, capture à droite */
.commentcamarche .lp-steps--two .lp-step {
  display: grid;
  grid-template-columns: minmax(0, 43%) minmax(0, 57%);
  gap: 24px;
  align-items: start;
}
.commentcamarche .lp-steps--two .lp-step-copy { padding-top: 2px; }

/* Étapes « APRÈS » : texte au-dessus, capture(s) en dessous */
.commentcamarche .lp-steps--three .lp-step-media { margin-top: 20px; }

/* ==========================================================================
   5. Bloc de conclusion
   ========================================================================== */

.commentcamarche .lp-closing { padding: 22px 0 64px; }
.commentcamarche .lp-closing-card {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: linear-gradient(180deg, #f3f0fd 0%, #ebe7fa 100%);
  padding: 64px 56px 76px;
}
.commentcamarche .lp-closing-scenery {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.commentcamarche .lp-closing-scenery svg { width: 100%; height: 100%; display: block; }

.commentcamarche .lp-closing-inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
}
.commentcamarche .lp-closing h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.05rem);
  font-weight: 800;
  line-height: 1.24;
  letter-spacing: -.02em;
  color: var(--navy);
  max-width: 22ch;
}
.commentcamarche .lp-closing-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 40px;
  margin-top: 22px;
}
.commentcamarche .lp-closing-row p {
  font-size: .95rem;
  line-height: 1.75;
  color: var(--muted);
  max-width: 46ch;
}

/* ==========================================================================
   6. Responsive
   ========================================================================== */

@media (max-width: 1080px) {
  .commentcamarche .lp-hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .commentcamarche .lp-hero-lead { max-width: 56ch; }
  .commentcamarche .lp-usp { max-width: 560px; }
  .commentcamarche .lp-steps--three { grid-template-columns: 1fr 1fr; background-image: none; }
  .commentcamarche .lp-steps--three .lp-step:last-child { grid-column: 1 / -1; max-width: 50%; }
}

@media (max-width: 860px) {
  .commentcamarche .lp-hero { padding: 44px 0 52px; }
  .commentcamarche .lp-phase-card { padding: 18px; border-radius: 22px; }
  .commentcamarche .lp-phase-head { margin: -18px -18px 0; padding: 20px 20px 18px; border-radius: 22px 22px 0 0; }
  .commentcamarche .lp-phase-body { padding: 24px 20px 24px 24px; }
  .commentcamarche .lp-phase-scenery { width: 46%; opacity: .8; }
  .commentcamarche .lp-steps { gap: 30px; }
  .commentcamarche .lp-steps--two,
  .commentcamarche .lp-steps--three { grid-template-columns: 1fr; background-image: none; }
  .commentcamarche .lp-steps--three .lp-step:last-child { max-width: none; }
  .commentcamarche .lp-closing-card { padding: 44px 26px 56px; }
  .commentcamarche .lp-closing-row { grid-template-columns: 1fr; align-items: start; gap: 26px; }
}

@media (max-width: 620px) {
  .commentcamarche .lp-usp { grid-template-columns: 1fr 1fr; gap: 18px; }
  .commentcamarche .lp-steps--two .lp-step { grid-template-columns: 1fr; gap: 16px; }
  .commentcamarche .lp-hero-actions { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .commentcamarche .lp-link-arrow,
  .commentcamarche .lp-link-arrow i { transition: none; }
}

/* ==========================================================================
   7. Lightbox des captures d'écran
   La lightbox est créée par js/comment-ca-marche.js *à l'intérieur* du
   conteneur .commentcamarche : les règles restent donc scopées comme le
   reste du fichier. Seule exception, `body.ccm-lightbox-open` (blocage du
   défilement de l'arrière-plan) : nom unique, aucune règle existante n'est
   redéfinie.
   ========================================================================== */

/* --- Affordance sur les captures --------------------------------------- */

.commentcamarche .ccm-zoomable {
  transition: box-shadow .2s ease, transform .2s ease;
}
.commentcamarche .ccm-zoomable:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(33, 29, 71, .16);
}
.commentcamarche .shot-window.ccm-zoomable:hover {
  box-shadow: 0 30px 70px rgba(33, 29, 71, .22);
}

.commentcamarche .ccm-zoom-btn {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: inherit;
}
.commentcamarche .ccm-zoom-btn:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}
.commentcamarche .ccm-zoom-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .94);
  color: var(--violet);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  box-shadow: 0 6px 16px rgba(33, 29, 71, .2);
  opacity: 0;
  transform: translateY(5px);
  transition: opacity .18s ease, transform .18s ease;
}
.commentcamarche .ccm-zoomable:hover .ccm-zoom-badge,
.commentcamarche .ccm-zoom-btn:focus-visible .ccm-zoom-badge {
  opacity: 1;
  transform: none;
}

/* --- Fenêtre modale ---------------------------------------------------- */

body.ccm-lightbox-open { overflow: hidden; }

.commentcamarche .ccm-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 68px;
  opacity: 0;
  transition: opacity .2s ease;
}
.commentcamarche .ccm-lightbox[hidden] { display: none; }
.commentcamarche .ccm-lightbox.is-open { opacity: 1; }

.commentcamarche .ccm-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 48, .78);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}

.commentcamarche .ccm-lightbox-inner {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.commentcamarche .ccm-lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: rgba(255, 255, 255, .8);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
}
.commentcamarche .ccm-lightbox-close {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 0;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .18s ease;
}
.commentcamarche .ccm-lightbox-close:hover { background: rgba(255, 255, 255, .28); }

.commentcamarche .ccm-lightbox-frame {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.commentcamarche .ccm-lightbox-scroll {
  max-height: 76vh;
  overflow: auto;
  overscroll-behavior: contain;
}
.commentcamarche .ccm-lightbox-scroll img {
  width: 100%;
  height: auto;
  max-width: none;
  display: block;
}

.commentcamarche .ccm-lightbox-caption {
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: .84rem;
  line-height: 1.5;
  text-align: center;
}

.commentcamarche .ccm-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .18s ease;
}
.commentcamarche .ccm-lightbox-nav:hover { background: rgba(255, 255, 255, .3); }
.commentcamarche .ccm-lightbox-prev { left: 14px; }
.commentcamarche .ccm-lightbox-next { right: 14px; }
.commentcamarche .ccm-lightbox-nav[hidden] { display: none; }

@media (max-width: 720px) {
  .commentcamarche .ccm-lightbox { padding: 3vh 12px 76px; }
  .commentcamarche .ccm-lightbox-scroll { max-height: 68vh; }
  .commentcamarche .ccm-lightbox-nav { top: auto; bottom: 16px; transform: none; }
  .commentcamarche .ccm-lightbox-prev { left: calc(50% - 56px); }
  .commentcamarche .ccm-lightbox-next { right: calc(50% - 56px); }
}

@media (prefers-reduced-motion: reduce) {
  .commentcamarche .ccm-zoomable,
  .commentcamarche .ccm-zoom-badge,
  .commentcamarche .ccm-lightbox { transition: none; }
  .commentcamarche .ccm-zoomable:hover { transform: none; }
}
