/* === PROGRESS STEPPER — План → Тест → Разбор === */

.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    user-select: none;
}

.stepper__step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    transition: color var(--transition), background var(--transition);
    white-space: nowrap;
}

.stepper__step:hover {
    color: var(--navy);
}

.stepper__info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-muted);
    opacity: 0.55;
    transition: opacity var(--transition), color var(--transition);
    margin-left: -4px;
}

.stepper__step:hover .stepper__info {
    opacity: 1;
    color: var(--blue);
}

.stepper__dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all var(--transition);
}

.stepper__label {
    font-weight: 500;
}

/* --- состояния --- */
.stepper__step--done .stepper__dot {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.stepper__step--done .stepper__label {
    color: var(--text-secondary);
}

.stepper__step--active .stepper__dot {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.stepper__step--active .stepper__label {
    color: var(--navy);
    font-weight: 700;
}

/* --- коннектор между шагами --- */
.stepper__connector {
    flex: 0 1 32px;
    height: 2px;
    background: var(--border);
    margin: 0 10px;
    border-radius: 2px;
}

.stepper__connector--done {
    background: var(--green);
}

/* --- mobile: labels всегда видны (иначе теряется контекст этапов 2/3) --- */
@media (max-width: 520px) {
    .stepper {
        font-size: 12.5px;
    }
    .stepper__step {
        gap: 6px;
    }
    .stepper__connector {
        flex: 0 1 14px;
        margin: 0 4px;
    }
    button.stepper__step {
        padding: 4px 6px;
    }
    /* Скрываем ⓘ на мобиле — этот класс был для экономии места, но мы отказались */
    .stepper__info {
        display: none;
    }
}

/* --- desktop: чуть крупнее --- */
@media (min-width: 768px) {
    .stepper {
        font-size: 14px;
    }
    .stepper__dot {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
    .stepper__connector {
        flex: 0 1 48px;
    }
}

/* === КЛИКАБЕЛЬНЫЕ КНОПКИ-ШАГИ === */
button.stepper__step {
    background: transparent;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    font: inherit;
    color: inherit;
    border-radius: 10px;
    transition: background var(--transition), transform var(--transition);
}

button.stepper__step:hover {
    background: rgba(13, 21, 91, 0.05);
}

button.stepper__step:active {
    transform: scale(0.97);
}

button.stepper__step:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

/* === OFFER-ПЛАШКА === */
.offer-bar {
    display: flex;
    justify-content: center;
    padding-top: 4px;
}

.offer-bar__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #fff6e0 0%, #ffe6c7 100%);
    border: 1px solid rgba(245, 166, 35, 0.3);
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 500;
    color: #8a5a10;
    cursor: default;
    font-family: inherit;
    transition: transform var(--transition), box-shadow var(--transition);
}

.offer-bar__btn--active {
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(245, 166, 35, 0.25);
}

.offer-bar__btn--active:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(245, 166, 35, 0.35);
}

.offer-bar__icon {
    font-size: 14px;
    line-height: 1;
    animation: offer-pulse 2.4s ease-in-out infinite;
}

@keyframes offer-pulse {
    0%, 100% { transform: scale(1) rotate(0); }
    50% { transform: scale(1.15) rotate(-8deg); }
}

.offer-bar__arrow {
    font-weight: 700;
    color: var(--navy);
}

@media (min-width: 768px) {
    .offer-bar__btn {
        font-size: 13.5px;
        padding: 9px 18px;
    }
}

/* === POPOVER (bottom sheet на mobile, modal на desktop) === */
.stepper-popover__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(13, 21, 91, 0.4);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 200;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.stepper-popover__backdrop--visible {
    opacity: 1;
}

.stepper-popover {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 201;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px 28px;
    box-shadow: 0 -8px 40px rgba(13, 21, 91, 0.2);
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.25, 1);
    max-width: 560px;
    margin: 0 auto;
}

.stepper-popover--visible {
    transform: translateY(0);
}

.stepper-popover__close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

.stepper-popover__close:hover {
    background: var(--border-light);
    color: var(--text);
}

.stepper-popover__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 12px;
    padding-right: 36px;
    line-height: 1.3;
}

.stepper-popover__desc {
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.stepper-popover__time {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
    background: var(--bg-light);
    padding: 6px 12px;
    border-radius: 999px;
}

/* Desktop: центрированный modal, не bottom sheet */
@media (min-width: 640px) {
    .stepper-popover {
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translate(-50%, calc(-50% + 20px));
        max-width: 440px;
        width: calc(100% - 40px);
        border-radius: 16px;
        opacity: 0;
        transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.2, 0.9, 0.25, 1);
        padding: 28px 28px 28px;
    }
    .stepper-popover--visible {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
    .stepper-popover__title {
        font-size: 20px;
    }
}
