* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 18px;
}

:root {
    --bg: #ede4d3;
    --bg-alt: #e2d6c1;
    --surface: #f9f5ed;
    --border: #c9b896;
    --border-light: #d9ccb0;
    --text: #1a1612;
    --text-mid: #4a3f30;
    --text-muted: #7d7060;
    --accent: #2d7a4f;
    --accent-hover: #1f6340;
    --accent-light: rgba(45, 122, 79, 0.1);
    --secondary: #d4920a;
    --secondary-light: rgba(212, 146, 10, 0.12);
    --verbal: #7c3aed;
    --verbal-light: rgba(124, 58, 237, 0.1);
    --quant: #0d9668;
    --quant-light: rgba(13, 150, 104, 0.1);
    --correct: #16a34a;
    --wrong: #dc2626;
    --radius: 6px;
    --shadow: 0 1px 4px rgba(26, 22, 18, 0.1);
    --shadow-md: 0 4px 14px rgba(26, 22, 18, 0.14);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(165deg, var(--bg) 0%, var(--bg-alt) 100%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
#navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 56px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(26, 22, 18, 0.06);
}

#navbar::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--verbal) 50%, var(--secondary) 100%);
}

.logo {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.3px;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 6px;
}

.nav-links a {
    color: var(--text-mid);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius);
    transition: all 0.15s;
}

.nav-links a:hover {
    background: var(--bg-alt);
    color: var(--text);
}

/* ── MAIN ── */
#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 40px 80px;
}

/* ── HOME ── */
.home {
    padding-top: 80px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.home h1 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
    color: var(--text);
}

.home h1 span {
    color: var(--accent);
}

.home > p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 36px;
    max-width: 520px;
    line-height: 1.7;
}

.home-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 52px;
    justify-content: center;
}

.home-stats {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 52px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 20px 8px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 640px;
}

.home-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-number {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    height: 36px;
    background: var(--border-light);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 13px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(45, 122, 79, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 14px rgba(45, 122, 79, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
}

.home-grid-item {
    background: var(--surface);
    padding: 36px 28px 32px;
    text-align: center;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.home-grid-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.grid-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0 auto 16px;
    background: var(--verbal-light);
    color: var(--verbal);
    border: 1px solid rgba(124, 58, 237, 0.12);
}

.grid-icon-quant {
    background: var(--quant-light);
    color: var(--quant);
    border-color: rgba(13, 150, 104, 0.12);
}

.grid-icon-secondary {
    background: var(--secondary-light);
    color: var(--secondary);
    border-color: rgba(212, 146, 10, 0.15);
}

.home-grid-item h3 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.home-grid-item p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.55;
}

/* ── SECTION HEADER ── */
.section-header {
    margin-bottom: 32px;
}

.section-header h1 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ── TABS ── */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 28px;
    background: var(--bg-alt);
    padding: 3px;
    border-radius: var(--radius);
    width: fit-content;
}

.tab {
    padding: 7px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.82rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    transition: all 0.15s;
    text-decoration: none;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

/* ── TOPIC LIST (Learn) ── */
.topic-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.topic-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-left: 3px solid transparent;
    box-shadow: var(--shadow);
    margin-bottom: 8px;
}

.topic-card-verbal {
    border-left-color: var(--verbal);
}

.topic-card-quant {
    border-left-color: var(--quant);
}

.topic-card:hover {
    background: var(--surface);
    box-shadow: var(--shadow);
    transform: translateX(4px);
}

.topic-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.topic-card p {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.topic-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topic-arrow {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.tag-verbal {
    background: var(--verbal-light);
    color: var(--verbal);
}

.tag-quant {
    background: var(--quant-light);
    color: var(--quant);
}

/* ── LESSON VIEW ── */
.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    display: inline-block;
    margin-bottom: 20px;
    cursor: pointer;
}

.back-link:hover {
    color: var(--text);
}

.lesson-content {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

.lesson-content h2 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.lesson-content h3 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 10px;
    color: var(--accent);
}

.lesson-content p {
    margin-bottom: 12px;
    font-size: 0.9rem;
    line-height: 1.7;
}

.lesson-content ul, .lesson-content ol {
    margin-bottom: 12px;
    padding-left: 20px;
}

.lesson-content li {
    margin-bottom: 5px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.example-box {
    background: var(--bg);
    border-left: 3px solid var(--secondary);
    padding: 18px 20px;
    margin: 14px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.example-box .label {
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--secondary);
    margin-bottom: 8px;
}

.tip-box {
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
    padding: 14px 18px;
    margin: 14px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.88rem;
}

.tip-box .label {
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--accent);
    margin-bottom: 4px;
}

/* ── MODULE GRID (Mock) ── */
.mock-filters {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.module-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 22px 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--border);
    position: relative;
}

.module-card-verbal {
    border-left-color: var(--verbal);
}

.module-card-quant {
    border-left-color: var(--quant);
}

.module-card:hover {
    border-left-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.module-num {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    opacity: 0.6;
}

.module-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.3;
}

.module-card .module-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-card .q-count {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* ── EXAM VIEW ── */
.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

.exam-header h2 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.1rem;
    font-weight: 600;
}

.exam-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.timer {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.exam-progress {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.question-container {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.question-skill {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding: 2px 8px;
    background: var(--bg-alt);
    border-radius: 3px;
}

.question-text {
    font-size: 1rem;
    margin-bottom: 24px;
    line-height: 1.7;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.12s;
    font-size: 0.9rem;
    background: var(--surface);
}

.option:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.option.selected {
    border-color: var(--accent);
    background: var(--accent-light);
}

.option.correct {
    border-color: var(--correct);
    background: rgba(61, 107, 79, 0.08);
}

.option.wrong {
    border-color: var(--wrong);
    background: rgba(181, 74, 63, 0.06);
}

.option-letter {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--bg-alt);
    color: var(--text-mid);
    flex-shrink: 0;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.option.selected .option-letter {
    background: var(--accent);
    color: #fff;
}

.option.correct .option-letter {
    background: var(--correct);
    color: #fff;
}

.option.wrong .option-letter {
    background: var(--wrong);
    color: #fff;
}

.explanation-box {
    margin-top: 18px;
    padding: 14px 18px;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 0.85rem;
    line-height: 1.6;
    border-left: 3px solid var(--accent);
}

.explanation-box .label {
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--accent);
    margin-bottom: 4px;
}

.exam-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── RESULTS ── */
.results {
    padding: 40px 0;
}

.results-top {
    text-align: center;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 36px;
}

.results-top h2 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.results-top .subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 28px;
}

.score-display {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}

.score-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    margin-bottom: 28px;
}

.results-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.results-breakdown h3 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-item .q-num {
    font-weight: 700;
    width: 28px;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.78rem;
}

.breakdown-item .q-text {
    flex: 1;
    color: var(--text-mid);
}

.breakdown-item .q-status {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breakdown-item .q-status.correct {
    color: var(--correct);
}

.breakdown-item .q-status.wrong {
    color: var(--wrong);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    #navbar {
        padding: 0 16px;
    }

    #app {
        padding: 28px 14px 60px;
    }

    .home h1 {
        font-size: 1.8rem;
    }

    .home-stats {
        flex-wrap: wrap;
        gap: 16px;
        max-width: 100%;
        padding: 16px;
    }

    .stat-divider {
        display: none;
    }

    .home-stat {
        min-width: 40%;
    }

    .home-grid {
        grid-template-columns: 1fr;
    }

    .home-actions {
        flex-direction: column;
        align-items: center;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .lesson-content {
        padding: 24px 18px;
    }

    .question-container {
        padding: 20px 16px;
    }

    .exam-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
