/* ==========================================================================
   Parcours en 6 étapes et conseils en 3 points (pages film et photo de
   mariage, onglets du bloc « L'expérience QR-cadre »)
   Icône + titre court + une ligne de preuve. À l'arrivée du bloc à l'écran,
   la ligne se dessine d'une étape à l'autre et chaque icône s'allume à son
   passage (une seule fois). Sans script ou avec « animations réduites »,
   tout est affiché d'emblée.
   Ordinateur : une rangée de 6 étapes. Téléphone et tablette : une colonne,
   ligne à gauche.
   ========================================================================== */
.pf-steps {
  --pf-node: 54px;
  --pf-gap: clamp(0.5rem, 1.6vw, 1.25rem);
  --pf-step: 0.42s;
  --pf-a: var(--qr-grad-1, #a78bfa);
  --pf-b: var(--qr-grad-2, #f472b6);
  --pf-accent: var(--qr-accent, #7c3aed);
  --pf-rail: rgba(124, 58, 237, 0.16);
  --pf-node-bg: #fff;
  list-style: none;
  margin: clamp(1.4rem, 3vw, 2.1rem) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: var(--pf-gap);
}

.pf-step {
  --pf-d: 0s;
  position: relative;
  margin: 0;
  padding: 0;
  text-align: center;
  min-width: 0;
}
.pf-step:nth-child(2) { --pf-d: calc(var(--pf-step) * 1); }
.pf-step:nth-child(3) { --pf-d: calc(var(--pf-step) * 2); }
.pf-step:nth-child(4) { --pf-d: calc(var(--pf-step) * 3); }
.pf-step:nth-child(5) { --pf-d: calc(var(--pf-step) * 4); }
.pf-step:nth-child(6) { --pf-d: calc(var(--pf-step) * 5); }

.pf-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--pf-node);
  height: var(--pf-node);
  margin: 0 auto;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--pf-a), var(--pf-accent));
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.28);
}
.pf-node svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pf-title {
  margin: 0.85rem 0 0.3rem;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  color: inherit;
  text-wrap: balance;
}
.pf-proof {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--qr-muted, #625d6b);
  text-wrap: balance;
}
/* Le fait marquant de l'étape, en étiquette au-dessus du détail. */
.pf-key {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pf-accent);
}
html[data-theme="dark"] .pf-key { color: #c7b8ff; }

/* Liaison vers l'étape suivante : rail clair, remplissage en couleur. */
.pf-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(var(--pf-node) / 2 - 1px);
  left: calc(50% + var(--pf-node) / 2 + 6px);
  width: calc(100% + var(--pf-gap) - var(--pf-node) - 12px);
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--pf-a), var(--pf-b)) 0 0 / 100% 100% no-repeat, var(--pf-rail);
}

/* ---- Animation : état d'attente, puis lecture (.is-run) ---- */
.pf-steps.is-ready .pf-node {
  color: var(--pf-accent);
  background: var(--pf-node-bg);
  box-shadow: inset 0 0 0 2px rgba(124, 58, 237, 0.22);
}
.pf-steps.is-ready .pf-title,
.pf-steps.is-ready .pf-proof {
  opacity: 0;
  transform: translateY(8px);
}
.pf-steps.is-ready .pf-step::after { background-size: 0% 100%; }

.pf-steps.is-run .pf-node {
  color: #fff;
  background: linear-gradient(135deg, var(--pf-a), var(--pf-accent));
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.28);
  transition: color 0.3s ease var(--pf-d), box-shadow 0.3s ease var(--pf-d), background 0s linear var(--pf-d);
  animation: pf-pop 0.55s ease-out var(--pf-d) both;
}
.pf-steps.is-run .pf-title,
.pf-steps.is-run .pf-proof {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s ease var(--pf-d), transform 0.45s ease var(--pf-d);
}
.pf-steps.is-run .pf-proof { transition-delay: calc(var(--pf-d) + 0.1s); }
.pf-steps.is-run .pf-step::after {
  background-size: 100% 100%;
  transition: background-size calc(var(--pf-step) - 0.08s) linear calc(var(--pf-d) + 0.08s);
}

/* ---- Variante « conseils » : 3 idées sans ordre, donc sans ligne ---- */
.pf-steps--tips {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 54rem;
  margin-inline: auto;
  column-gap: clamp(1rem, 3vw, 2.5rem);
}
.pf-steps--tips .pf-step:not(:last-child)::after { content: none; }

/* Lien vers une option, sous les conseils. */
.pf-more {
  margin: clamp(1.1rem, 2.4vw, 1.6rem) 0 0;
  text-align: center;
}

@keyframes pf-pop {
  0% { transform: scale(0.82); }
  55% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ---- Téléphone et tablette : une colonne, ligne à gauche ---- */
@media (max-width: 899px) {
  .pf-steps {
    --pf-node: 46px;
    grid-template-columns: minmax(0, 1fr);
    max-width: 30rem;
    margin-inline: auto;
  }
  .pf-step {
    display: grid;
    grid-template-columns: var(--pf-node) minmax(0, 1fr);
    column-gap: 0.95rem;
    align-items: center;
    padding-bottom: 1.05rem;
    text-align: left;
  }
  .pf-step:last-child { padding-bottom: 0; }
  .pf-node { grid-row: 1 / span 2; margin: 0; align-self: start; }
  .pf-title { margin: 0.2rem 0 0.15rem; align-self: end; text-wrap: pretty; }
  .pf-proof { align-self: start; text-wrap: pretty; }
  .pf-step:not(:last-child)::after {
    top: calc(var(--pf-node) + 5px);
    bottom: 5px;
    left: calc(var(--pf-node) / 2 - 1px);
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, var(--pf-a), var(--pf-b)) 0 0 / 100% 100% no-repeat, var(--pf-rail);
  }
  .pf-steps.is-ready .pf-step::after { background-size: 100% 0%; }
  .pf-steps.is-run .pf-step::after { background-size: 100% 100%; }
  .pf-steps--tips { grid-template-columns: minmax(0, 1fr); }
  .pf-steps--tips .pf-step { padding-bottom: 1.3rem; }
  .pf-steps--tips .pf-step:last-child { padding-bottom: 0; }
}

html[data-theme="dark"] .pf-steps {
  --pf-rail: rgba(199, 184, 255, 0.2);
  --pf-node-bg: #1b1352;
}
html[data-theme="dark"] .pf-steps.is-ready .pf-node { box-shadow: inset 0 0 0 2px rgba(199, 184, 255, 0.32); }

@media (prefers-reduced-motion: reduce) {
  .pf-steps.is-run .pf-node,
  .pf-steps.is-run .pf-title,
  .pf-steps.is-run .pf-proof,
  .pf-steps.is-run .pf-step::after { transition: none; animation: none; }
}

@media print {
  .pf-steps .pf-title,
  .pf-steps .pf-proof { opacity: 1 !important; transform: none !important; }
}
