/* ============================================
   STAGES ANIMATION OVERRIDE
   ============================================ */

/* Фоновая линия (серая) */
.stages-list::after {
    content: '';
    position: absolute;
    top: 19px;
    left: 19px;
    right: 19px;
    height: 2px;
    background: rgba(255,255,255,0.08);
    z-index: 0;
}

/* Прогресс-линия (акцентная, анимируется) */
.stages-list::before {
    content: '';
    position: absolute;
    top: 19px;
    left: 19px;
    width: 0 !important;
    height: 2px;
    background: var(--accent);
    z-index: 1;
    transition: width 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.stages-list.stages-animated::before {
    width: calc(100% - 38px) !important;
}

/* Значок — начальное состояние (серый) */
.stage__badge {
    border: 2px solid rgba(255,255,255,0.15) !important;
    color: rgba(255,255,255,0.2) !important;
    background: var(--bg2) !important;
    transition: border-color 0.4s ease, background 0.4s ease, color 0.4s ease,
                box-shadow 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* Значок активирован */
.stage.stage--active .stage__badge {
    border-color: var(--accent) !important;
    color: var(--text) !important;
    transform: scale(1.12);
    box-shadow: 0 0 0 4px rgba(20, 86, 255, 0.15);
}

/* Последний этап активирован */
.stage--last.stage--active .stage__badge {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
    box-shadow: 0 0 0 6px rgba(20, 86, 255, 0.2), 0 0 24px rgba(20, 86, 255, 0.45) !important;
}

/* Заголовок и текст — появляются снизу */
.stage__title,
.stage__text {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.stage.stage--active .stage__title {
    opacity: 1;
    transform: none;
}
.stage.stage--active .stage__text {
    opacity: 1;
    transform: none;
    transition-delay: 0.08s;
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .stages-list::before { transition: none !important; width: calc(100% - 38px) !important; }
    .stage__badge { transition: none !important; }
    .stage__title, .stage__text { transition: none; opacity: 1; transform: none; }
}

/* ============================================
   MOBILE: вертикальная линия и анимация
   ============================================ */
@media (max-width: 600px) {
    /* Серая фоновая линия — вертикальная */
    .stages-list::after {
        top: 19px;
        bottom: 19px;
        left: 19px;
        right: auto;
        width: 2px;
        height: auto;
        transform: none;
    }

    /* Прогресс-линия — анимируется по высоте, не по ширине */
    .stages-list::before {
        top: 19px !important;
        left: 19px !important;
        right: auto !important;
        width: 2px !important;
        height: 0 !important;
        transform: none !important;
        transition: height 1.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    .stages-list.stages-animated::before {
        width: 2px !important;
        height: calc(100% - 19px) !important;
    }

    @media (prefers-reduced-motion: reduce) {
        .stages-list::before { transition: none !important; height: calc(100% - 19px) !important; }
    }
}
