/*
 * Кодовый шаблон «Квиз» — самодостаточные стили.
 *
 * Приоритет над глобальными стилями сайта: все правила скоупятся
 * через два якоря `.ast-quiz .container--xl` (специфичность 0,3,0+),
 * таблица подключается в <head> последней. Брейкпоинты макета:
 * md 767.98px, lg 991.98px.
 */

/* ===== Контейнер (scoped: не влияет на контейнеры сайта) ===== */

.ast-quiz .container {
    max-width: 1320px;
    margin-inline: auto;
    padding-inline: 20px;
}

.ast-quiz .container--xl {
    max-width: 1440px;
    margin-inline: auto;
}

/* ===== Локальный ресет: гасим типографику сайта внутри блока ===== */

.ast-quiz .container--xl section,
.ast-quiz .container--xl h2,
.ast-quiz .container--xl h3,
.ast-quiz .container--xl p,
.ast-quiz .container--xl label,
.ast-quiz .container--xl ul,
.ast-quiz .container--xl li {
    margin: 0;
    padding: 0;
}

.ast-quiz .container--xl ul {
    list-style: none;
}

.ast-quiz .container--xl img {
    max-width: 100%;
}

.ast-quiz .container--xl button,
.ast-quiz .container--xl input {
    font-family: inherit;
    letter-spacing: normal;
}

/* ===== Обёртка ===== */

.ast-quiz {
    padding: 44px 0;
    overflow: hidden;
    font-family: inherit;
    color: #050E38;
}

@media (max-width: 991.98px) {
    .ast-quiz .container {
        padding-inline: 16px;
    }
}

/* ===== Секция ===== */

.ast-quiz .container--xl .quiz-section {
    display: flex;
    gap: 24px;
    align-items: stretch;
    padding: 0;
}

.ast-quiz .container--xl .quiz-section__info-column {
    flex: 1;
    max-width: 553px;
}

/* ===== Бейджи ===== */

.ast-quiz .container--xl .quiz-section__badge-list {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: nowrap;
    width: max-content;
    max-width: none;
}

.ast-quiz .container--xl .quiz-section__badge {
    display: inline-flex;
    align-items: center;
    background: #F0F3FF;
    padding: 9px 16px;
    border-radius: 20px;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    line-height: 120%;
    color: #0338EE;
    white-space: nowrap;
}

/* ===== Заголовок / подзаголовок ===== */

.ast-quiz .container--xl .quiz-section__main-title {
    font-size: 30px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 24px;
    color: #050E38;
}

.ast-quiz .container--xl .quiz-section__main-subtitle {
    font-weight: 400;
    font-size: 18px;
    line-height: 140%;
    color: #050E38;
    max-width: 520px;
    margin: 0 0 40px;
}

/* ===== Плашка на мобильных ===== */

.ast-quiz .container--xl .quiz-section__mob {
    display: none;
}

/* ===== Фичи ===== */

.ast-quiz .container--xl .quiz-section__features-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
}

.ast-quiz .container--xl .quiz-section__feature-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.ast-quiz .container--xl .quiz-section__feature-icon {
    width: 52px;
    min-width: 52px;
    height: 52px;
    background-color: #F0F3FF;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ast-quiz .container--xl .quiz-section__feature-icon svg,
.ast-quiz .container--xl .quiz-section__feature-icon img {
    width: 28px;
    height: 28px;
}

.ast-quiz .container--xl .quiz-section__feature-text h3 {
    font-weight: 700;
    font-size: 20px;
    line-height: 110%;
    letter-spacing: -0.02em;
    color: #000733;
    margin: 0 0 8px;
}

.ast-quiz .container--xl .quiz-section__feature-text p {
    font-weight: 400;
    font-size: 18px;
    line-height: 140%;
    color: #000733;
    max-width: 412px;
    margin: 0;
}

/* ===== Кнопки / сноска ===== */

.ast-quiz .container--xl .quiz-section__actions-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 498px;
}

.ast-quiz .container--xl .quiz-section__buttons-group {
    display: flex;
    gap: 16px;
    align-items: center;
}

