/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #1a5276;
    --primary-dark: #0e3a5c;
    --primary-light: #2980b9;
    --accent: #27ae60;
    --accent-dark: #1e8449;
    --danger: #e74c3c;
    --warning: #f39c12;
    --bg: #f0f4f8;
    --card: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #dce1e6;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

/* === Header === */
.header {
    background: linear-gradient(135deg, #0c2233 0%, var(--primary-dark) 50%, var(--primary) 100%);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

/* Top row: logo + lang + auth */
.header-top {
    display: flex;
    align-items: center;
    padding: 16px 0 12px;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Bottom row: navigation */
.header-nav {
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.12);
}
.nav {
    display: flex;
    gap: 0;
}
.nav-link {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    padding: 11px 22px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    position: relative;
    letter-spacing: .2px;
}
.nav-link:hover { color: white; background: rgba(255,255,255,0.07); }
.nav-link.active { color: white; background: rgba(255,255,255,0.1); }
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 20%; right: 20%;
    height: 2.5px;
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
    border-radius: 2px;
}

.logo { display: flex; align-items: center; gap: 14px; }
.logo-icon { font-size: 36px; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3)); }
.logo h1 { font-size: 21px; font-weight: 700; margin: 0; letter-spacing: -.3px; }
.logo .subtitle { font-size: 12px; opacity: 0.55; margin: 2px 0 0; font-weight: 400; letter-spacing: .2px; }

.mobile-menu-btn {
    display: none;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    margin-left: 8px;
    transition: background .2s;
}
.mobile-menu-btn:hover { background: rgba(255,255,255,0.18); }

.mobile-nav {
    background: rgba(0,0,0,0.2);
    padding: 8px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mobile-nav .nav-link { padding: 12px 16px; border-radius: 8px; }
.mobile-nav .nav-link:hover { background: rgba(255,255,255,0.1); }

/* === Language Toggle === */
.lang-switch {
    display: inline-flex;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
}
.lang-toggle {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    padding: 5px 12px;
    font-weight: 600;
    font-size: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}
.lang-toggle + .lang-toggle { border-left: 1px solid rgba(255,255,255,0.12); }
.lang-toggle:hover { background: rgba(255,255,255,0.15); color: white; }
.lang-toggle.active { background: rgba(255,255,255,0.18); color: white; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-lg { padding: 14px 32px; font-size: 16px; }

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); transform: translateY(-1px); }

.btn-secondary { background: var(--primary-light); color: white; }
.btn-secondary:hover:not(:disabled) { background: var(--primary); transform: translateY(-1px); }

.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }

/* === Hero === */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #1a6fa0 50%, var(--accent) 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}
.hero h2 { font-size: 36px; margin-bottom: 16px; line-height: 1.3; }
.hero p { font-size: 18px; opacity: 0.9; margin-bottom: 32px; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* === Features === */
.features { padding: 60px 0; }
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}
.feature-card {
    background: var(--card);
    padding: 32px 24px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
}
.feature-icon { font-size: 40px; margin-bottom: 12px; }
.feature-card h3 { font-size: 18px; margin-bottom: 8px; color: var(--primary); }
.feature-card p { font-size: 14px; color: var(--text-light); }

/* === Practice Sets === */
.practice-sets { padding: 60px 0 40px; }

.sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 32px;
}
a.set-card, a.category-card, a.test-select-card {
    text-decoration: none;
    color: inherit;
}

.set-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: block;
}
.set-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}
.set-card h3 { font-size: 18px; margin-bottom: 8px; color: var(--primary); }
.set-card p { font-size: 14px; color: var(--text-light); margin-bottom: 16px; line-height: 1.5; }

