/* CSS Reset & Cơ bản */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #fff8ef;
    --card: #ffffff;
    --card-soft: #fffdf9;
    --text: #2f2a24;
    --muted: #746b61;
    --primary: #b85c24;
    --primary-dark: #944719;
    --primary-soft: #fff0df;
    --border: #eadfD2;

    --correct-bg: #eaf7ee;
    --correct-border: #4caf68;
    --correct-text: #1f7a3a;

    --wrong-bg: #fdecec;
    --wrong-border: #e66b6b;
    --wrong-text: #b83232;

    --shadow: 0 14px 40px rgba(47, 42, 36, 0.08);
}

body {
    font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 214, 163, 0.35), transparent 32%),
        var(--bg);
    color: var(--text);
    line-height: 1.65;
    padding: 24px;
    font-weight: 500; /* Mềm mại hơn so với các font sans-serif thông thường */
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 34px;
    padding-bottom: 60px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

/* Tiêu đề & Mô tả */
header {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 22px;
}

h1 {
    font-size: 32px;
    line-height: 1.2;
    font-weight: 800; /* Độ đậm lớn để làm nổi bật tiêu đề chính */
    margin-bottom: 12px;
    letter-spacing: -0.03em;
    color: var(--text);
    text-transform: none; /* Đảm bảo không bị hoa toàn bộ */
}

h1::before {
    content: "🥖 ";
}

.description {
    font-size: 15px;
    color: var(--muted);
    max-width: 760px;
    font-weight: 400; /* Đoạn văn mô tả thanh mảnh */
}

/* Các View */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* Form cài đặt ban đầu */
.form-group {
    margin-bottom: 22px;
}

label {
    display: block;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text);
}

input[type="text"],
select,
textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border);
    background-color: #ffffff;
    color: var(--text);
    font-size: 15px;
    border-radius: 14px;
    font-family: inherit;
    font-weight: 500;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(184, 92, 36, 0.14);
    background-color: #fffdf9;
}

textarea {
    height: 100px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-block;
    width: 100%;
    background-color: var(--primary);
    color: #ffffff;
    border: 1px solid var(--primary);
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    border-radius: 14px;
    font-family: inherit;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.06s ease, box-shadow 0.15s ease;
    box-shadow: 0 8px 18px rgba(184, 92, 36, 0.16);
}

.btn:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn:active {
    transform: translateY(1px);
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--text);
    border: 1px solid var(--border);
    margin-top: 12px;
    box-shadow: none;
}

.btn-secondary:hover {
    background-color: var(--primary-soft);
    border-color: #e0b58e;
}

/* Header của phần Review */
.review-header {
    background: linear-gradient(135deg, #fff6ea, #fffdf9);
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    margin-bottom: 28px;
    box-shadow: 0 8px 24px rgba(47, 42, 36, 0.05);
}

.review-header-info {
    font-size: 15px;
    margin-bottom: 8px;
    color: var(--muted);
    font-weight: 500;
}

.review-header-info strong {
    color: var(--text);
    font-weight: 700;
}

.progress-info {
    font-weight: 800;
    font-size: 15px;
    color: var(--primary-dark);
    margin-top: 10px;
}

/* Danh sách câu hỏi */
.questions-list {
    margin-bottom: 32px;
}

.question-card {
    padding: 22px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card-soft);
    box-shadow: 0 8px 24px rgba(47, 42, 36, 0.045);
}

.question-card:last-child {
    margin-bottom: 0;
}

.question-text {
    font-size: 17px;
    font-weight: 700; /* Mềm mại hơn mức 800 ban đầu */
    margin-bottom: 16px;
    color: var(--text);
    letter-spacing: -0.01em;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

/* Button Đáp án */
.option-btn {
    width: 100%;
    text-align: left;
    padding: 13px 15px;
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 15px;
    cursor: pointer;
    color: var(--text);
    font-family: inherit;
    font-weight: 500; /* Cân bằng độ mềm mại cho danh sách đáp án */
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.06s ease, box-shadow 0.15s ease;
}

.option-btn:hover {
    background-color: #fff7ed;
    border-color: #e1b287;
    box-shadow: 0 4px 12px rgba(47, 42, 36, 0.05);
}

.option-btn:active {
    transform: translateY(1px);
}

.option-btn strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    margin-right: 6px;
    border-radius: 999px;
    background: #f3ede5;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

/* Trạng thái đáp án Đúng/Sai */
.option-btn.correct {
    background-color: var(--correct-bg) !important;
    border-color: var(--correct-border) !important;
    color: var(--correct-text) !important;
    font-weight: 600 !important; /* Đủ nổi bật nhưng không quá nặng */
}

.option-btn.correct strong {
    background: rgba(76, 175, 104, 0.14);
    color: var(--correct-text);
}

.option-btn.incorrect {
    background-color: var(--wrong-bg) !important;
    border-color: var(--wrong-border) !important;
    color: var(--wrong-text) !important;
    font-weight: 600 !important; /* Đủ nổi bật nhưng không quá nặng */
}

.option-btn.incorrect strong {
    background: rgba(230, 107, 107, 0.14);
    color: var(--wrong-text);
}

/* Vùng giải thích và góp ý */
.feedback-area {
    display: none;
    background-color: #f7faf5;
    border: 1px solid #dfe8d7;
    border-left: 5px solid var(--correct-border);
    padding: 16px;
    margin-top: 16px;
    border-radius: 14px;
}

.explanation-box {
    font-size: 14px;
    margin-bottom: 15px;
    color: #3b4438;
    font-weight: 500;
}

.explanation-title {
    font-weight: 800;
    margin-bottom: 5px;
    color: #263522;
}

/* Màn hình thành công */
.success-box {
    text-align: center;
    padding: 46px 24px;
    background: #fffdf9;
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 8px 24px rgba(47, 42, 36, 0.05);
}

.success-title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--primary-dark);
}

.success-title::before {
    content: "🎉 ";
}

.success-message {
    font-size: 16px;
    color: var(--muted);
    margin-bottom: 30px;
    font-weight: 500;
}

.fallback-alert {
    display: none;
    background-color: #fff4f4;
    border: 1px solid #f3b9b9;
    color: var(--wrong-text);
    padding: 15px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 25px;
    text-align: left;
}



/* Mobile */
@media (max-width: 640px) {
    body {
        padding: 0;
        background: var(--bg);
    }

    .container {
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 22px;
        box-shadow: none;
    }

    h1 {
        font-size: 26px;
    }

    .question-card {
        padding: 18px;
        border-radius: 16px;
    }

    .review-header {
        padding: 16px;
    }


}
