/* ===== Quiz Overlay ===== */
.quiz-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.quiz-overlay.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 0;
}

@media (min-width: 769px) {
    .quiz-overlay.active {
        align-items: center;
        padding: 20px 0;
    }
}

body.quiz-open {
    overflow: hidden;
}

/* Container — по макету 1920x960, но адаптивно */
.quiz-container {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 1280px;
    min-height: 600px;
    margin: 20px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: quizSlideIn 0.35s ease;
    display: flex;
    flex-direction: column;
}

@keyframes quizSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Close button — крестик справа сверху */
.quiz-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    font-size: 32px;
    line-height: 44px;
    text-align: center;
    color: #999;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.quiz-close:hover {
    color: #333;
}

/* Progress bar — скрываем, заменяем степпером */
.quiz-progress {
    display: none;
}

/* ===== Степпер ===== */
.quiz-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 60px 0;
    gap: 0;
}

.quiz-stepper-item {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.quiz-stepper-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Lato Bold", sans-serif;
    font-size: 13px;
    flex-shrink: 0;
    background: #e0e0e0;
    color: #999;
    transition: all 0.3s ease;
}

.quiz-stepper-item.active .quiz-stepper-number {
    background: #0078D4;
    color: #fff;
}

.quiz-stepper-item.completed .quiz-stepper-number {
    background: #4CAF50;
    color: #fff;
}

.quiz-stepper-label {
    font-family: "Lato Regular", sans-serif;
    font-size: 14px;
    color: #999;
    transition: color 0.3s ease;
}

.quiz-stepper-item.active .quiz-stepper-label {
    color: #333;
    font-family: "Lato Semibold", sans-serif;
}

.quiz-stepper-item.completed .quiz-stepper-label {
    color: #333;
}

.quiz-stepper-line {
    flex: 1;
    height: 2px;
    background: #e0e0e0;
    margin: 0 12px;
    min-width: 40px;
    transition: background 0.3s ease;
}

.quiz-stepper-line.completed {
    background: #4CAF50;
}

.quiz-stepper-line.active {
    background: #0078D4;
}

/* ===== Steps ===== */
.quiz-step {
    display: none;
    padding: 60px 100px;
    flex: 1;
    flex-direction: column;
}

.quiz-step.active {
    display: flex;
    animation: quizFadeIn 0.3s ease;
}

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

/* Скрываем старый номер шага */
.quiz-step-number {
    display: none;
}

/* ===== Intro (шаг 0) ===== */
.quiz-title {
    font-family: "Lato Heavy", "Lato Bold", sans-serif;
    font-size: 36px;
    line-height: 1.25;
    color: #1a1a1a;
    margin: 0 0 16px 0;
    max-width: 700px;
}

.quiz-subtitle {
    font-family: "Lato Regular", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #666;
    margin: 0 0 40px 0;
}

/* Benefits — карточки в ряд */
.quiz-benefits,
.quiz-guarantee {
    margin-bottom: 32px;
}

.quiz-benefits h3,
.quiz-guarantee h3 {
    font-family: "Lato Bold", sans-serif;
    font-size: 18px;
    color: #1a1a1a;
    margin: 0 0 16px 0;
}

.quiz-benefits ul,
.quiz-guarantee ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 16px;
}

.quiz-benefits li,
.quiz-guarantee li {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: "Lato Regular", sans-serif;
    font-size: 14px;
    color: #333;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.quiz-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f7ff;
    border-radius: 10px;
}

.quiz-icon svg {
    width: 28px;
    height: 28px;
}

.quiz-guarantee li {
    background: #f8f9fa;
}

.quiz-guarantee li::before {
    display: none;
}

/* ===== Question ===== */
.quiz-question {
    font-family: "Lato Bold", sans-serif;
    font-size: 28px;
    line-height: 1.3;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.quiz-question-hint {
    font-family: "Lato Regular", sans-serif;
    font-size: 14px;
    color: #999;
    margin: 0 0 24px 0;
}

/* ===== Options — горизонтально ===== */
.quiz-options {
    display: flex;
    flex-direction: row;
    gap: 16px;
    margin-bottom: 40px;
}

.quiz-option {
    cursor: pointer;
    display: block;
    flex: 1;
}

.quiz-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.quiz-option-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: #fff;
    height: 100%;
    box-sizing: border-box;
}

.quiz-option-card:hover {
    border-color: #0078D4;
    background: #f5faff;
}

.quiz-option input[type="radio"]:checked + .quiz-option-card {
    border-color: #0078D4;
    background: #EBF5FF;
    box-shadow: 0 0 0 1px #0078D4;
}