.set-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.set-badge-new {
    background: linear-gradient(135deg, var(--accent), #2ecc71);
}

.set-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-light);
}
.set-meta span {
    background: rgba(41,128,185,0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

/* === Categories === */
.categories { padding: 0 0 60px; }
.section-title { font-size: 28px; text-align: center; margin-bottom: 8px; color: var(--primary); }
.section-desc { text-align: center; color: var(--text-light); margin-bottom: 32px; }

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 32px;
}
.category-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.category-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.cat-icon { font-size: 32px; display: block; margin-bottom: 8px; }
.category-card h3 { font-size: 17px; margin-bottom: 4px; }
.category-card p { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.cat-count {
    font-size: 12px;
    color: var(--primary-light);
    font-weight: 600;
    background: rgba(41,128,185,0.1);
    padding: 4px 10px;
    border-radius: 20px;
}

/* === Test Selection === */
.test-select-heading {
    font-size: 20px;
    color: var(--primary);
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.test-select-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.test-select-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    cursor: pointer;
    transition: all 0.2s;
}
.test-select-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.test-select-card.card-cat {
    border-left: 4px solid var(--primary-light);
}

.test-select-icon {
    font-size: 32px;
    flex-shrink: 0;
    width: 48px;
    text-align: center;
}

.test-select-info {
    flex: 1;
    min-width: 0;
}
.test-select-info h4 {
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--text);
}
.test-select-info p {
    font-size: 13px;
    color: var(--text-light);
    margin: 0;
    line-height: 1.4;
}

.new-tag {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), #2ecc71);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.test-select-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}
.test-select-meta span {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-light);
    background: rgba(41,128,185,0.1);
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    text-align: center;
}

@media (max-width: 600px) {
    .test-select-card { flex-wrap: wrap; padding: 16px; }
    .test-select-icon { width: 36px; font-size: 24px; }
    .test-select-meta { flex-direction: row; width: 100%; margin-top: 8px; }
}

/* === Test Page === */
.test-header { margin: 24px 0 16px; }
.test-info { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.test-info h2 { font-size: 22px; color: var(--primary); }
.test-meta { font-size: 14px; color: var(--text-light); }
.separator { margin: 0 8px; }

.progress-bar {
    background: var(--border);
    border-radius: 8px;
    height: 8px;
    margin-top: 12px;
    overflow: hidden;
}
.progress-fill {
    background: linear-gradient(90deg, var(--accent), var(--primary-light));
    height: 100%;
    border-radius: 8px;
    transition: width 0.4s ease;
    width: 0%;
}

/* === Question Card === */
.question-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.question-number {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
}
.question-text { font-size: 18px; font-weight: 600; margin-bottom: 24px; line-height: 1.5; }

.answers { display: flex; flex-direction: column; gap: 12px; }
.answer-btn {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: white;
    cursor: pointer;
    text-align: left;
    font-size: 15px;
    transition: all 0.2s;
    width: 100%;
}
.answer-btn:hover:not(:disabled) { border-color: var(--primary-light); background: rgba(41,128,185,0.04); }
.answer-btn:disabled { cursor: not-allowed; }

.answer-letter {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
}
.answer-text { padding-top: 4px; }

.answer-btn.correct { border-color: var(--accent); background: rgba(39,174,96,0.08); }
.answer-btn.correct .answer-letter { background: var(--accent); color: white; }

.answer-btn.incorrect { border-color: var(--danger); background: rgba(231,76,60,0.08); }
.answer-btn.incorrect .answer-letter { background: var(--danger); color: white; }

.answer-btn.reveal-correct { border-color: var(--accent); background: rgba(39,174,96,0.08); }
.answer-btn.reveal-correct .answer-letter { background: var(--accent); color: white; }

/* === Explanation === */
.explanation {
    margin-top: 20px;
    padding: 16px 20px;
    background: #fef9e7;
    border-left: 4px solid var(--warning);
    border-radius: 0 8px 8px 0;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: fadeIn 0.3s ease;
}
.explanation-icon { font-size: 20px; flex-shrink: 0; }
.explanation p { font-size: 14px; line-height: 1.6; }

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

.question-actions { margin-top: 24px; display: flex; justify-content: flex-end; }

/* === Results === */
.results-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 48px 32px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    margin: 24px 0;
}
.results-icon { font-size: 64px; margin-bottom: 16px; }
.results-card h2 { font-size: 28px; margin-bottom: 24px; }

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    border: 6px solid var(--accent);
}
.score-circle.fail { border-color: var(--danger); }
.score-number { font-size: 36px; font-weight: 800; }

