/* =========================================
   HUGUKA — Driving License Learning App
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
    --primary: #1B4965;
    --primary-dark: #143a52;
    --primary-light: #e9f0f5;
    --accent: #FFB703;
    --accent-dark: #e5a503;
    --accent-light: #fff6de;
    --success: #2d8a4e;
    --success-light: #eaf5ee;
    --danger: #c4342d;
    --danger-light: #fceae9;
    --gray-50: #f7f8f9;
    --gray-100: #eef0f2;
    --gray-200: #dde1e5;
    --gray-300: #c5cad1;
    --gray-400: #9ea5ae;
    --gray-600: #6b7280;
    --gray-700: #4b5563;
    --gray-800: #333b47;
    --gray-900: #1c2028;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(27,73,101,0.06);
    --shadow-md: 0 4px 12px rgba(27,73,101,0.08);
    --shadow-lg: 0 8px 24px rgba(27,73,101,0.1);
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

body > main,
body > .practice-container,
body > #loadingState,
body > #practiceApp,
body > #introScreen,
body > #examScreen,
body > #resultsScreen {
    flex: 1;
}

.page-content {
    flex: 1;
}

/* ==============================
   NAVBAR
   ============================== */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.logo-icon svg {
    width: 32px;
    height: 32px;
}

.logo-text {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary);
    letter-spacing: -0.3px;
}

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

.nav-link {
    text-decoration: none;
    color: var(--gray-600);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

/* ==============================
   BUTTONS
   ============================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border: 1.5px solid transparent;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

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

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

.btn-accent {
    background: var(--accent);
    color: var(--gray-900);
    border-color: var(--accent);
    font-weight: 700;
}

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

.btn-secondary {
    background: var(--gray-800);
    color: var(--white);
    border-color: var(--gray-800);
}

.btn-secondary:hover {
    background: var(--gray-900);
    border-color: var(--gray-900);
}

.btn-outline {
    background: var(--white);
    color: var(--primary);
    border-color: var(--gray-300);
}

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

.btn-success {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}

.btn-success:hover {
    background: #256e3e;
    border-color: #256e3e;
}

.btn-skip {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-200);
}

.btn-skip:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

.btn-large {
    padding: 12px 24px;
    font-size: 0.9375rem;
}

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

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ==============================
   LOADING
   ============================== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 14px;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ==============================
   HOME PAGE — HERO
   ============================== */
.hero {
    max-width: 1080px;
    margin: 0 auto;
    padding: 48px 20px 64px;
}

.hero-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    margin-bottom: 56px;
}

.hero-content {
    max-width: 480px;
}

.hero-badge {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent-dark);
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 0.3px;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.hero-highlight {
    color: var(--primary);
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 28px;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Stats Card */
.stats-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.stats-card-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-400);
    margin-bottom: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--gray-600);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

/* Feature Cards */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--gray-300);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-left-color 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    border-left-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.feature-card:nth-child(2) {
    border-left-color: var(--accent);
}

.feature-card:nth-child(2):hover {
    border-left-color: var(--accent-dark);
}

.feature-card:nth-child(3) {
    border-left-color: var(--success);
}

.feature-card:nth-child(3):hover {
    border-left-color: #1e6b38;
}

.feature-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    background: var(--primary-light);
    color: var(--primary);
}

.feature-card:nth-child(2) .feature-icon {
    background: var(--accent-light);
    color: var(--accent-dark);
}

.feature-card:nth-child(3) .feature-icon {
    background: var(--success-light);
    color: var(--success);
}

.feature-icon svg {
    width: 20px;
    height: 20px;
}

.feature-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--gray-600);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 14px;
}

.feature-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.feature-link:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    border-top: 1px solid var(--gray-200);
    padding: 28px 20px;
    background: var(--white);
    margin-top: auto;
}

.footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--gray-800);
    font-weight: 600;
}

.footer-brand svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.footer-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-link {
    text-decoration: none;
    color: var(--gray-600);
    font-size: 0.8rem;
    font-weight: 500;
    transition: color 0.15s;
}

