/* P26M — Find a Provider: wizard shell, intro, progress, step nav.
 * Page-scoped (loads on /find-a-provider only). References base tokens.
 */

.finder {
    padding-block: var(--section-pad-y);
    position: relative;
    isolation: isolate;
}

/* Ambient-заливка секции — как у .roi-calc::before. Файл создан после
   де-крипто-прохода P26M-182, поэтому его откат сюда ничего не вернул:
   страница оставалась единственной без свечения. */
.finder::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 40% at 50% 0%,
            rgba(115, 196, 75, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 80% 80%,
            rgba(59, 91, 255, 0.06) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}
.finder__inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-7);
}

/* .finder__inner — flex-колонка, а margin-inline:auto у flex-элемента
   ОТКЛЮЧАЕТ растягивание по поперечной оси: блок схлопывается до содержимого.
   Поэтому центрируемым детям нужен явный width:100%, иначе max-width ниже
   не работает (shell схлопывался с 1320 до 605, прогресс — до 403, и подписи
   шагов налезали друг на друга). */
.finder__intro,
.finder__progress,
.finder__shell {
    width: 100%;
}

/* ── Intro ──────────────────────────────────────────────────────────────── */
/* Centered composition, matching .roi-calc__head (P26M-420: bring find-a-provider
   into the same visual family as the ROI calculator). */
.finder__intro {
    max-width: 720px;
    margin-inline: auto;
    text-align: center;
}
.finder__title {
    margin: var(--space-4) 0 var(--space-3);
    font-family: var(--font-display);
    font-size: var(--fs-4xl);
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-tight);
    text-wrap: balance;
}
.finder__lead {
    color: var(--color-text-secondary);
    font-size: var(--fs-lg);
    line-height: var(--lh-relaxed);
    max-width: 60ch;
    margin-inline: auto;
}

/* ── Progress rail ─────────────────────────────────────────────────────────
   Same visual language as .roi-calc__progress: compact, centered row of
   connected circles rather than a full-width wrap of pills. Kept as a
   page-scoped duplicate (not extracted to a shared file) because both shells
   are enqueued independently per-template — see STYLEGUIDE §15/§17. */
.finder__progress {
    display: flex;
    align-items: flex-start;
    gap: 0;
    /* Wider than .roi-calc__progress's 640px — 6 steps vs. 5 need more room
       per label before they'd collide. */
    max-width: 800px;
    margin-inline: auto;
    padding: 0 var(--space-4);
    list-style: none;
}
.finder__step-dot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
    flex: 1;
    min-width: 0;
}
.finder__step-dot:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 18px;
    left: calc(50% + 18px);
    right: calc(-50% + 18px);
    height: 2px;
    background: var(--color-border);
    transition: background var(--dur-slow) var(--ease-out);
}
.finder__step-dot[data-complete]::after {
    background: var(--color-brand);
}
.finder__step-num {
    width: 36px;
    height: 36px;
    margin-inline: auto;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: var(--color-elevated);
    display: grid;
    place-items: center;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--color-text-tertiary);
    transition: border-color var(--dur-base) var(--ease-out),
                background var(--dur-base) var(--ease-out),
                color var(--dur-base) var(--ease-out);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}
.finder__step-dot[aria-current="step"] .finder__step-num {
    border-color: var(--color-brand);
    background: rgba(115, 196, 75, 0.12);
    color: var(--color-brand);
}
.finder__step-dot[data-complete] .finder__step-num {
    border-color: var(--color-brand);
    background: var(--color-brand);
    color: var(--color-text-inverse);
}
.finder__step-label {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--color-text-tertiary);
    text-align: center;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    transition: color var(--dur-base) var(--ease-out);
    display: none;
    overflow-wrap: break-word;
    word-break: break-word;
}
@media (min-width: 640px) {
    .finder__step-label { display: block; }
}
.finder__step-dot[aria-current="step"] .finder__step-label { color: var(--color-brand); }
.finder__step-dot[data-complete] .finder__step-label { color: var(--color-text-secondary); }

/* ── Wizard shell ───────────────────────────────────────────────────────── */
.finder__shell {
    max-width: 1320px;
    margin-inline: auto;
    padding: clamp(var(--space-5), 4vw, var(--space-8));
    min-height: 420px;
    position: relative;
}
.finder__status {
    color: var(--color-text-tertiary);
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
}

/* ── Steps ──────────────────────────────────────────────────────────────── */
.finder__step {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    animation: finder-fade var(--dur-slow) var(--ease-out);
}
.finder__step[hidden] { display: none; }

@keyframes finder-fade {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

.finder__step-heading {
    font-family: var(--font-display);
    font-size: var(--fs-2xl);
    line-height: var(--lh-snug);
    letter-spacing: var(--tracking-tight);
    outline: none;
}
.finder__step-help {
    margin-top: calc(var(--space-2) * -1);
    color: var(--color-text-secondary);
    font-size: var(--fs-base);
}

/* ── Step nav ───────────────────────────────────────────────────────────── */
.finder__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: var(--border-thin);
}

.finder__noscript {
    color: var(--color-text-secondary);
    text-align: center;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .finder__step { animation: none; }
    .finder__step-dot::after { transition: none; }
    .finder__step-num { transition: none; }
}

/* Responsive */
@media (max-width: 640px) {
    .finder__nav { flex-direction: column-reverse; align-items: stretch; }
    .finder__nav .btn { width: 100%; }
}
