/*
Theme Name: Uncode Child
Description: Child theme for Uncode theme
Author: Undsgn™
Author URI: http://www.undsgn.com
Template: uncode
Version: 1.0.0
Text Domain: uncode
*/

/* --- Основной контейнер --- */
#almak-quiz {
    background: #fff;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: 40px auto; /* Добавил отступ сверху */
    font-family: 'Inter', sans-serif;
    position: relative;
}

/* --- Шаги и анимация --- */
.quiz-step { display: none; }
.quiz-step.active { display: block; animation: slideIn 0.3s ease; }

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

/* --- Типографика --- */
.step-progress { color: #e31e24; font-weight: bold; margin-bottom: 15px; }
.quiz-title { font-size: 22px; text-transform: uppercase; margin-bottom: 25px; color: #333; }

/* --- Сетка и поля --- */
.quiz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.quiz-grid.triple { grid-template-columns: 1fr 1fr 1fr; }
.quiz-field label { display: block; font-size: 13px; color: #666; margin-bottom: 8px; line-height: 1.3; }

#almak-quiz input[type="text"],
#almak-quiz input[type="number"],
#almak-quiz input[type="tel"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 12px;
    outline: none;
    transition: 0.3s;
}

/* --- Радио-кнопки (Табы) --- */
.quiz-field .wpcf7-list-item { margin: 0 10px 10px 0; display: inline-block; }
.quiz-field input[type="radio"] { display: none; }
.quiz-field .wpcf7-list-item-label {
    display: inline-block;
    padding: 10px 20px;
    background: #f0f0f0;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
}
.quiz-field input[type="radio"]:checked + .wpcf7-list-item-label {
    background: #e31e24;
    color: #fff;
}

/* --- Кнопки --- */
.next-btn, .final-submit {
    background: #e31e24;
    color: #fff;
    border: none;
    padding: 18px 40px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
}
.prev-btn, .reset-quiz {
    background: none;
    border: none;
    color: #666;
    margin-top: 20px;
    cursor: pointer;
    display: block;
}

/* --- Финальный экран (Результат) --- */
[data-step="result"] {
    position: relative;
    min-height: 400px; /* Чтобы текст не "схлопывался" */
}

.result-layout { display: flex; }

.result-info { 
    flex: 0 0 60%; /* Уменьшил до 60%, чтобы точно не налезло */
    position: relative;
    z-index: 2;
}

.result-image {
    position: absolute;
    right: -40px;  /* Компенсация паддинга родителя */
    bottom: -40px; /* Прижимаем в самый низ к углу */
    z-index: 1;
    pointer-events: none;
}

.result-image img { 
    max-width: 320px; 
    display: block;
    margin: 0;
}

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

/* Скрываем картинку на средних экранах, если мешает */
@media (max-width: 1200px) and (min-width: 769px) {
    .result-image { display: none; }
    .result-info { flex: 0 0 100%; }
}

@media (max-width: 768px) {
    #almak-quiz { padding: 25px 20px; margin: 20px 10px; }
    
    .quiz-grid, .quiz-grid.triple { grid-template-columns: 1fr !important; gap: 10px; }
    
    .quiz-field .wpcf7-list-item { display: block; margin-right: 0; }
    .quiz-field .wpcf7-list-item-label { display: block; text-align: center; }

    .result-layout { flex-direction: column; }
    .result-info { flex: 0 0 100%; }
    
    /* На мобилке картинку ставим в поток под текст */
    .result-image {
        position: static;
        display: block;
        margin: 20px auto 0;
        text-align: center;
    }
    .result-image img { max-width: 200px; margin: 0 auto; }
}