/* Скрываем emoji-иконки из вариантов */
.quiz-option-icon {
    display: none;
}

.quiz-option-text {
    font-family: "Lato Regular", sans-serif;
    font-size: 15px;
    color: #333;
}

/* ===== Navigation ===== */
.quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: auto;
}

/* ===== Buttons ===== */
.quiz-btn {
    font-family: "Lato Bold", sans-serif;
    font-size: 13px;
    border: none;
    border-radius: 6px;
    padding: 14px 28px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quiz-btn-primary {
    background: #0078D4;
    color: #fff;
    box-shadow: none;
}

.quiz-btn-primary:hover {
    background: #005fa3;
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

.quiz-btn-primary:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
}

.quiz-btn-back {
    background: #fff;
    color: #666;
    border: 1px solid #e0e0e0;
    padding: 14px 28px;
}

.quiz-btn-back:hover {
    color: #333;
    background: #f5f5f5;
    border-color: #ccc;
}

/* Кнопка intro — по центру, синяя */
.quiz-intro .quiz-btn-primary {
    display: block;
    margin: 8px auto 0;
    padding: 16px 40px;
    font-size: 14px;
}

/* ===== Form (шаг 4) ===== */
.quiz-form-hint {
    font-family: "Lato Regular", sans-serif;
    font-size: 14px;
    color: #999;
    margin: 0 0 28px 0;
}

.quiz-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.quiz-field {
    margin-bottom: 0;
}

.quiz-field label {
    display: none;
}

.quiz-field input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-family: "Lato Regular", sans-serif;
    font-size: 15px;
    color: #333;
    transition: border-color 0.2s;
    outline: none;
    box-sizing: border-box;
    background: #fff;
}

.quiz-field input::placeholder {
    color: #999;
}

.quiz-field input:focus {
    border-color: #0078D4;
}

.quiz-field input.quiz-input-error {
    border-color: #ee0e3d;
    background: #fff5f7;
}

.quiz-field .quiz-error-text {
    font-family: "Lato Regular", sans-serif;
    font-size: 12px;
    color: #ee0e3d;
    margin-top: 4px;
    display: none;
}

.quiz-field .quiz-error-text.visible {
    display: block;
}

.quiz-field .required {
    color: #ee0e3d;
}

/* Согласие с обработкой данных */
.quiz-consent {
    font-family: "Lato Regular", sans-serif;
    font-size: 12px;
    color: #999;
    margin: 8px 0 32px 0;
    line-height: 1.5;
}

.quiz-consent a {
    color: #0078D4;
    text-decoration: underline;
}

/* General error */
.quiz-general-error {
    display: none;
    background: #fff0f3;
    border: 1px solid #ee0e3d;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-family: "Lato Regular", sans-serif;
    font-size: 14px;
    color: #ee0e3d;
    text-align: center;
}

.quiz-general-error.visible {
    display: block;
}

/* Кнопка отправки — красная */
.quiz-submit-btn {
    background: #ee0e3d !important;
}

.quiz-submit-btn:hover {
    background: #d40a34 !important;
    box-shadow: 0 4px 12px rgba(238, 14, 61, 0.3) !important;
}

/* ===== Success (шаг 5) ===== */
.quiz-success {
    text-align: center;
    padding: 80px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.quiz-success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
}

.quiz-success .quiz-title {
    font-size: 28px;
    max-width: none;
}

.quiz-success p {
    font-family: "Lato Regular", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #666;
    margin: 0 0 28px 0;
}

.quiz-success .quiz-btn-primary {
    background: #0078D4;
    margin: 0;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .quiz-step {
        padding: 40px 48px;
    }

    .quiz-title {
        font-size: 30px;
    }

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

@media (max-width: 768px) {
    .quiz-overlay.active {
        display: block;
        padding: 0;
    }

    .quiz-container {
        margin: 0;
        border-radius: 0;
        min-height: auto;
        max-width: 100%;
        width: 100%;
    }

    .quiz-step {
        padding: 32px 20px;
    }

    .quiz-stepper {
        padding: 20px 20px 0;
        gap: 0;
    }

    .quiz-stepper-label {
        display: none;
    }

    .quiz-stepper-line {
        min-width: 20px;
        margin: 0 8px;
    }

    .quiz-title {
        font-size: 24px;
    }

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

    .quiz-benefits ul,
    .quiz-guarantee ul {
        flex-direction: column;
    }

    .quiz-options {
        flex-direction: column;
    }

    .quiz-form-grid {
        grid-template-columns: 1fr;
    }

    .quiz-nav {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .quiz-btn {
        width: 100%;
        text-align: center;
    }
}
