﻿.quiz-page {
    position: fixed;
    inset: 0;
    background: url('/images/kitchen.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

    .quiz-page::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.45);
        backdrop-filter: blur(8px);
    }

.quiz-step,
.quiz-progress {
    position: relative;
    z-index: 2;
}

    .quiz-step h2 {
        font-size: 24px;
        margin-bottom: 25px;
        font-weight: 600;
    }

/* кнопки */
.answer-btn, .btn-main {
    display: block;
    width: 100%;
    margin: 10px 0;
    padding: 14px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    transition: 0.2s;
}

    .answer-btn:hover {
        background: #f5f5f5;
    }

.btn-secondary {
    display: block;
    width: 100%;
    margin: 10px 0;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #ff7a18, #ffb347);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    box-shadow: 0 6px 18px rgba(255, 122, 24, 0.35);
    transition: all 0.25s ease;
}

    .btn-secondary:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(255, 122, 24, 0.45);
    }


/* прогресс */
.quiz-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

.quiz-step {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 16px;
    width: 1100px;
    max-width: 95vw;
    min-height: 700px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: pop 0.25s ease;
}

.step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

    .step.active {
        border-color: #000;
    }

    .step.done {
        background: #000;
        color: #fff;
    }

.line {
    width: 40px;
    height: 2px;
    background: #ccc;
}

.quiz-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    width: 100%;
    margin-top: 25px;
}

/* карточка */
.card-option {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #eee;
    transition: all 0.25s ease;
    height: 290px;
    display: flex;
    flex-direction: column;
}

    /* hover эффект */
    .card-option:hover {
        transform: translateY(-3px);
        border-color: #4D71F0;
        box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    }

    /* картинка */
    .card-option img {
        width: 100%;
        height: 250px;
        object-fit: cover;
    }

    /* текст */
    .card-option div {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
        font-weight: 500;
    }

    .card-option.selected {
        border: 2px solid #4D71F0;
        transform: scale(1.02);
    }

.dropzone {
    border: 2px dashed #cfcfcf;
    border-radius: 14px;
    padding: 40px;
    cursor: pointer;
    transition: 0.2s;
    background: #fff;
}

    .dropzone:hover {
        border-color: #4D71F0;
        background: #f7f9ff;
    }

    .dropzone.dragover {
        border-color: #4D71F0;
        background: #eef3ff;
    }

.dropzone-inner {
    text-align: center;
    color: #555;
}

    .dropzone-inner .icon {
        font-size: 40px;
        margin-bottom: 10px;
    }

.preview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 15px;
}

    .preview img {
        width: 100%;
        height: 150px;
        object-fit: cover;
        border-radius: 8px;
    }

.quiz-step {
    display: flex;
    flex-direction: column;
}

.step-actions {
    margin-top: auto;
    padding-top: 20px;
}

.subtext {
    color: rgba(0,0,0,0.5);
    margin-bottom: 20px;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 15px;
    margin-bottom: 12px;
    box-sizing: border-box;
}

    .form-control:focus {
        outline: none;
        border-color: #4D71F0;
    }

/* Превью цвета в карточке */
.color-preview {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid rgba(0,0,0,0.08);
}

/* Спиннер загрузки */
.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #eee;
    border-top-color: #4D71F0;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pop {
    from {
        opacity: 0;
        transform: scale(0.97);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ─────────────────────────────────────────────────────────────
   АДАПТИВ
───────────────────────────────────────────────────────────── */

/* Планшет: до 1024px */
@media (max-width: 1024px) {
    .quiz-step {
        padding: 32px 28px;
        min-height: 600px;
    }

    .grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    .card-option {
        height: 220px;
    }

        .card-option img {
            height: 180px;
        }
}

/* Маленький планшет / большой телефон: до 768px */
@media (max-width: 768px) {
    .quiz-page {
        align-items: flex-start;
    }

    .quiz-wrapper {
        padding: 16px 0 32px;
        justify-content: flex-start;
        min-height: 100dvh;
    }

    .quiz-progress {
        margin-bottom: 20px;
    }

    .line {
        width: 24px;
    }

    .quiz-step {
        padding: 24px 18px;
        border-radius: 14px;
        min-height: unset;
        width: 92vw;
    }

        .quiz-step h2 {
            font-size: 18px;
            margin-bottom: 16px;
        }

    /* 2 колонки на планшете */
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-top: 16px;
    }

    .card-option {
        height: 190px;
    }

        .card-option img {
            height: 150px;
        }

        .card-option div {
            font-size: 13px;
        }

    /* цветовые карточки — меньше высота */
    .color-option {
        height: auto !important;
        padding: 10px;
    }

    .color-preview {
        height: 44px;
    }

    .dropzone {
        padding: 24px 16px;
    }

    .preview {
        grid-template-columns: repeat(3, 1fr);
    }

        .preview img {
            height: 90px;
        }

    .btn-main {
        padding: 14px;
        font-size: 15px;
    }
}

/* Телефон: до 480px (iPhone 12 mini — 375px, стандарт ~390px) */
@media (max-width: 480px) {
    .quiz-wrapper {
        padding: 12px 0 24px;
    }

    .quiz-progress {
        margin-bottom: 14px;
    }

    .step {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .line {
        width: 16px;
    }

    .quiz-step {
        padding: 20px 14px;
        border-radius: 12px;
        width: 94vw;
    }

        .quiz-step h2 {
            font-size: 16px;
            margin-bottom: 12px;
            line-height: 1.4;
        }

    .subtext {
        font-size: 13px;
        margin-bottom: 12px;
    }

    /* 2 колонки на телефоне */
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-top: 12px;
    }

    .card-option {
        height: 150px;
        border-radius: 10px;
    }

        .card-option img {
            height: 112px;
        }

        .card-option div {
            font-size: 12px;
            padding: 4px;
        }

    /* цветовые карточки */
    .color-option {
        height: auto !important;
        padding: 8px;
    }

    .color-preview {
        height: 36px;
        margin-bottom: 6px;
    }

    /* дропзона */
    .dropzone {
        padding: 20px 12px;
        border-radius: 10px;
    }

    .dropzone-inner .icon {
        font-size: 28px;
        margin-bottom: 6px;
    }

    .dropzone-inner p {
        font-size: 13px;
        margin: 4px 0;
    }

    .dropzone-inner span {
        font-size: 12px;
        color: #888;
    }

    /* превью загруженных фото */
    .preview {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        margin-top: 10px;
    }

        .preview img {
            height: 72px;
            border-radius: 6px;
        }

    /* форма контактов */
    .form-control {
        padding: 12px;
        font-size: 14px;
        margin-bottom: 10px;
    }

    .btn-main {
        padding: 13px;
        font-size: 15px;
        border-radius: 10px;
    }

    .step-actions {
        padding-top: 14px;
    }
}

/* iPhone 12 mini и самые маленькие: до 375px */
@media (max-width: 375px) {
    .quiz-step {
        padding: 16px 12px;
        width: 96vw;
    }

        .quiz-step h2 {
            font-size: 15px;
        }

    .grid {
        gap: 8px;
    }

    .card-option {
        height: 136px;
    }

        .card-option img {
            height: 100px;
        }

        .card-option div {
            font-size: 11px;
        }

    .color-preview {
        height: 30px;
    }

    .preview img {
        height: 60px;
    }
}