.results-detail { font-size: 16px; color: var(--text-light); margin-bottom: 24px; }

.results-stats { display: flex; justify-content: center; gap: 40px; margin-bottom: 32px; }
.stat { text-align: center; }
.stat-value { display: block; font-size: 28px; font-weight: 800; }
.stat-value.correct { color: var(--accent); }
.stat-value.incorrect { color: var(--danger); }
.stat-label { font-size: 13px; color: var(--text-light); }

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

/* Review */
.review-section { margin: 32px 0; }
.review-section h3 { font-size: 22px; margin-bottom: 16px; color: var(--primary); }

.review-item {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--danger);
}
.review-item .q-text { font-weight: 600; margin-bottom: 8px; }
.review-item .your-answer { color: var(--danger); font-size: 14px; }
.review-item .correct-answer { color: var(--accent); font-size: 14px; font-weight: 600; }
.review-item .review-explanation { font-size: 13px; color: var(--text-light); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

/* === Road Signs === */
.signs-category { margin-bottom: 40px; }
.signs-cat-title { font-size: 22px; margin-bottom: 20px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }

.signs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.sign-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}
.sign-card:hover { transform: translateY(-2px); }
.sign-card h4 { margin: 8px 0 4px; font-size: 14px; }
.sign-card p { font-size: 12px; color: var(--text-light); }