.footer-link:hover {
    color: var(--primary);
}

.footer-sub {
    width: 100%;
    text-align: center;
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--gray-100);
    color: var(--gray-400);
    font-size: 0.72rem;
}

/* ==============================
   PAGE HEADER
   ============================== */
.page-header {
    background: var(--primary);
    color: var(--white);
    padding: 28px 20px;
}

.page-header-content {
    max-width: 800px;
    margin: 0 auto;
}

.page-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.page-header p {
    opacity: 0.75;
    font-size: 0.9rem;
}

/* ==============================
   PRACTICE PAGE
   ============================== */
.practice-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 28px 20px;
}

.progress-section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 20px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
}

.score-tracker {
    display: flex;
    gap: 12px;
    align-items: center;
}

.score-correct {
    color: var(--success);
}

.score-wrong {
    color: var(--danger);
}

.progress-bar-outer {
    height: 4px;
    background: var(--gray-200);
    border-radius: 100px;
    overflow: hidden;
}

.progress-bar-inner {
    height: 100%;
    background: var(--primary);
    border-radius: 100px;
    transition: width 0.3s ease;
}

/* Question Card */
.question-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.question-number-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 100px;
    margin-bottom: 14px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.question-image {
    margin-bottom: 20px;
    text-align: center;
}

.question-image img {
    max-width: 100%;
    max-height: 280px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    object-fit: contain;
}

.question-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.65;
    margin-bottom: 22px;
}

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

.option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--gray-800);
    transition: border-color 0.15s, background 0.15s;
    width: 100%;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option-letter {
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--gray-600);
    transition: all 0.15s;
    text-transform: uppercase;
    flex-shrink: 0;
}

.option-btn:hover:not(:disabled) .option-letter {
    background: var(--primary);
    color: var(--white);
}

.option-btn.correct {
    border-color: var(--success) !important;
    background: var(--success-light) !important;
}

.option-btn.correct .option-letter {
    background: var(--success) !important;
    color: var(--white) !important;
}

.option-btn.wrong {
    border-color: var(--danger) !important;
    background: var(--danger-light) !important;
}

.option-btn.wrong .option-letter {
    background: var(--danger) !important;
    color: var(--white) !important;
}

.option-btn.show-correct {
    border-color: var(--success) !important;
    background: var(--success-light) !important;
}

.option-btn.show-correct .option-letter {
    background: var(--success) !important;
    color: var(--white) !important;
}

/* Feedback */
.feedback-box {
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.feedback-box.correct-feedback {
    background: var(--success-light);
    border-color: #b3d9c2;
}

.feedback-box.wrong-feedback {
    background: var(--danger-light);
    border-color: #f0b4b1;
}

.feedback-status-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.feedback-body {
    flex: 1;
}

.feedback-message {
    font-weight: 700;
    font-size: 0.9rem;
}

.feedback-box.correct-feedback .feedback-message { color: var(--success); }
.feedback-box.wrong-feedback .feedback-message { color: var(--danger); }

.correct-answer-info {
    font-size: 0.85rem;
    color: var(--gray-700);
    margin-top: 2px;
}

/* Navigation */
.nav-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.practice-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* ==============================
   EXAM PAGE
   ============================== */
.exam-intro {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    padding: 40px 20px;
}

.intro-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-md);
}

.intro-header {
    text-align: center;
    margin-bottom: 28px;
}

.intro-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.intro-icon svg {
    width: 24px;
    height: 24px;
    color: var(--accent-dark);
}

.intro-card h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--gray-900);
    letter-spacing: -0.3px;
}

.intro-subtitle {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.intro-rules {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--gray-700);
}

.rule-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--primary-light);
}

.rule-icon svg {
    width: 14px;
    height: 14px;
    color: var(--primary);
}

.intro-card .btn-start {
    width: 100%;
}

/* Exam Header */
.exam-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 20px;
    position: sticky;
    top: 56px;
    z-index: 50;
}

.exam-progress-info {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.exam-q-counter {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--gray-800);
    white-space: nowrap;
}

