/* ============================================
   КВИЗ — цветовая схема #2499ba, шрифт Manrope
   ПК: 800 x 520 px (ширина задаётся обёрткой)
   Мобильные: высота auto, как раньше
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

.vida-quiz-container {
    width: 100%;
    height: 520px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    box-sizing: border-box;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: visible;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.vida-quiz-container *,
.vida-quiz-container input,
.vida-quiz-container button,
.vida-quiz-container textarea,
.vida-quiz-container label {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* Фон с картинкой только для Шага 1 (только ПК) */
.vida-quiz-container.has-step1 {
    background-image: url('/wp-content/vida_qeez/pict2.jpg');
}

.quiz-step {
    display: none;
    box-sizing: border-box;
    height: 100%;
}

.quiz-step.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---------- Заголовки ---------- */
.quiz-title {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #2499ba !important;
    margin: 0 0 22px 0 !important;
    text-align: left !important;
    line-height: 1.2 !important;
    text-transform: uppercase !important;
}

/* Заголовок шага 4 — 30px */
.quiz-step[data-step="4"] .quiz-title {
    font-size: 30px !important;
}

/* ---------- Шаг 1: две колонки ---------- */
.step1-columns {
    display: flex;
    gap: 28px;
    flex: 1;
    min-height: 0;
}

.step1-col-left,
.step1-col-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.input-group {
    margin-bottom: 18px;
}

.input-label {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 10px;
}

.number-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.number-input input {
    width: 90px;
    padding: 9px;
    border: 2px solid #dddddd;
    border-radius: 5px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    color: #333333;
    background: rgba(255, 255, 255, 0.92);
    -moz-appearance: textfield;
}

.number-input input:focus {
    outline: none;
    border-color: #2499ba !important;
}

.number-input input::-webkit-outer-spin-button,
.number-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #2499ba !important;
    background: #ffffff !important;
    color: #2499ba !important;
    border-radius: 5px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.qty-btn:hover,
.qty-btn:active,
.qty-btn:focus {
    background: #196481 !important;
    border-color: #196481 !important;
    color: #ffffff !important;
    outline: none;
}

/* Акционные / информационные надписи */
.promo-message {
    margin-top: 16px;
    padding: 12px 14px;
    background: #eef8fb !important;
    border-left: 3px solid #2499ba !important;
    color: #2499ba !important;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
    border-radius: 4px;
    display: none;
}

.promo-message.show {
    display: block;
}

.sizes-hint {
    font-size: 14px;
    line-height: 1.4;
    color: #777777;
    margin: 0 0 12px 0;
}

.sizes-hint.hidden,
#sizes-fields.hidden {
    display: none;
}

/* Картинка вместо полей размеров при 4+ коврах */
.step1-image-replacement {
    display: none;
    width: 100%;
    max-width: 300px;
    margin-top: auto;
}

.step1-image-replacement.show {
    display: block;
}

.step1-image-replacement img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    box-shadow: none;
}

.size-field {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 14px;
    color: #555555;
}

.size-field label {
    font-size: 14px;
    color: #555555;
    min-width: 64px;
}

.size-field input {
    width: 78px;
    padding: 7px;
    border: 1px solid #dddddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333333;
    background: rgba(255, 255, 255, 0.92);
}

.size-field input:focus {
    outline: none;
    border-color: #2499ba !important;
}

/* ---------- Чек-боксы (шаги 2 и 3) ---------- */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    margin-bottom: 12px;
    flex: 1;
    align-content: start;
}

.checkbox-item {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    font-size: 16px;
    color: #333333;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    transition: all 0.2s;
    user-select: none;
    background: #ffffff;
    line-height: 1.3;
}

.checkbox-item:hover {
    border-color: #2499ba !important;
    background: #f2fafc !important;
}

.checkbox-large {
    font-size: 18px;
    font-weight: 600;
}

.checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    margin: 0;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #2499ba !important;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
    background: #ffffff;
    box-sizing: border-box;
}

.checkbox-item input[type="checkbox"]:checked ~ .checkmark {
    background: #2499ba !important;
    border-color: #2499ba !important;
}

