/* =========================================================
   QUIZ MODAL — рекламный квиз (открывается по URL #reklama)
   ========================================================= */
.quiz-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(6px);
    z-index: 10003;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all .35s ease;
    padding: 20px;
}

.quiz-overlay.active {
    opacity: 1;
    visibility: visible;
}

.quiz-box {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 40px 36px 28px;
    transform: scale(.92) translateY(16px);
    transition: transform .35s ease;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .25);
}

.quiz-overlay.active .quiz-box {
    transform: scale(1) translateY(0);
}

.quiz-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--text-light);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background var(--tr);
}

.quiz-close:hover {
    background: var(--border);
}

.quiz-progress-wrap {
    margin-bottom: 24px;
    padding-right: 30px;
}

.quiz-progress {
    height: 6px;
    background: var(--bg);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.quiz-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--green) 0%, var(--green-dark) 100%);
    border-radius: 10px;
    transition: width .35s ease;
}

.quiz-step-counter {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.quiz-steps {
    position: relative;
    min-height: 220px;
}

.quiz-step {
    display: none;
    animation: quizFadeIn .3s ease;
}

.quiz-step.active {
    display: block;
}

@keyframes quizFadeIn {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.quiz-question {
    font-size: 21px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 20px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--tr);
    font-size: 14.5px;
    font-weight: 500;
}

.quiz-option:hover {
    border-color: var(--green-light);
    background: var(--green-pale);
}

.quiz-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.quiz-option-mark {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    background: var(--white);
    transition: all var(--tr);
    position: relative;
}

.quiz-option input[type="radio"] + .quiz-option-mark {
    border-radius: 50%;
}

.quiz-option input[type="checkbox"] + .quiz-option-mark {
    border-radius: 5px;
}

.quiz-option input:checked + .quiz-option-mark {
    border-color: var(--green);
    background: var(--green);
}

.quiz-option input[type="radio"]:checked + .quiz-option-mark::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--white);
}

.quiz-option input[type="checkbox"]:checked + .quiz-option-mark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--white);
    font-size: 11px;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-option:has(input:checked) {
    border-color: var(--green);
    background: var(--green-pale);
}

.quiz-note {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted, var(--text-light));
    font-style: italic;
}

.quiz-final-sub {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.55;
    margin-bottom: 24px;
}

.quiz-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-light);
}

.quiz-error {
    color: #e53935;
    font-size: 13px;
    margin-bottom: 12px;
}

.quiz-success {
    text-align: center;
    padding: 24px 0;
}

.quiz-success i {
    font-size: 52px;
    color: var(--green);
    display: block;
    margin-bottom: 16px;
}

.quiz-success h4 {
    font-size: 21px;
    font-weight: 800;
    margin-bottom: 8px;
}

.quiz-success p {
    font-size: 14px;
    color: var(--text-light);
}

.quiz-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.quiz-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 26px;
    border-radius: var(--radius-sm);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all var(--tr);
}

.quiz-btn-back {
    background: none;
    color: var(--text-light);
    border: 2px solid var(--border);
}

.quiz-btn-back:hover {
    border-color: var(--text-muted, var(--text-light));
    color: var(--text, #222);
}

.quiz-btn-next {
    background: var(--green);
    color: var(--white);
    margin-left: auto;
}

.quiz-btn-next:hover:not(:disabled) {
    background: var(--green-dark);
}

.quiz-btn-next:disabled {
    opacity: .45;
    cursor: not-allowed;
}

@media (max-width: 576px) {
    .quiz-box {
        padding: 30px 22px 22px;
        max-height: 92vh;
    }

    .quiz-question {
        font-size: 18px;
    }

    .quiz-option {
        padding: 13px 14px;
        font-size: 13.5px;
    }

    .quiz-btn {
        padding: 13px 18px;
        font-size: 13px;
    }
}