.exam-mini-progress {
    flex: 1;
    height: 4px;
    background: var(--gray-200);
    border-radius: 100px;
    overflow: hidden;
}

.exam-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 100px;
    transition: width 0.3s ease;
}

.answered-count {
    font-size: 0.8rem;
    color: var(--gray-600);
    white-space: nowrap;
}

.exam-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* Question Dots */
.question-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 14px;
}

.q-dot {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-300);
    background: var(--white);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
    font-family: var(--font);
}

.q-dot:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.q-dot.answered {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.q-dot.current {
    border-color: var(--accent);
    color: var(--accent-dark);
    background: var(--accent-light);
    box-shadow: 0 0 0 2px rgba(255,183,3,0.25);
}

.q-dot.current.answered {
    background: var(--primary-dark);
    color: var(--white);
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 2px rgba(27,73,101,0.25);
}

/* Exam Question Card */
.exam-question-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.exam-q-badge {
    display: inline-block;
    background: var(--accent-light);
    color: #92640a;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 100px;
    margin-bottom: 14px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.exam-question-image {
    margin-bottom: 20px;
    text-align: center;
}

.exam-question-image img {
    max-width: 100%;
    max-height: 280px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    object-fit: contain;
}

.exam-question-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.65;
    margin-bottom: 22px;
}

.exam-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.exam-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--gray-800);
    transition: all 0.15s;
    width: 100%;
    text-align: left;
}

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

.exam-option:hover .option-letter {
    background: var(--primary);
    color: var(--white);
}

.exam-option.selected {
    border-color: var(--primary) !important;
    background: var(--primary-light) !important;
}

.exam-option.selected .option-letter {
    background: var(--primary);
    color: var(--white);
}

.exam-nav-buttons {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* ==============================
   RESULTS PAGE
   ============================== */
.results-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 36px 20px;
}

.score-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.score-badge {
    margin-bottom: 20px;
}

.score-visual {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    border: 4px solid var(--gray-200);
}

.score-visual.passed {
    border-color: var(--success);
    background: var(--success-light);
}

.score-visual.failed {
    border-color: var(--danger);
    background: var(--danger-light);
}

.score-visual svg {
    width: 40px;
    height: 40px;
}

.score-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    letter-spacing: -1px;
}

.score-percent {
    font-size: 1rem;
    color: var(--gray-600);
    margin-top: 4px;
}

.score-status {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    display: inline-block;
}

.score-status.passed {
    background: var(--success-light);
    color: var(--success);
}

.score-status.failed {
    background: var(--danger-light);
    color: var(--danger);
}

.score-breakdown {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.875rem;
}

.breakdown-item.correct {
    background: var(--success-light);
    color: var(--success);
}

.breakdown-item.wrong {
    background: var(--danger-light);
    color: var(--danger);
}

.breakdown-icon {
    display: flex;
    align-items: center;
}

.breakdown-icon svg {
    width: 16px;
    height: 16px;
}

.breakdown-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.results-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.detailed-results h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--gray-800);
}

.result-item {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 12px;
    border-left: 3px solid var(--gray-300);
}

.result-item.correct-result {
    border-left-color: var(--success);
}

.result-item.wrong-result {
    border-left-color: var(--danger);
}

.result-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.result-status-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.result-status-icon svg {
    width: 20px;
    height: 20px;
}

.result-question-text {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-900);
    flex: 1;
}

.result-question-image {
    margin: 8px 0 8px 30px;
}

.result-question-image img {
    max-width: 200px;
    max-height: 140px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    object-fit: contain;
}

.result-answers {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 30px;
}

