/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f8fafc;
    padding: 16px;
    color: #0f172a;
    line-height: 1.5;
}
p{margin-bottom: .5rem;}

/* ===== КОНТЕЙНЕР ===== */
.quiz-container {
    max-width: 860px;
    margin: 0 auto;
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ===== ЗАГОЛОВКИ ===== */
.quiz-container h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
}

.quiz-container h3 {
    font-size: 18px;
    font-weight: 500;
    margin: 16px 0 4px;
    color: #1e293b;
}

.subtitle {
    font-size: 15px;
    color: #64748b;
    margin-bottom: 16px;
}

.step-subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 12px;
}

/* ===== ПРОГРЕСС ===== */
.quiz-progress {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin: 16px 0 20px;
}

.quiz-progress-bar {
    height: 100%;
    background: #2563eb;
    border-radius: 2px;
    transition: width 0.35s ease;
}

/* ===== ВОПРОСЫ ===== */
.quiz-question {
    margin-bottom: 20px;
}

.quiz-question-text {
    font-weight: 500;
    font-size: 17px;
    margin-bottom: 10px;
    color: #0f172a;
}

/* ===== ОТВЕТЫ ===== */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quiz-option {
    display: block;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    font-size: 15px;
    color: #1e293b;
    background: #fff;
}

.quiz-option:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.quiz-option.selected {
    border-color: #2563eb;
    background: #eff6ff;
}

.quiz-option input {
    display: none;
}

/* ===== НАВИГАЦИЯ ===== */
.quiz-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
}

.quiz-nav button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    width: 100%;
    min-height: 48px;
}

.quiz-nav button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#quizPrev {
    background: #f1f5f9;
    color: #1e293b;
}

#quizPrev:hover:not(:disabled) {
    background: #e2e8f0;
}

#quizNext {
    background: #2563eb;
    color: #ffffff;
}

#quizNext:hover:not(:disabled) {
    background: #1d4ed8;
}

/* ===== РЕЗУЛЬТАТ ===== */
.result-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
    margin: 16px 0;
    border: 1px solid #e2e8f0;
}

.result-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 4px;
}

.result-price {
    font-size: 26px;
    font-weight: 700;
    color: #2563eb;
    margin: 8px 0 12px;
}

.result-reason {
    font-size: 15px;
    color: #1e293b;
    line-height: 1.6;
}

.result-reason table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
}

.result-reason th,
.result-reason td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.result-reason th {
    background: #f1f5f9;
    font-weight: 600;
    color: #0f172a;
}

.result-reason tr:last-child td {
    border-bottom: none;
}

/* ===== МОДЕЛИ ===== */
.models-list {
    margin: 12px 0;
}

.models-list ul {
    list-style: none;
    padding: 0;
}

.models-list li {
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin: 4px 0;
    font-size: 14px;
    color: #1e293b;
}

/* ===== КНОПКА ===== */
.btn-result {
    display: inline-block;
    width: 100%;
    padding: 14px 20px;
    background: #2563eb;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 16px;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.btn-result:hover {
    background: #1d4ed8;
}

/* ===== ИКОНКИ ===== */
.icon {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}

/* ===== СПИННЕР ===== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   TABLET (≥ 600px)
   ============================================================ */
@media (min-width: 600px) {
    body {
        padding: 24px;
    }

    .quiz-container {
        padding: 28px 32px;
        border-radius: 16px;
    }

    .quiz-container h2 {
        font-size: 24px;
    }

    .quiz-container h3 {
        font-size: 19px;
    }

    .quiz-nav {
        flex-direction: row;
        justify-content: space-between;
    }

    .quiz-nav button {
        width: auto;
        min-width: 120px;
        justify-content: center;
    }

    .btn-result {
        width: auto;
        min-width: 200px;
    }
}

/* ============================================================
   DESKTOP (≥ 860px)
   ============================================================ */
@media (min-width: 860px) {
    .quiz-container {
        padding: 36px 40px;
    }

    .quiz-container h2 {
        font-size: 28px;
    }

    .quiz-question-text {
        font-size: 18px;
    }

    .quiz-option {
        padding: 14px 20px;
        font-size: 16px;
    }

    .result-price {
        font-size: 30px;
    }

    .result-reason {
        font-size: 16px;
    }

    .result-reason table {
        font-size: 15px;
    }
}

/* ===== АДАПТИВНАЯ ТАБЛИЦА ===== */
.result-reason table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    font-size: 13px;
}

@media (max-width: 600px) {
    .result-reason table {
        font-size: 12px;
    }
    .result-reason th,
    .result-reason td {
        padding: 6px 8px;
    }
}
.timer {
    font-size: 14px;
    color: #64748b;
    margin-top: 8px;
    font-variant-numeric: tabular-nums;
}