.sign-visual {
    width: 80px;
    height: 80px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 16px;
    border-radius: 8px;
}
.sign-stop { background: #e74c3c; color: white; border-radius: 8px; font-size: 18px; transform: rotate(0deg); clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%); }
.sign-yield { background: white; color: #e74c3c; border: 4px solid #e74c3c; clip-path: polygon(50% 100%, 0% 0%, 100% 0%); height: 75px; font-size: 11px; padding-top: 10px; }
.sign-speed { background: white; border: 3px solid black; border-radius: 0; font-size: 28px; }
.sign-dne { background: white; border: 3px solid #e74c3c; border-radius: 50%; font-size: 28px; }
.sign-wrong-way { background: #e74c3c; color: white; border-radius: 0; font-size: 10px; }
.sign-oneway { background: #2c3e50; color: white; border-radius: 0; width: 120px; height: 40px; font-size: 12px; }
.sign-no-uturn { background: white; border: 3px solid #e74c3c; border-radius: 50%; font-size: 20px; }
.sign-no-pass { background: white; border: 3px solid black; border-radius: 0; font-size: 10px; font-weight: 700; }
.sign-curve { background: #f1c40f; color: black; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); font-size: 28px; }
.sign-merge { background: #f1c40f; color: black; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); font-size: 20px; }
.sign-school { background: #f1c40f; color: black; clip-path: polygon(50% 0%, 0% 50%, 10% 100%, 90% 100%, 100% 50%); font-size: 28px; padding-bottom: 10px; }
.sign-ped { background: #f1c40f; color: black; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); font-size: 28px; }
.sign-slippery { background: #f1c40f; color: black; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); font-size: 22px; }
.sign-railroad { background: #f1c40f; color: black; border-radius: 50%; font-size: 18px; }
.sign-hill { background: #f1c40f; color: black; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); font-size: 24px; }
.sign-narrow { background: #f1c40f; color: black; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); font-size: 20px; }
.sign-interstate { background: #003399; color: white; border-radius: 0; clip-path: polygon(10% 0%, 90% 0%, 100% 40%, 80% 100%, 20% 100%, 0% 40%); font-size: 22px; }
.sign-hospital { background: #2980b9; color: white; border-radius: 0; font-size: 32px; }
.sign-info { background: #2980b9; color: white; border-radius: 0; font-size: 32px; }
.sign-food { background: #2980b9; color: white; border-radius: 0; font-size: 32px; }
.sign-construction { background: #e67e22; color: black; border-radius: 0; font-size: 32px; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); }
.sign-detour { background: #e67e22; color: black; border-radius: 0; font-size: 11px; font-weight: 900; }
.sign-flagger { background: #e67e22; color: black; border-radius: 0; font-size: 32px; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); }

/* === Info Page === */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 32px;
}
.info-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}
.info-card h3 { font-size: 18px; margin-bottom: 16px; color: var(--primary); }

.info-table { width: 100%; border-collapse: collapse; }
.info-table td { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.info-table tr:last-child td { border-bottom: none; }
.info-table td:last-child { text-align: right; }

.info-list { list-style: none; }
.info-list li { padding: 6px 0; font-size: 14px; position: relative; padding-left: 20px; }
.info-list li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.info-list a { color: var(--primary-light); }

.tips-card { grid-column: 1 / -1; margin-top: 8px; }
.tips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.tip { display: flex; gap: 12px; align-items: flex-start; }
.tip-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}
.tip p { font-size: 14px; }

/* === Footer === */
.footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.7);
    padding: 24px 0;
    text-align: center;
    font-size: 13px;
    margin-top: 60px;
}
.footer a { color: rgba(255,255,255,0.9); }
.footer p { margin-bottom: 4px; }

/* === Auth === */
/* === Auth Bar === */
.auth-bar { display: flex; align-items: center; gap: 8px; }
.auth-bar button {
    font-size: 13px; padding: 6px 18px; border-radius: 24px; border: 1.5px solid rgba(255,255,255,.7);
    background: transparent; color: white; cursor: pointer; transition: all .25s ease;
    font-weight: 500; letter-spacing: .3px; backdrop-filter: blur(4px); white-space: nowrap;
}
.auth-bar button:hover {
    background: white; color: var(--primary); border-color: white;
    transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.auth-bar .user-badge {
    font-size: 13px; padding: 6px 14px; border-radius: 24px; border: 1.5px solid rgba(255,215,0,.5);
    background: rgba(255,215,0,.15); color: white; backdrop-filter: blur(4px);
    cursor: default; white-space: nowrap;
}

/* === Modal Overlay === */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 300;
    align-items: center; justify-content: center;
    background: rgba(15,23,42,.55);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.modal-overlay.show { display: flex; }

/* === Modal Card === */
.modal {
    background: #fff; border-radius: 20px; padding: 40px 36px 36px;
    width: 400px; max-width: 92vw; position: relative;
    box-shadow: 0 25px 60px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.04);
    animation: modalIn .3s cubic-bezier(.16,1,.3,1) forwards;
    text-align: left; color: #1e293b;
}
@keyframes modalIn {
    from { transform: translateY(16px) scale(.97); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal .modal-icon {
    width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center; font-size: 24px;
    background: linear-gradient(135deg, var(--primary), #667eea); color: white;
    box-shadow: 0 8px 20px rgba(37,99,235,.25);
}
.modal h2 {
    margin: 0 0 4px; color: #1e293b; font-size: 22px; font-weight: 700;
    text-align: center; letter-spacing: -.3px;
}
.modal .modal-subtitle {
    text-align: center; color: #94a3b8; font-size: 14px; margin-bottom: 24px;
}

/* Input groups with icons */
.modal .input-group { position: relative; margin-bottom: 14px; }
.modal .input-group .input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: #94a3b8; font-size: 15px; pointer-events: none; transition: color .2s;
    line-height: 1;
}
.modal .input-group:focus-within .input-icon { color: var(--primary); }
.modal input {
    display: block; width: 100%; padding: 13px 14px 13px 40px;
    border: 1.5px solid #e2e8f0; border-radius: 12px; font-size: 15px;
    box-sizing: border-box; background: #f8fafc; color: #1e293b;
    transition: all .2s ease; outline: none; margin: 0;
}
.modal input::placeholder { color: #94a3b8; }
.modal input:focus {
    border-color: var(--primary); background: white;
    box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}

/* Google sign-in button container */
.modal .g-signin-btn {
    display: flex; justify-content: center; margin: 0 auto;
}
.modal .divider {
    display: flex; align-items: center; gap: 12px;
    margin: 18px 0; color: #94a3b8; font-size: 13px;
}
.modal .divider::before, .modal .divider::after {
    content: ''; flex: 1; height: 1px; background: #e2e8f0;
}

/* Submit button */
.modal .submit-btn {
    width: 100%; padding: 13px; font-size: 15px; font-weight: 600;
    border: none; border-radius: 12px; cursor: pointer; margin-top: 6px;
    background: linear-gradient(135deg, var(--primary), #667eea); color: white;
    letter-spacing: .3px; transition: all .25s ease;
    box-shadow: 0 4px 14px rgba(37,99,235,.25);
}
.modal .submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37,99,235,.35);
}
.modal .submit-btn:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(37,99,235,.2); }

/* Switch link */
.modal .switch {
    font-size: 14px; color: #64748b; margin-top: 20px; text-align: center;
}
.modal .switch a {
    color: var(--primary); cursor: pointer; text-decoration: none; font-weight: 600;
}
.modal .switch a:hover { text-decoration: underline; }

/* Close button */
.modal .close-btn {
    position: absolute; top: 14px; right: 16px; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3em; cursor: pointer; color: #94a3b8;
    background: #f1f5f9; border: none; border-radius: 10px; transition: all .2s ease;
}
.modal .close-btn:hover { background: #e2e8f0; color: #475569; }

/* Error message */
.modal .error {
    color: #ef4444; font-size: 13px; min-height: 0; text-align: center;
    padding: 0; margin: 0; border-radius: 8px; transition: all .2s;
}
.modal .error:not(:empty) {
    background: #fef2f2; border: 1px solid #fecaca;
    padding: 10px 14px; margin: 0 0 14px;
}

/* === Wrong Answers Review Section === */
.wrong-answers-section {
    padding: 48px 0 32px;
    background: linear-gradient(135deg, #f0f4ff 0%, #fdf2f8 50%, #fff7ed 100%);
    border-top: 3px solid var(--primary);
    border-bottom: 1px solid #e2e8f0;
}
.wrong-header { text-align: center; margin-bottom: 28px; }
.wrong-subtitle { color: #64748b; font-size: 15px; margin-top: 4px; }
.wrong-stats {
    display: flex; justify-content: center; align-items: center; gap: 12px;
    margin-top: 16px;
}
.wrong-stat-badge {
    background: var(--primary); color: white; padding: 6px 18px;
    border-radius: 20px; font-size: 14px; font-weight: 600;
}
.wrong-clear-btn {
    background: none; border: 1.5px solid #e2e8f0; color: #64748b;
    padding: 6px 16px; border-radius: 20px; font-size: 13px; cursor: pointer;
    transition: all .2s;
}
.wrong-clear-btn:hover { border-color: #ef4444; color: #ef4444; }

.wrong-item {
    background: white; border-radius: 14px; padding: 20px 24px;
    margin-bottom: 14px; border: 1px solid #e2e8f0;
    position: relative; box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.wrong-delete {
    position: absolute; top: 14px; right: 16px;
    background: #f1f5f9; border: none; width: 28px; height: 28px;
    border-radius: 8px; cursor: pointer; color: #94a3b8; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s;
}
.wrong-delete:hover { background: #fef2f2; color: #ef4444; }
.wrong-question { font-weight: 600; font-size: 15px; margin-bottom: 12px; padding-right: 36px; color: #1e293b; }
.wrong-answers { display: flex; flex-direction: column; gap: 4px; }
.wrong-answer {
    padding: 8px 14px; border-radius: 8px; font-size: 14px;
    background: #f8fafc; color: #475569;
}
.wrong-correct { background: #ecfdf5; color: #059669; font-weight: 600; }
.wrong-yours { background: #fef2f2; color: #dc2626; }
.wrong-explanation {
    margin-top: 12px; padding: 10px 14px; background: #f0f4ff;
    border-radius: 8px; font-size: 13px; color: #475569;
    border-left: 3px solid var(--primary);
}
.wrong-meta { font-size: 12px; color: #94a3b8; margin-top: 8px; }
.wrong-empty { text-align: center; padding: 48px 20px; color: #94a3b8; }
.wrong-empty-icon { font-size: 48px; margin-bottom: 12px; }

/* Review page login prompt */
.review-login-prompt {
    text-align: center; padding: 80px 20px; max-width: 480px; margin: 0 auto;
}
.review-login-prompt .prompt-icon { font-size: 56px; margin-bottom: 16px; }
.review-login-prompt h2 { color: #1e293b; font-size: 24px; margin-bottom: 8px; }
.review-login-prompt p { color: #64748b; font-size: 15px; margin-bottom: 28px; }
.review-login-prompt .prompt-buttons { display: flex; justify-content: center; gap: 12px; }
.review-login-prompt .prompt-buttons .btn {
    padding: 12px 32px; border-radius: 12px; font-size: 15px; font-weight: 600;
    cursor: pointer; border: none; transition: all .2s;
}
.review-login-prompt .prompt-buttons .btn-primary {
    background: linear-gradient(135deg, var(--primary), #667eea); color: white;
    box-shadow: 0 4px 14px rgba(37,99,235,.25);
}
.review-login-prompt .prompt-buttons .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,.35); }
.review-login-prompt .prompt-buttons .btn-secondary {
    background: #f1f5f9; color: #475569; border: 1.5px solid #e2e8f0;
}
.review-login-prompt .prompt-buttons .btn-secondary:hover { background: #e2e8f0; }

/* === Go-to-Question === */
.btn-goto {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
}
.btn-goto:hover { opacity: .85; }
.goto-dialog {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.goto-dialog label { font-size: 14px; font-weight: 500; white-space: nowrap; }
.goto-dialog input[type="number"] {
    width: 70px;
    padding: 6px 8px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}
.goto-dialog input[type="number"]:focus { border-color: var(--primary); outline: none; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* === Responsive === */
@media (max-width: 768px) {
    .header-nav { display: none; }
    .mobile-menu-btn { display: block; }
    .hero h2 { font-size: 26px; }
    .hero p { font-size: 15px; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .question-card { padding: 20px; }
    .question-text { font-size: 16px; }
    .results-stats { gap: 24px; }
    .results-actions { flex-direction: column; align-items: center; }
    .info-grid { grid-template-columns: 1fr; }
    .signs-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .category-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .logo h1 { font-size: 16px; }
    .logo .subtitle { font-size: 10px; }
    .hero { padding: 40px 0; }
    .hero h2 { font-size: 22px; }
}

/* Page Transitions */
.page { padding-bottom: 40px; }
#page-signs, #page-info { padding-top: 32px; }

/* Total Views (header) */
.total-views {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
}
.total-views .tv-num { font-weight: 700; color: #fff; }

/* Visitor Stats */
.visitor-stats {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.15);
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 13px;
    opacity: 0.8;
}
.visitor-stats .stat { display: flex; align-items: center; gap: 4px; }
.visitor-stats .stat-num { font-weight: 700; }