.result-answer-line {
    font-size: 0.825rem;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.user-answer {
    background: var(--danger-light);
    color: var(--danger);
}

.user-answer.was-correct {
    background: var(--success-light);
    color: var(--success);
}

.correct-answer-line {
    background: var(--success-light);
    color: var(--success);
}

/* ==============================
   MODAL
   ============================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 32, 40, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.modal-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.15s ease;
}

@keyframes modalIn {
    from { transform: translateY(8px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    background: var(--accent-light);
}

.modal-icon svg {
    width: 22px;
    height: 22px;
    color: var(--accent-dark);
}

.modal-box h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--gray-900);
}

.modal-box p {
    color: var(--gray-600);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
    .hero-top {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-content {
        max-width: 100%;
        text-align: center;
    }

    .hero-cta {
        justify-content: center;
    }

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

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .nav-links { gap: 2px; }
    .nav-link { padding: 6px 10px; font-size: 0.8rem; }

    .hero { padding: 32px 16px 48px; }
    .hero-title { font-size: 1.75rem; }
    .hero-subtitle { font-size: 0.9rem; }

    .stats-grid { grid-template-columns: 1fr; gap: 12px; }
    .stat-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }

    .hero-cta { flex-direction: column; align-items: stretch; }

    .practice-container,
    .exam-container,
    .results-container { padding-left: 14px; padding-right: 14px; }

    .question-card,
    .exam-question-card { padding: 18px; }

    .option-btn,
    .exam-option { padding: 11px 14px; font-size: 0.85rem; }
    .option-letter { min-width: 26px; height: 26px; font-size: 0.72rem; }

    .nav-buttons { flex-direction: column; }
    .exam-nav-buttons { flex-direction: column; }
    .intro-card { padding: 28px 20px; }

    .score-card { padding: 28px 20px; }
    .score-number { font-size: 2rem; }
    .score-visual { width: 80px; height: 80px; }
    .score-visual svg { width: 32px; height: 32px; }

    .results-actions { flex-direction: column; align-items: stretch; }
    .practice-controls { flex-direction: column; align-items: stretch; }

    .progress-info { flex-direction: column; gap: 4px; align-items: flex-start; }

    .page-header { padding: 20px 16px; }
    .page-header h1 { font-size: 1.2rem; }

    .footer { padding: 20px 14px; }
    .footer-brand { font-size: 0.8rem; }
    .footer-links { gap: 14px; }
    .footer-link { font-size: 0.75rem; }
    .footer-sub { font-size: 0.68rem; margin-top: 10px; padding-top: 10px; }

    .question-image img,
    .exam-question-image img { max-height: 200px; }

    .feedback-box { padding: 12px; }
}

/* ==============================
   LOGIN PAGE
   ============================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    padding: 40px 20px;
}

.login-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-md);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--primary);
}

.login-icon svg {
    width: 24px;
    height: 24px;
}

.login-card h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--gray-900);
    letter-spacing: -0.3px;
}

.login-subtitle {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--danger-light);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 20px;
    border: 1px solid #f0b4b1;
}

.login-error svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--gray-700);
}

.form-group input {
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--gray-900);
    transition: border-color 0.15s;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 73, 101, 0.1);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

.login-btn {
    width: 100%;
    margin-top: 4px;
}

/* Nav user section */
.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-user-email {
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 500;
}

.nav-login-btn {
    text-decoration: none;
    color: var(--white);
    background: var(--primary);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    transition: background 0.15s;
}

.nav-login-btn:hover {
    background: var(--primary-dark);
}

.nav-logout-btn {
    text-decoration: none;
    color: var(--gray-600);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.8rem;
    border: 1px solid var(--gray-200);
    transition: all 0.15s;
}

.nav-logout-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--danger-light);
}

@media (max-width: 640px) {
    .login-card { padding: 28px 20px; }
    .nav-user-email { display: none; }
}

@media (max-width: 480px) {
    .q-dot { width: 28px; height: 28px; font-size: 0.68rem; }
    .nav-container { padding: 0 12px; height: 50px; }
    .logo-text { font-size: 0.95rem; }

    .exam-header { padding: 10px 12px; }
    .exam-progress-info { gap: 10px; }
    .exam-q-counter { font-size: 0.78rem; }
    .answered-count { font-size: 0.75rem; }

    .question-dots { padding: 10px; gap: 5px; }

    .modal-box { padding: 24px 18px; }
    .modal-buttons { flex-direction: column; }

    .result-answers { padding-left: 20px; }
    .result-question-text { font-size: 0.85rem; }
    .result-answer-line { font-size: 0.78rem; }
}
