/* ===== Кнопка открытия попапа ===== */
.quiz-popup-trigger {
    padding: 15px 24px;
    background: #b5956e;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-popup-trigger:hover {
    background: #a07d58;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(181, 149, 110, 0.3);
}
/* ===== Поле ввода для размеров ===== */
.quiz-input-group {
    width: 100%;
    margin-bottom: 10px;
}

.quiz-input-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
}

.quiz-text-input {
    width: 100%;
    padding: 14px 18px!important;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    color: #333;
    background: #fafafa;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.quiz-text-input:focus {
    border-color: #b5956e;
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(181, 149, 110, 0.15);
}

.quiz-text-input::placeholder {
    color: #aaa;
    font-size: 15px;
}

.quiz-text-input:hover {
    border-color: #b5956e;
    background: #fff;
}
/* ===== Оверлей попапа ===== */
.quiz-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 999999;
    justify-content: center;
    align-items: center;
}

.quiz-popup-overlay.active {
    display: flex;
}

/* ===== Контейнер попапа ===== */
.quiz-popup-container {
    background: #fff;
    border-radius: 16px;
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    position: relative;
    animation: slideUp 0.4s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== Стилизация скролла ===== */
.quiz-popup-container::-webkit-scrollbar {
    width: 6px;
}

.quiz-popup-container::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.quiz-popup-container::-webkit-scrollbar-thumb {
    background: #b5956e;
    border-radius: 3px;
}

.quiz-popup-container::-webkit-scrollbar-thumb:hover {
    background: #a07d58;
}

/* ===== Кнопка закрытия ===== */
.quiz-popup-close {
    position: sticky;
    top: 0;
    float: right;
    width: 44px;
    height: 40px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    margin-bottom: 20px;
}

.quiz-popup-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

/* ===== Прогресс-бар ===== */
.quiz-progress {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    background: #b5956e;
    transition: width 0.5s ease;
    width: 0%;
}

.quiz-progress-text {
    text-align: right;
    font-size: 14px;
    color: #666;
    margin-bottom: 30px;
}

/* ===== Принудительное отображение квиза внутри попапа ===== */
#quizContent .quiz-slide {
    display: none !important;
}

#quizContent .quiz-slide.active {
    display: block !important;
}

#quizContent .quiz-container,
#quizContent .quiz-slides,
#quizContent .quiz-slide {
    width: 100%;
    box-sizing: border-box;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.quiz-slide h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 25px;
}

.quiz-subtitle {
    color: #666;
    margin-bottom: 25px;
}

/* ===== Опции (варианты ответов) ===== */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.quiz-options-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 12px;
}
form p {
    margin-bottom: 0!important;
}
form label {
    width: 100%;
}
.wpcf7-text {
    margin-top: 7px;
}
.quiz-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}

.quiz-option:hover {
    border-color: #b5956e;
    background: #f5f0eb;
}

.quiz-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #b5956e;
    flex-shrink: 0;
    margin: 0;
}

.quiz-option input[type="radio"]:checked + span {
    color: #b5956e;
    font-weight: 600;
}

.quiz-option:has(input:checked) {
    border-color: #b5956e;
    background: #f5f0eb;
}

.quiz-option span {
    font-size: 16px;
    color: #333;
}

/* ===== Навигация (кнопки Далее/Назад) ===== */
.quiz-nav {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.quiz-nav button {
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-btn-next {
    background: #b5956e;
    color: #fff;
    padding: 12px 32px;
}

.quiz-btn-next:hover {
    background: #a07d58;
}

.quiz-btn-prev {
    background: transparent;
    color: #666;
    border: 2px solid #ccc !important;
}

.quiz-btn-prev:hover {
    border-color: #999;
    background: #f5f5f5;
}

/* ===== Стили для формы CF7 внутри квиза ===== */
.quiz-slide .wpcf7 {
    margin: 20px 0;
}

.quiz-slide .wpcf7-form-control-wrap {
    display: block;
    margin-bottom: 15px;
}

.quiz-slide .wpcf7-text,
.quiz-slide .wpcf7-tel,
.quiz-slide .wpcf7-email {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.quiz-slide .wpcf7-text:focus,
.quiz-slide .wpcf7-tel:focus,
.quiz-slide .wpcf7-email:focus {
    border-color: #b5956e;
    outline: none;
}

.quiz-slide .wpcf7-submit {
    width: 100%;
    padding: 14px;
    background: #b5956e;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.quiz-slide .wpcf7-submit:hover {
    background: #a07d58;
}

.quiz-slide .wpcf7-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.quiz-slide .wpcf7-spinner {
    display: none;
}

.quiz-slide .wpcf7-response-output {
    margin: 15px 0 0 !important;
    padding: 15px !important;
    border-radius: 8px;
}

.quiz-slide .wpcf7-not-valid-tip {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

/* ===== Стили для скрытых полей CF7 ===== */
#quizAnswersHidden input[type="hidden"],
.quiz-slide input[type="hidden"] {
    display: none;
}
/* ===== Уведомление об успешной отправке ===== */
.quiz-success-message {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.quiz-success-message .success-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
}

.quiz-success-message h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 15px;
}

.quiz-success-message p {
    font-size: 16px;
    color: #666;
    margin-bottom: 0;
}

/* Анимация для уведомления */
.quiz-success-message {
    animation: fadeIn 0.5s ease;
}
/* ===== Адаптив для мобильных устройств ===== */
@media (max-width: 768px) {
    .quiz-popup-container {
        padding: 25px 20px;
        width: 98%;
        max-height: 95vh;
    }
    
    .quiz-options-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .quiz-popup-trigger {
        width: 100%;
        text-align: center;
    }
    
    .quiz-slide h3 {
        font-size: 20px;
    }
    
    .quiz-option span {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .quiz-popup-container {
        padding: 20px 15px;
        border-radius: 12px;
    }
    
    .quiz-options-grid {
        grid-template-columns: 1fr;
    }
    
    .quiz-nav {
        flex-direction: column;
    }
    
    .quiz-nav button {
        width: 100%;
    }
    
    .quiz-popup-close {
        width: 34px;
        height: 34px;
        font-size: 20px;
        line-height: 34px;
    }
}