.ast-quiz .container--xl .quiz-section__footnote {
    font-weight: 400;
    font-size: 12px;
    line-height: 18px;
    color: #7A7D87;
}

/* ===== Кнопки (ast-btn — чтобы не пересекаться со стилями сайта) ===== */

.ast-quiz .container--xl .ast-btn {
    appearance: none;
    outline: none;
    box-shadow: none;
    white-space: nowrap;
    max-width: 100%;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 15px 31px;
    background: linear-gradient(180deg, #FF8219 0%, #FD5B10 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: #fff;
    font-family: inherit;
    font-weight: 400;
    font-size: 18px;
    line-height: 150%;
    transition: all .2s;
}

.ast-quiz .container--xl .ast-btn:hover {
    filter: brightness(1.07);
}

.ast-quiz .container--xl .ast-btn--secondary {
    background: #0028B1;
    border: 1px solid #0028B1;
}

.ast-quiz .container--xl .ast-btn--secondary:hover {
    background: #0338EE;
    filter: none;
}

.ast-quiz .container--xl .ast-btn--outline {
    background: transparent;
    border: 1px solid #0028B1;
    color: #0028B1;
}

.ast-quiz .container--xl .ast-btn--outline-light {
    border-color: #fff;
    color: #fff;
}

.ast-quiz .container--xl .quiz-step__footer .ast-btn {
    width: 100%;
}

/* ===== Правая колонка: картинка + карточка ===== */

.ast-quiz .container--xl .quiz-section__visual-column {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    height: auto;
}

.ast-quiz .container--xl .quiz-section__img {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 0;
    object-fit: cover;
    border-radius: 20px;
}

.ast-quiz .container--xl .quiz-card {
    display: block;
    width: 100%;
    max-width: 435px;
    background: #FFFFFF;
    box-shadow: 0 12px 36px rgba(0, 18, 56, 0.1);
    border-radius: 18px;
    padding: 24px;
    position: relative;
    z-index: 2;
}

.ast-quiz .container--xl .quiz-step {
    font-weight: 400;
    font-size: 16px;
    line-height: 140%;
    color: #050E38;
    margin-bottom: 16px;
}

.ast-quiz .container--xl .quiz-step__footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== Прогресс ===== */

.ast-quiz .container--xl .steps-progress {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.ast-quiz .container--xl .steps-progress .step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #EAEAEA;
    color: #787878;
    font-weight: 700;
    font-size: 14px;
    line-height: 120%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.ast-quiz .container--xl .steps-progress .step-num.active {
    background-color: #0338EE;
    color: #ffffff;
}

.ast-quiz .container--xl .steps-progress .step-line {
    flex: 1;
    height: 2px;
    background-color: #EAEAEA;
}

.ast-quiz .container--xl .steps-progress .step-line.active {
    background-color: #0338EE;
}

/* ===== Вопросы и варианты ===== */

.ast-quiz .container--xl .quiz-question {
    font-weight: 700;
    font-size: 24px;
    line-height: 110%;
    letter-spacing: -0.02em;
    color: #000733;
    margin: 0 0 16px;
}

.ast-quiz .container--xl .quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.ast-quiz .container--xl .option-label {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 12px;
    border-radius: 8px;
    font-weight: 400;
    font-size: 16px;
    line-height: 140%;
    color: #000000;
    cursor: pointer;
    transition: all 0.2s;
}

.ast-quiz .container--xl .option-label input {
    display: none;
}

.ast-quiz .container--xl .option-label .custom-radio {
    width: 20px;
    min-width: 20px;
    height: 20px;
    background: #F9FAFF;
    border: 1px solid #000000;
    border-radius: 100%;
    display: inline-block;
    position: relative;
}

.ast-quiz .container--xl .option-label:hover,
.ast-quiz .container--xl .option-label:has(input:checked) {
    background: #F2F4F5;
    box-shadow: 0 3px 4px -5px rgba(24, 24, 28, 0.03), 0 1px 2px rgba(24, 24, 28, 0.04);
}

.ast-quiz .container--xl .option-label:has(input:checked) .custom-radio {
    border-color: #0338EE;
}

.ast-quiz .container--xl .option-label:has(input:checked) .custom-radio::after {
    content: "";
    width: 12px;
    height: 12px;
    background-color: #0338EE;
    border-radius: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ===== Экран результата ===== */

.ast-quiz .container--xl .quiz-result-badge {
    max-width: 324px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    gap: 8px;
    background: #EBFCF0;
    border-radius: 23px;
    font-weight: 700;
    font-size: 16px;
    line-height: 110%;
    color: #089130;
    margin-bottom: 16px;
}

.ast-quiz .container--xl .quiz-result__item {
    display: flex;
    gap: 16px;
    padding: 12px 0;
}

.ast-quiz .container--xl .quiz-result__item svg {
    min-width: 34px;
}

.ast-quiz .container--xl .quiz-result__item-title {
    font-weight: 700;
    font-size: 16px;
    line-height: 140%;
    letter-spacing: -0.01em;
    color: #000000;
    margin-bottom: 8px;
}

.ast-quiz .container--xl .quiz-result__item-text {
    font-weight: 400;
    font-size: 16px;
    line-height: 140%;
    color: #000000;
    max-width: 262px;
}

.ast-quiz .container--xl .quiz-step-content {
    display: none;
}

.ast-quiz .container--xl .quiz-step-content.active {
    display: block;
}

/* ===== Подсветка карточки по кнопке «Начать проверку» ===== */

.ast-quiz .container--xl .quiz-card.ast-quiz-card--flash {
    animation: ast-quiz-flash 1.2s ease-out 2;
}

@keyframes ast-quiz-flash {
    0% {
        box-shadow: 0 12px 36px rgba(0, 18, 56, 0.1), 0 0 0 0 rgba(3, 56, 238, 0.45);
    }
    70% {
        box-shadow: 0 12px 36px rgba(0, 18, 56, 0.1), 0 0 0 16px rgba(3, 56, 238, 0);
    }
    100% {
        box-shadow: 0 12px 36px rgba(0, 18, 56, 0.1), 0 0 0 0 rgba(3, 56, 238, 0);
    }
}

.ast-quiz.ast-quiz--dark .container--xl .quiz-card.ast-quiz-card--flash {
    animation-name: ast-quiz-flash-dark;
}

@keyframes ast-quiz-flash-dark {
    0% {
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(170, 194, 255, 0.6);
    }
    70% {
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 0 16px rgba(170, 194, 255, 0);
    }
    100% {
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(170, 194, 255, 0);
    }
}

/* ===== Тёмная тема ===== */

.ast-quiz.ast-quiz--dark {
    background: #050E38;
    color: #ffffff;
}

.ast-quiz.ast-quiz--dark .container--xl .quiz-section {
    color: #ffffff;
}

.ast-quiz.ast-quiz--dark .container--xl .quiz-section__feature-text p,
.ast-quiz.ast-quiz--dark .container--xl .quiz-section__feature-text h3,
.ast-quiz.ast-quiz--dark .container--xl .quiz-section__main-subtitle,
.ast-quiz.ast-quiz--dark .container--xl .quiz-section__main-title {
    color: #ffffff;
}

.ast-quiz.ast-quiz--dark .container--xl .quiz-section__footnote {
    color: #B8C4E4;
}

.ast-quiz.ast-quiz--dark .container--xl .quiz-section__feature-icon,
.ast-quiz.ast-quiz--dark .container--xl .quiz-section__badge {
    background: #142B68;
    color: #AAC2FF;
}

/* ===== Модалка ===== */

.ast-quiz .container--xl .ast-quiz-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    box-sizing: border-box;
}

.ast-quiz .container--xl .ast-quiz-modal.is-open {
    display: flex;
}

.ast-quiz .container--xl .ast-quiz-modal__dialog {
    padding: 24px;
    max-width: 662px;
    width: 100%;
    position: relative;
    background: #FFFFFF;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    border-radius: 20px;
    box-sizing: border-box;
}

/* низкие экраны: контент модалки скроллится внутри диалога */
@media (max-height: 640px) {
    .ast-quiz .container--xl .ast-quiz-modal__dialog {
        max-height: calc(100vh - 32px);
        overflow: auto;
    }
}

/* Флажки стран: CSS-версия вместо эмодзи (Windows их не рисует) */

.ast-quiz .container--xl .flag {
    width: 24px;
    min-width: 24px;
    height: 16px;
    border-radius: 3px;
    display: inline-block;
    background: #E3E7EC;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.ast-quiz .container--xl .flag--ru {
    background: linear-gradient(180deg, #ffffff 0 33%, #0039A6 33% 66%, #D52B1E 66% 100%);
}

.ast-quiz .container--xl .flag--kz {
    background: linear-gradient(180deg, #00AFCA 0 44%, #FEC50C 44% 56%, #00AFCA 56% 100%);
}

.ast-quiz .container--xl .flag--by {
    background: linear-gradient(180deg, #CE1720 0 62%, #ffffff 62% 72%, #007C30 72% 100%);
}

.ast-quiz .container--xl .flag--uz {
    background: linear-gradient(180deg, #0099B5 0 34%, #ffffff 34% 42%, #CE1126 42% 48%, #ffffff 48% 56%, #1EB53A 56% 100%);
}

.ast-quiz .container--xl .ast-quiz-modal__close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    line-height: 0;
}

.ast-quiz .container--xl .ast-quiz-modal__title {
    font-weight: 700;
    font-size: 24px;
    line-height: 110%;
    letter-spacing: -0.02em;
    color: #000733;
    margin: 0 32px 8px 0;
}

.ast-quiz .container--xl .ast-quiz-modal__subtitle {
    font-weight: 400;
    font-size: 16px;
    line-height: 23px;
    color: #000000;
    margin: 0 32px 0 0;
}

/* ===== Поля формы ===== */

.ast-quiz .container--xl .ast-quiz-form-fields {
    display: flex;
    gap: 12px;
    margin: 20px 0;
}

.ast-quiz .container--xl .ast-quiz-input-wrap,
.ast-quiz .container--xl .ast-quiz-phone-wrap {
    position: relative;
    flex: 1;
    display: flex;
}

.ast-quiz .container--xl .ast-quiz-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #D7DFFF;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    line-height: 140%;
    color: #000733;
    background: #FFFFFF;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
}

.ast-quiz .container--xl .ast-quiz-input:focus {
    border-color: #0338EE;
}

.ast-quiz .container--xl .ast-quiz-input.is-invalid {
    border-color: #E5322D;
}

.ast-quiz .container--xl .ast-quiz-input-placeholder {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #787878;
    font-size: 16px;
    pointer-events: none;
    transition: all .15s;
}

.ast-quiz .container--xl .ast-quiz-input:focus ~ .ast-quiz-input-placeholder,
.ast-quiz .container--xl .ast-quiz-input:not(:placeholder-shown) ~ .ast-quiz-input-placeholder,
.ast-quiz .container--xl .ast-quiz-input.has-value ~ .ast-quiz-input-placeholder {
    display: none;
}

/* Телефон + страна */

.ast-quiz .container--xl .ast-quiz-phone-wrap {
    gap: 8px;
}

.ast-quiz .container--xl .ast-quiz-country {
    position: relative;
    min-width: 64px;
}

.ast-quiz .container--xl .ast-quiz-country__selected {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid #D7DFFF;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    box-sizing: border-box;
    background: #fff;
}

.ast-quiz .container--xl .ast-quiz-country__selected .arrow {
    font-size: 9px;
    color: #787878;
}

.ast-quiz .container--xl .ast-quiz-country__list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 230px;
    background: #fff;
    border: 1px solid #D7DFFF;
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0, 18, 56, 0.14);
    list-style: none;
    margin: 0;
    padding: 4px;
    display: none;
    z-index: 5;
}

.ast-quiz .container--xl .ast-quiz-country--open .ast-quiz-country__list {
    display: block;
}

.ast-quiz .container--xl .ast-quiz-country__list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 15px;
    color: #000733;
}

.ast-quiz .container--xl .ast-quiz-country__list li:hover {
    background: #F0F3FF;
}

.ast-quiz .container--xl .ast-quiz-country__list .code {
    color: #787878;
    margin-left: auto;
}

/* Согласие */

.ast-quiz .container--xl .ast-quiz-agreement {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    cursor: pointer;
}

.ast-quiz .container--xl .ast-quiz-agreement input {
    display: none;
}

.ast-quiz .container--xl .ast-quiz-checkbox {
    width: 20px;
    min-width: 20px;
    height: 20px;
    border: 1px solid #0028B1;
    border-radius: 4px;
    position: relative;
    background: #fff;
    margin-top: 2px;
}

.ast-quiz .container--xl .ast-quiz-agreement input:checked + .ast-quiz-checkbox::after {
    content: "";
    position: absolute;
    inset: 3px;
    background: #0338EE;
    border-radius: 2px;
}

.ast-quiz .container--xl .ast-quiz-agreement-text {
    font-size: 12px;
    line-height: 18px;
    color: #7A7D87;
}

.ast-quiz .container--xl .ast-quiz-agreement-text a {
    color: #0028B1;
    text-decoration: underline;
}

/* Ошибка отправки; hidden сильнее любых display-правил внутри блока */

.ast-quiz .container--xl .ast-quiz-form-error {
    color: #E5322D;
    font-size: 14px;
    line-height: 140%;
    margin-bottom: 12px;
}

.ast-quiz [hidden] {
    display: none !important;
}

.ast-quiz .container--xl .ast-quiz-form-submit {
    width: 100%;
}

.ast-quiz .container--xl .ast-quiz-form-submit[disabled] {
    opacity: .6;
    cursor: default;
}

.ast-quiz .container--xl .ast-quiz-form-success {
    font-weight: 700;
    font-size: 18px;
    line-height: 140%;
    color: #089130;
    text-align: center;
    padding: 24px 0 8px;
}

/* ===== Адаптив ===== */

@media (max-width: 991.98px) {
    .ast-quiz .container--xl .quiz-section__img {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .ast-quiz {
        padding: 24px 0;
    }

    .ast-quiz .container--xl .quiz-section {
        flex-direction: column;
        gap: 0;
    }

    .ast-quiz .container--xl .quiz-section__info-column {
        display: contents;
    }

    .ast-quiz .container--xl .quiz-section__badge-list {
        gap: 6px;
        margin-bottom: 16px;
        flex-wrap: wrap;
        width: auto;
    }

    .ast-quiz .container--xl .quiz-section__badge {
        white-space: normal;
    }

    .ast-quiz .container--xl .quiz-section__main-title {
        font-size: 22px;
        line-height: 110%;
        margin-bottom: 16px;
    }

    .ast-quiz .container--xl .quiz-section__main-subtitle {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .ast-quiz .container--xl .quiz-section__mob {
        display: flex;
        align-items: center;
        padding: 8px;
        gap: 8px;
        background: #FFFFFF;
        border-radius: 10px;
        margin-bottom: 24px;
        font-weight: 700;
        font-size: 14px;
        line-height: 120%;
        color: #000733;
        order: -1;
    }

    .ast-quiz .container--xl .quiz-section__features-list {
        order: 1;
        margin-top: 24px;
        margin-bottom: 24px;
    }

    .ast-quiz .container--xl .quiz-section__feature-text h3 {
        font-size: 16px;
        line-height: 120%;
    }

    .ast-quiz .container--xl .quiz-section__feature-text p {
        font-size: 12px;
    }

    .ast-quiz .container--xl .quiz-section__actions-wrapper {
        order: 1;
        gap: 12px;
    }

    .ast-quiz .container--xl .quiz-section__buttons-group {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .ast-quiz .container--xl .quiz-section__footnote {
        display: none;
    }

    .ast-quiz .container--xl .quiz-card {
        margin: 16px 0 0;
    }

    .ast-quiz .container--xl .quiz-question {
        font-size: 20px;
    }

    .ast-quiz .container--xl .ast-quiz-form-fields {
        flex-direction: column;
    }

    .ast-quiz .container--xl .ast-btn {
        font-size: 16px;
    }
}