.checkbox-item input[type="checkbox"]:checked ~ .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #ffffff !important;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Плашка "Бесплатная доставка" */
.free-delivery {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #2499ba !important;
    margin: 8px 0 10px 0;
    padding: 10px;
    background: #eef8fb !important;
    border-radius: 5px;
}

/* ---------- Форма шага 4 ---------- */
.quiz-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.form-group {
    margin-bottom: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #bbbbbb !important; /* Более заметная рамка */
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    color: #222222 !important; /* Тёмный, чёткий цвет введённого текста */
    box-sizing: border-box;
    background: #ffffff;
    transition: border-color 0.2s;
}

/* Цвет подсказки (placeholder) делаем тёмно-серым и непрозрачным */
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #555555 !important;
    opacity: 1 !important; /* Отключаем стандартное "разбавление" браузера */
    font-weight: 400;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2499ba !important;
    box-shadow: 0 0 0 2px rgba(36, 153, 186, 0.15);
}

.checkbox-agree {
    margin: 6px 0 14px 0;
}

.checkbox-agree .checkbox-item {
    font-size: 14px;
    padding: 0;
    border: none;
    background: transparent !important;
    color: #333333; /* Чуть темнее текст согласия */
    font-weight: 500;
}

.checkbox-agree .checkbox-item:hover {
    background: transparent !important;
    border: none;
}

.step4-bottom {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: auto;
}

.final-promo {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
    color: #2499ba !important;
    padding: 10px 14px;
    background: #eef8fb !important;
    border-radius: 5px;
    text-align: left;
    line-height: 1.35;
}

/* ---------- Кнопки ---------- */
.quiz-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
}

.btn-next,
.btn-submit {
    padding: 13px 34px;
    background: #2499ba !important;
    color: #ffffff !important;
    border: 2px solid #2499ba !important;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.2;
}

.btn-next {
    margin-left: auto;
}

.btn-submit {
    flex-shrink: 0;
}

.btn-next:hover,
.btn-next:active,
.btn-next:focus,
.btn-submit:hover,
.btn-submit:active,
.btn-submit:focus {
    background: #196481 !important;
    border-color: #196481 !important;
    color: #ffffff !important;
    outline: none;
}

.btn-next:hover,
.btn-submit:hover {
    transform: translateY(-2px);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: default;
    transform: none;
}

.btn-back {
    padding: 13px 34px;
    background: #ffffff !important;
    color: #2499ba !important;
    border: 2px solid #2499ba !important;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.2;
}

.btn-back:hover,
.btn-back:active,
.btn-back:focus {
    background: #196481 !important;
    border-color: #196481 !important;
    color: #ffffff !important;
    outline: none;
}

/* ---------- Сообщения об ошибках ---------- */
.quiz-error {
    display: none;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #196481 !important;
    color: #ffffff !important;
    padding: 12px 24px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10000;
    animation: slideDown 0.3s ease;
}

.quiz-error.show {
    display: block;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ============================================
   АДАПТИВНОСТЬ — на мобильных размеры прежние
   ============================================ */
@media (max-width: 768px) {
    .vida-quiz-container {
        height: auto;
        padding: 15px;
    }

    /* На мобильных фоновая картинка Шага 1 не показывается */
    .vida-quiz-container.has-step1 {
        background-image: none;
    }

    .quiz-step {
        height: auto;
    }

    .quiz-title {
        font-size: 20px !important;
        margin: 0 0 16px 0 !important;
    }

    .quiz-step[data-step="4"] .quiz-title {
        font-size: 22px !important;
    }

    .step1-columns {
        flex-direction: column;
        gap: 16px;
    }

    .step1-image-replacement {
        max-width: 100%;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .input-label {
        font-size: 18px;
    }

    .quiz-buttons {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .btn-next,
    .btn-submit,
    .btn-back {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .step4-bottom {
        flex-direction: column;
        gap: 10px;
    }

    .btn-submit {
        width: 100%;
    }

    .final-promo {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .quiz-title {
        font-size: 18px !important;
    }

    .quiz-step[data-step="4"] .quiz-title {
        font-size: 20px !important;
    }

    .checkbox-item {
        font-size: 14px;
    }

    .checkbox-large {
        font-size: 15px;
    }

    .promo-message {
        font-size: 15px;
    }

    .final-promo {
        font-size: 14px;
    }
}