/* ==========================================================================
   FinRadar — funnel.css
   Le tunnel de la liste d'attente : la progression, les étapes, leur
   navigation, le récapitulatif. Sans JS, les étapes s'empilent ; js/funnel.js
   pose .is-stepped sur le formulaire et .is-current sur l'étape affichée.
   Champs et choix : form.css. Section, pass et modale : beta.css.
   Aucune couleur brute : tout vient de tokens.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tunnel — la progression, puis une étape à la fois
   -------------------------------------------------------------------------- */
.funnel {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.funnel__progress {
  display: none;
}

.is-stepped .funnel__progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  counter-reset: mark;
}

/* Trois segments : la barre au-dessus, « 1 · Banques » dessous. */
.funnel__mark {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2) var(--space-1);
  font-size: var(--fs-ui-xs);
  font-weight: var(--fw-bold);
  color: var(--c-text-faint);
  counter-increment: mark;
  transition: color var(--transition);
}

.funnel__mark::before {
  content: counter(mark) ' ·';
}

.funnel__mark::after {
  content: '';
  grid-row: 1;
  grid-column: 1 / -1;
  height: 4px;
  border-radius: var(--radius-pill);
  background-color: var(--c-line);
}

.funnel__mark[aria-current] {
  color: var(--c-text);
}

.funnel__mark.is-done::after,
.funnel__mark[aria-current]::after {
  background-image: var(--g-brand);
}

.funnel__step {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* Sans JS, les étapes se suivent, séparées d'un filet. */
.funnel__step + .funnel__step {
  padding-top: var(--space-6);
  border-top: 1px solid var(--c-line);
}

.is-stepped .funnel__step {
  padding-top: 0;
  border-top: 0;
}

.is-stepped .funnel__step:not(.is-current) {
  display: none;
}

/* Une <legend> n'est pas un élément flex : sa marge tient lieu d'écart. */
.funnel__q {
  margin-bottom: var(--space-5);
  padding: 0;
  font-size: var(--fs-ui-xl);
  font-weight: var(--fw-heavy);
  line-height: 1.25;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.funnel__hint {
  margin-top: calc(-1 * var(--space-3));
}

.funnel__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.funnel__group > .field__label {
  margin-bottom: var(--space-3);
}

.funnel__legal {
  font-size: var(--fs-ui-xs);
  line-height: 1.5;
  color: var(--c-text-faint);
}

.funnel__nav {
  display: flex;
  gap: var(--space-3);
}

.funnel__nav .btn {
  width: auto;
  max-width: none;
}

.funnel__nav .btn--primary {
  flex: 1;
}

.funnel__move {
  display: none;
}

.is-stepped .funnel__move {
  display: inline-flex;
}

/* Le récapitulatif de la dernière étape : vos banques, votre palier. */
.recap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: none;
  padding: var(--space-3);
  border: 1px dashed var(--c-accent-line);
  border-radius: var(--radius-md);
  background-color: var(--c-accent-soft);
}

.recap[hidden] {
  display: none;
}

.recap__logos {
  display: flex;
  flex: 0 0 auto;
  padding-right: var(--space-2);
}

.recap__logos img {
  width: 32px;
  height: 32px;
  margin-right: calc(-1 * var(--space-2));
  padding: 2px;
  border: 2px solid var(--c-bg);
  border-radius: var(--radius-sm);
  background-color: var(--c-panel-raised);
  object-fit: contain;
}

.recap__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.recap__plan {
  font-size: var(--fs-ui);
  color: var(--c-accent-light);
}

/* L'étape qui arrive monte en fondu, comme le reste du site. */
@media (prefers-reduced-motion: no-preference) {
  .is-stepped .is-current {
    animation: in var(--dur-in) var(--ease-out) both;
  }
}
