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

:root {
    --bg:       #06091a;
    --surface:  #0d1530;
    --surface2: #152044;
    --border:   #1e3058;
    --accent:   #818cf8;
    --accent2:  #6366f1;
    --text:     #e2e8f0;
    --muted:    #8b9dc3;
    --good:     #4ade80;
    --ok:       #facc15;
    --low:      #f87171;
    --radius:   12px;
    --shadow:   0 8px 40px rgba(0,0,0,0.55);
    --glow:     0 0 32px rgba(129,140,248,0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(ellipse at 15% 40%, rgba(99,102,241,0.09) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 15%, rgba(139,92,246,0.07) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 90%, rgba(59,130,246,0.05) 0%, transparent 45%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Utility ──────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.full-width { width: 100%; }

/* ── Flash messages ───────────────────────────────────────────────────────── */
.flash-container {
    position: fixed; top: 70px; right: 20px; z-index: 1000;
    display: flex; flex-direction: column; gap: 8px;
}
.flash {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; border-radius: var(--radius); font-size: 0.9rem;
    max-width: 360px; box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
}
.flash-success { background: #14532d; border: 1px solid var(--good); }
.flash-error   { background: #450a0a; border: 1px solid var(--low); }
.flash-warning { background: #422006; border: 1px solid var(--ok); }
.flash-info    { background: #0c2844; border: 1px solid var(--accent); }
.flash-close   { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 0 4px; }
@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.navbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 32px; height: 62px;
    background: rgba(6,9,26,0.82);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(129,140,248,0.12);
    position: sticky; top: 0; z-index: 100;
}
.navbar-brand {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.15rem; font-weight: 800; color: var(--text);
    letter-spacing: -0.02em;
}
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 8px;
    background: linear-gradient(135deg, var(--accent2), #a78bfa);
    color: #fff; font-weight: 900; font-size: 0.95rem;
    box-shadow: 0 0 14px rgba(129,140,248,0.4);
}
.brand-name { color: var(--text); }
.navbar-links { display: flex; align-items: center; gap: 20px; }
.navbar-links a { color: var(--muted); font-size: 0.9rem; transition: color 0.2s; }
.navbar-links a:hover { color: var(--text); text-decoration: none; }
.navbar-user {
    color: var(--accent); font-size: 0.82rem; font-weight: 600;
    padding: 4px 12px; background: rgba(129,140,248,0.12);
    border: 1px solid rgba(129,140,248,0.25); border-radius: 20px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
button { cursor: pointer; font-family: inherit; transition: all 0.2s; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent2), #a78bfa);
    color: #fff; font-weight: 600;
    border: none; padding: 10px 22px; border-radius: 8px; font-size: 0.9rem;
    box-shadow: 0 4px 16px rgba(129,140,248,0.3);
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(129,140,248,0.4); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }

.btn-outline {
    background: transparent; color: var(--accent); border: 1px solid rgba(129,140,248,0.4);
    padding: 10px 22px; border-radius: 8px; font-size: 0.9rem;
}
.btn-outline:hover { background: rgba(129,140,248,0.08); border-color: var(--accent); }

.btn-outline-sm {
    background: transparent; color: var(--accent); border: 1px solid rgba(129,140,248,0.35);
    padding: 5px 12px; border-radius: 6px; font-size: 0.8rem;
}
.btn-outline-sm:hover { background: rgba(129,140,248,0.08); }

.btn-danger-sm {
    background: transparent; color: var(--low); border: 1px solid var(--low);
    padding: 5px 12px; border-radius: 6px; font-size: 0.8rem;
}
.btn-danger-sm:hover { background: rgba(248,113,113,0.1); }

.btn-lg { padding: 12px 32px; font-size: 1rem; }

.btn-mic {
    background: var(--surface2); color: var(--text); border: 1px solid var(--border);
    padding: 6px 14px; border-radius: 6px; font-size: 0.82rem;
}
.btn-mic:hover { border-color: var(--accent); color: var(--accent); }
.btn-mic.recording { background: #450a0a; border-color: var(--low); color: var(--low); }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container { max-width: 900px; margin: 0 auto; padding: 32px 24px; }

.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; margin: 16px 0;
    box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

/* ── Level badges ─────────────────────────────────────────────────────────── */
.level-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.75rem; font-weight: 600; padding: 3px 10px;
    border-radius: 20px; margin-top: 4px;
}
.level-badge-sm { font-size: 0.68rem; padding: 2px 8px; }
.level-fresher { background: rgba(74,222,128,0.12); color: #4ade80; border: 1px solid rgba(74,222,128,0.3); }
.level-mid     { background: rgba(250,204,21,0.12);  color: #facc15; border: 1px solid rgba(250,204,21,0.3); }
.level-senior  { background: rgba(251,146,60,0.12);  color: #fb923c; border: 1px solid rgba(251,146,60,0.3); }

/* ── Role card level picker ───────────────────────────────────────────────── */
.role-card-levels { display: flex; flex-direction: column; gap: 10px; }
.level-header {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.88rem; font-weight: 600; margin-bottom: 2px;
}
.back-btn {
    background: none; border: none; color: var(--muted);
    font-size: 1rem; cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.back-btn:hover { color: var(--text); background: var(--surface2); }
.level-sub { font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; }

.level-option {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--surface2); text-decoration: none; color: var(--text);
    transition: border-color 0.2s, background 0.2s;
}
.level-option:hover { text-decoration: none; background: var(--border); }
.level-fresher.level-option:hover { border-color: #4ade80; }
.level-mid.level-option:hover     { border-color: #facc15; }
.level-senior.level-option:hover  { border-color: #fb923c; }
.level-opt-icon { font-size: 1.3rem; }
.level-opt-body { display: flex; flex-direction: column; flex: 1; }
.level-opt-label { font-size: 0.88rem; font-weight: 600; }
.level-opt-years { font-size: 0.72rem; color: var(--muted); }
.level-opt-arrow { color: var(--muted); font-size: 0.9rem; }

/* ── Auth page ────────────────────────────────────────────────────────────── */
.auth-page {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; padding: 24px;
}
.auth-card {
    background: var(--surface);
    border: 1px solid rgba(129,140,248,0.18);
    border-radius: 18px; padding: 40px; width: 100%; max-width: 420px;
    box-shadow: var(--shadow), var(--glow);
}
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-logo-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--accent2), #a78bfa);
    color: #fff; font-weight: 900; font-size: 1.6rem;
    box-shadow: 0 0 28px rgba(129,140,248,0.45);
}
.auth-header h1 { font-size: 1.6rem; font-weight: 700; }
.auth-header p { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }

.tab-group {
    display: flex; background: var(--bg); border-radius: 8px;
    padding: 4px; margin-bottom: 24px;
}
.tab-btn {
    flex: 1; padding: 8px; background: transparent; border: none;
    color: var(--muted); border-radius: 6px; font-size: 0.9rem; font-weight: 500;
}
.tab-btn.active { background: var(--surface2); color: var(--text); }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.hint { color: var(--border); font-weight: 400; }
.form-group input {
    background: var(--bg); border: 1px solid var(--border); color: var(--text);
    padding: 10px 14px; border-radius: 8px; font-size: 0.95rem; width: 100%;
}
.form-group input:focus { outline: none; border-color: var(--accent); }
.auth-switch { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

/* ── Dashboard ────────────────────────────────────────────────────────────── */
.stats-row {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 16px; margin-bottom: 32px;
}
.stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; text-align: center;
}
.stat-value { font-size: 1.8rem; font-weight: 700; background: linear-gradient(135deg, var(--accent), #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

.section-title {
    font-size: 0.82rem; font-weight: 700; margin: 28px 0 16px;
    color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.role-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px 20px; text-align: center;
    transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.role-card:hover {
    border-color: rgba(129,140,248,0.5); transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(129,140,248,0.15);
}
.role-icon { font-size: 2.4rem; margin-bottom: 12px; }
.role-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.role-desc { font-size: 0.78rem; color: var(--muted); margin-bottom: 16px; }

/* ── Interview page ───────────────────────────────────────────────────────── */
.interview-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 8px;
}
.interview-header h2 { font-size: 1.3rem; }
.progress-meta { font-size: 0.85rem; color: var(--muted); }

.sticky-progress { position: sticky; top: 60px; z-index: 50; margin-bottom: 24px; }
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent2), #a78bfa);
    width: 0%; transition: width 0.3s ease; border-radius: 3px;
}

.camera-card { padding: 16px 20px; }
.camera-toggle-row {
    display: flex; align-items: center;
    justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.toggle-label { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.toggle-label input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.camera-hint { font-size: 0.78rem; color: var(--good); }

.alert-warning {
    background: #422006; border: 1px solid var(--ok);
    border-radius: 8px; padding: 10px 16px;
    font-size: 0.88rem; color: var(--ok); margin-bottom: 8px;
}
.paste-flag {
    background: #450a0a; border: 1px solid var(--low);
    border-radius: 6px; padding: 6px 12px;
    font-size: 0.82rem; color: var(--low); margin-top: 6px;
}

.question-card { transition: border-color 0.2s; }
.question-card:focus-within { border-color: var(--accent); }
.question-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.q-number {
    background: var(--accent); color: #0f172a; font-weight: 700;
    font-size: 0.78rem; padding: 2px 8px; border-radius: 4px;
    white-space: nowrap; margin-top: 3px;
}
.question-header h3 { font-size: 1rem; font-weight: 600; line-height: 1.4; }

.answer-area { display: flex; flex-direction: column; gap: 8px; }
textarea {
    background: var(--bg); border: 1px solid var(--border); color: var(--text);
    padding: 12px; border-radius: 8px; font-size: 0.93rem; resize: vertical;
    width: 100%; font-family: inherit; line-height: 1.6;
}
textarea:focus { outline: none; border-color: var(--accent); }
.answer-footer { display: flex; align-items: center; justify-content: space-between; }
.word-count { font-size: 0.78rem; color: var(--muted); }

.submit-row {
    display: flex; justify-content: flex-end;
    gap: 12px; margin-top: 8px; padding-bottom: 32px;
}

/* ── Result page ──────────────────────────────────────────────────────────── */
.result-header { text-align: center; margin-bottom: 24px; }
.result-header h2 { font-size: 1.5rem; }
.result-role { color: var(--accent); font-size: 1rem; margin-top: 4px; }
.result-date { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }

.score-banner {
    text-align: center; border-radius: var(--radius);
    padding: 32px; margin-bottom: 24px;
}
.score-great { background: linear-gradient(135deg,#052e16,#14532d); border: 1px solid var(--good); }
.score-ok    { background: linear-gradient(135deg,#1c1500,#422006); border: 1px solid var(--ok); }
.score-low   { background: linear-gradient(135deg,#2d0000,#450a0a); border: 1px solid var(--low); }
.score-big   { font-size: 3.5rem; font-weight: 800; line-height: 1; }
.score-banner .score-label { font-size: 0.9rem; color: var(--muted); margin-top: 4px; }
.score-badge {
    display: inline-block; margin-top: 10px; font-size: 0.8rem; font-weight: 600;
    padding: 4px 14px; border-radius: 20px; background: rgba(255,255,255,0.1);
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.score-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
}
.score-card .score-label {
    font-size: 0.72rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px;
}
.score-value { font-size: 1.8rem; font-weight: 700; margin-bottom: 10px; }
.score-value.good { color: var(--good); }
.score-value.ok   { color: var(--ok); }
.score-value.low  { color: var(--low); }
.score-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent2), #a78bfa);
    width: 0%; transition: width 0.7s ease;
}
.score-meta { font-size: 0.78rem; color: var(--muted); margin-top: 8px; }

.chart-card { text-align: center; }
.chart-card h3 { margin-bottom: 4px; font-size: 1rem; }
.chart-card canvas { max-width: 320px; margin: 16px auto 0; display: block; }

.q-result-card { margin: 12px 0; }
.q-result-header {
    display: flex; align-items: flex-start;
    gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.q-text { flex: 1; font-weight: 500; font-size: 0.95rem; }
.q-final-score { font-weight: 700; font-size: 1.1rem; }
.q-final-score.good { color: var(--good); }
.q-final-score.ok   { color: var(--ok); }
.q-final-score.low  { color: var(--low); }
.q-scores-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.q-badge {
    font-size: 0.75rem; padding: 3px 10px; border-radius: 20px;
    background: var(--surface2); color: var(--muted);
}
.q-badge.warn { background: #422006; color: var(--ok); }
.q-feedback { font-size: 0.87rem; color: var(--muted); margin-top: 5px; }

.feedback-card h3 { margin-bottom: 12px; font-size: 1rem; }
.feedback-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.feedback-list li {
    padding: 10px 14px; background: var(--surface2); border-radius: 8px;
    font-size: 0.88rem; color: var(--muted); border-left: 3px solid var(--accent);
}

.result-actions {
    display: flex; gap: 12px; justify-content: center;
    margin-top: 24px; padding-bottom: 32px;
}

/* ── History page ─────────────────────────────────────────────────────────── */
.page-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 24px;
}
.page-header h2 { font-size: 1.3rem; }

.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px 24px;
    display: flex; align-items: center; gap: 24px;
    transition: border-color 0.2s;
}
.history-card:hover { border-color: var(--border); }
.history-card-left { min-width: 160px; }
.history-role { font-weight: 600; font-size: 0.95rem; }
.history-date { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }
.history-scores { display: flex; gap: 24px; flex: 1; }
.h-score-item { display: flex; flex-direction: column; align-items: center; }
.h-score-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; }
.h-score-val { font-size: 1rem; font-weight: 600; margin-top: 2px; }
.h-score-val.good { color: var(--good); }
.h-score-val.ok   { color: var(--ok); }
.h-score-val.low  { color: var(--low); }
.history-card-right { display: flex; gap: 8px; align-items: center; }
.history-card-right form { margin: 0; }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.page-btn {
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    padding: 6px 14px; border-radius: 6px; font-size: 0.85rem; cursor: pointer;
    display: inline-block;
}
.page-btn:hover { border-color: var(--accent); text-decoration: none; }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #0f172a; font-weight: 700; }
.page-ellipsis { padding: 6px 4px; color: var(--muted); }

.empty-state { text-align: center; padding: 80px 24px; }
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin-bottom: 20px; }

/* ── Error pages ──────────────────────────────────────────────────────────── */
.error-page {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: 80vh;
    text-align: center; gap: 12px;
}
.error-code { font-size: 6rem; font-weight: 800; background: linear-gradient(135deg, var(--accent), #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1; }
.error-page h2 { font-size: 1.4rem; }
.error-page p { color: var(--muted); }

/* ── Light theme (site-wide) ──────────────────────────────────────────────── */
body.light {
    --bg:       #f4f6fb;
    --surface:  #ffffff;
    --surface2: #eef1f8;
    --border:   #dde3f0;
    --text:     #1e293b;
    --muted:    #64748b;
    --shadow:   0 8px 40px rgba(0,0,0,0.08);
    --glow:     0 0 32px rgba(99,102,241,0.08);
    background:
        radial-gradient(ellipse at 15% 40%, rgba(99,102,241,0.04) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 15%, rgba(139,92,246,0.03) 0%, transparent 50%),
        #f4f6fb;
    color: var(--text);
}

body.light .navbar {
    background: rgba(255,255,255,0.90);
    border-bottom: 1px solid rgba(99,102,241,0.12);
}
body.light .navbar-brand,
body.light .brand-name { color: #1e293b; }
body.light .navbar-links a { color: #64748b; }
body.light .navbar-links a:hover { color: #1e293b; }

body.light .card { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }

body.light textarea {
    background: #ffffff;
    border-color: var(--border);
    color: var(--text);
}

body.light .alert-warning {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}
body.light .paste-flag {
    background: #fff1f2;
    border-color: #f87171;
    color: #b91c1c;
}

/* Gaze monitoring status badge */
.gaze-status {
    display: inline-block;
    font-size: 0.80rem;
    padding: 3px 10px;
    border-radius: 20px;
    margin-top: 10px;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.gaze-ok   { background: rgba(34,197,94,0.15);  color: #4ade80; }
.gaze-bad  { background: rgba(239,68,68,0.15);  color: var(--low); }
.gaze-warn { background: rgba(251,191,36,0.15); color: var(--ok); }

body.light .gaze-ok   { background: #f0fdf4; color: #15803d; }
body.light .gaze-bad  { background: #fff1f2; color: #b91c1c; }
body.light .gaze-warn { background: #fffbeb; color: #92400e; }

body.light .flash-success { background: #f0fdf4; border-color: #4ade80; color: #14532d; }
body.light .flash-error   { background: #fef2f2; border-color: #f87171; color: #7f1d1d; }
body.light .flash-warning  { background: #fffbeb; border-color: #facc15; color: #78350f; }
body.light .flash-info     { background: #eff6ff; border-color: #818cf8; color: #1e3a8a; }
body.light .flash-close    { color: #94a3b8; }

body.light .score-great { background: linear-gradient(135deg,#f0fdf4,#dcfce7); border-color: #4ade80; color: #14532d; }
body.light .score-ok    { background: linear-gradient(135deg,#fffbeb,#fef9c3); border-color: #facc15; color: #78350f; }
body.light .score-low   { background: linear-gradient(135deg,#fef2f2,#fee2e2); border-color: #f87171; color: #7f1d1d; }
body.light .score-banner .score-label { color: #64748b; }
body.light .score-badge { background: rgba(0,0,0,0.06); color: inherit; }

body.light .q-badge      { background: #eef1f8; color: #64748b; }
body.light .q-badge.warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

body.light .feedback-list li { background: #eef1f8; border-left-color: var(--accent2); color: #475569; }

body.light .btn-mic { background: #eef1f8; border-color: var(--border); color: #475569; }
body.light .btn-mic.recording { background: #fef2f2; border-color: #f87171; color: #b91c1c; }

body.light .page-btn.active { color: #fff; }

body.light .level-fresher { background: rgba(74,222,128,0.10); color: #15803d; border-color: rgba(74,222,128,0.4); }
body.light .level-mid     { background: rgba(234,179,8,0.12);  color: #a16207; border-color: rgba(234,179,8,0.4); }
body.light .level-senior  { background: rgba(234,88,12,0.10);  color: #c2410c; border-color: rgba(234,88,12,0.35); }

body.light .level-option  { background: #f8f9ff; border-color: var(--border); color: var(--text); }
body.light .level-option:hover { background: #eef1f8; }

body.light .auth-card {
    background: #ffffff;
    border-color: rgba(99,102,241,0.15);
    box-shadow: 0 8px 40px rgba(0,0,0,0.08), 0 0 32px rgba(99,102,241,0.06);
}
body.light .tab-group { background: #eef1f8; }
body.light .tab-btn { color: #64748b; }
body.light .tab-btn.active { background: #ffffff; color: #1e293b; }
body.light .form-group input {
    background: #f8f9ff;
    border-color: #dde3f0;
    color: #1e293b;
}
body.light .form-group input:focus { border-color: var(--accent); background: #ffffff; }
body.light .hint { color: #94a3b8; }

/* ── Streak banner ────────────────────────────────────────────────────────── */
.streak-banner { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.streak-badge  { display:inline-flex; align-items:center; gap:6px; padding:6px 16px;
    background:rgba(251,191,36,0.15); border:1px solid rgba(251,191,36,0.4);
    border-radius:20px; font-weight:600; font-size:0.95rem; color:#fbbf24; }
.streak-badge.active { box-shadow:0 0 12px rgba(251,191,36,0.2); }
.streak-meta   { font-size:0.82rem; color:var(--muted); }
.streak-zero   { padding:6px 14px; background:var(--surface); border:1px solid var(--border);
    border-radius:20px; font-size:0.85rem; color:var(--muted); }

body.light .streak-badge  { background:#fffbeb; border-color:#fde68a; color:#92400e; }
body.light .streak-zero   { background:#f8f9ff; color:#94a3b8; }

/* ── Schedule / reminder cards ────────────────────────────────────────────── */
.reminder-card { display:flex; align-items:center; gap:12px; flex-wrap:wrap;
    background:rgba(251,191,36,0.08); border:1px solid rgba(251,191,36,0.3);
    border-radius:10px; padding:10px 16px; margin-bottom:10px; font-size:0.88rem; }
.reminder-card.soon { border-color:var(--low); background:rgba(239,68,68,0.07); }
.reminder-note { color:var(--muted); font-size:0.8rem; }
.dismiss-btn   { background:transparent; border:1px solid var(--border); color:var(--muted);
    border-radius:6px; padding:3px 10px; font-size:0.78rem; cursor:pointer; }
.dismiss-btn:hover { border-color:var(--low); color:var(--low); }

body.light .reminder-card      { background:#fffbeb; border-color:#fde68a; }
body.light .reminder-card.soon { background:#fff1f2; border-color:#f87171; }

/* ── Follow-up questions (result page) ─────────────────────────────────────── */
.followup-section  { margin-top:24px; }
.followup-intro    { font-size:0.88rem; color:var(--muted); margin-bottom:16px; }
.followup-card     { border-left:3px solid #fbbf24; background:rgba(251,191,36,0.06);
    border-radius:0 8px 8px 0; padding:14px 16px; margin-bottom:12px; }
.followup-label    { font-size:0.75rem; text-transform:uppercase; letter-spacing:0.06em;
    color:var(--muted); font-weight:600; }
.followup-question { font-size:0.95rem; color:var(--text); margin:6px 0 4px; font-weight:500; }
.followup-hint     { font-size:0.82rem; color:var(--muted); margin:0; }

body.light .followup-card { background:#fffbeb; border-color:#f59e0b; }

/* ── Code editor mode ─────────────────────────────────────────────────────── */
.editor-toggle-row { display:flex; align-items:center; gap:6px; margin-bottom:8px; }
.editor-mode-btn   { padding:4px 12px; border:1px solid var(--border); border-radius:6px;
    background:var(--surface); color:var(--muted); font-size:0.82rem; cursor:pointer; }
.editor-mode-btn.active { background:var(--accent); border-color:var(--accent);
    color:#fff; font-weight:600; }
.lang-select  { padding:4px 8px; border:1px solid var(--border); border-radius:6px;
    background:var(--surface); color:var(--text); font-size:0.82rem; cursor:pointer; }
.cm-wrapper   { border:1px solid var(--border); border-radius:8px; overflow:hidden; }
.cm-wrapper .CodeMirror { height:160px; font-size:0.88rem; font-family:'Fira Code',monospace; }

body.light .editor-mode-btn        { background:#f8f9ff; border-color:#dde3f0; color:#64748b; }
body.light .editor-mode-btn.active { background:var(--accent); color:#fff; }
body.light .lang-select            { background:#f8f9ff; border-color:#dde3f0; color:#1e293b; }
body.light .cm-wrapper             { border-color:#dde3f0; }

/* ── Progress page ────────────────────────────────────────────────────────── */
.progress-page-header { margin-bottom:16px; }
.back-link  { font-size:0.85rem; color:var(--accent); text-decoration:none; }
.back-link:hover { text-decoration:underline; }
.sub-text   { font-size:0.88rem; color:var(--muted); margin:4px 0 0; }
.role-switcher { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:20px; }
.role-chip  { padding:5px 14px; border:1px solid var(--border); border-radius:20px;
    font-size:0.82rem; color:var(--muted); text-decoration:none; }
.role-chip.active { background:var(--accent); border-color:var(--accent); color:#fff; }
.role-chip:hover:not(.active) { border-color:var(--accent); color:var(--accent); }
.chart-container { position:relative; height:300px; }
.score-legend { display:flex; gap:16px; flex-wrap:wrap; margin-top:12px; font-size:0.82rem; color:var(--muted); }
.legend-dot { display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:4px; }
.no-data-state { text-align:center; padding:48px 24px; color:var(--muted); }
.no-data-state p { margin-bottom:16px; }

body.light .role-chip  { background:#f8f9ff; border-color:#dde3f0; color:#64748b; }
body.light .role-chip.active { background:var(--accent); color:#fff; }

/* ── Weak areas page ──────────────────────────────────────────────────────── */
.role-perf-grid { display:flex; flex-direction:column; gap:10px; }
.role-perf-item { display:flex; align-items:center; gap:12px; }
.role-perf-name { width:180px; font-size:0.85rem; flex-shrink:0; }
.role-perf-score { font-size:0.82rem; font-weight:600; min-width:36px; text-align:right; }
.weak-area-section { background:var(--surface); border:1px solid var(--border);
    border-radius:10px; padding:16px; margin-bottom:16px; }
.weak-area-title { font-size:0.92rem; font-weight:600; color:var(--text); margin-bottom:12px; }
.weak-area-bar-row { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.weak-area-text { flex:1; font-size:0.82rem; color:var(--muted); }
.weak-area-bar-track { width:80px; height:6px; background:var(--border); border-radius:3px; flex-shrink:0; }
.weak-area-bar-fill { height:100%; background:var(--low); border-radius:3px; transition:width 0.5s; }
.weak-area-count { font-size:0.78rem; color:var(--muted); min-width:24px; text-align:right; }

body.light .weak-area-section { background:#f8f9ff; border-color:#dde3f0; }

/* ── Replay page ──────────────────────────────────────────────────────────── */
.replay-header { margin-bottom:20px; }
.replay-question-block { background:var(--surface); border:1px solid var(--border);
    border-radius:12px; padding:20px; margin-bottom:16px; }
.replay-scores-row  { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.replay-your-answer { background:rgba(129,140,248,0.07); border-radius:8px; padding:12px 16px; margin-bottom:10px; }
.replay-ideal-answer{ background:rgba(74,222,128,0.07); border-radius:8px; padding:12px 16px; margin-top:8px; }
.replay-answer-label{ font-size:0.72rem; text-transform:uppercase; letter-spacing:0.06em;
    color:var(--muted); font-weight:600; margin-bottom:6px; }
.collapsible-trigger{ font-size:0.85rem; color:var(--accent); cursor:pointer;
    padding:6px 0; user-select:none; }
.collapsible-trigger:hover { text-decoration:underline; }
.muted-text { color:var(--muted); font-size:0.85rem; }

body.light .replay-question-block { background:#f8f9ff; border-color:#dde3f0; }
body.light .replay-your-answer    { background:rgba(99,102,241,0.06); }
body.light .replay-ideal-answer   { background:rgba(34,197,94,0.06); }

/* ── Resume match page ────────────────────────────────────────────────────── */
.upload-card      { padding:24px; }
.upload-zone      { border:2px dashed var(--border); border-radius:10px;
    padding:20px; text-align:center; position:relative; cursor:pointer; }
.upload-zone:hover{ border-color:var(--accent); }
.upload-zone input[type=file] { position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; height:100%; }
.upload-zone-label{ font-size:0.9rem; color:var(--muted); pointer-events:none; }
.form-select      { width:100%; padding:10px 12px; border:1px solid var(--border);
    border-radius:8px; background:var(--surface); color:var(--text); font-size:0.9rem; }
.form-input       { width:100%; padding:10px 12px; border:1px solid var(--border);
    border-radius:8px; background:var(--surface); color:var(--text); font-size:0.9rem; }
.match-score-ring { width:70px; height:70px; border-radius:50%;
    border:4px solid var(--accent); display:flex; align-items:center; justify-content:center;
    font-size:1rem; font-weight:700; color:var(--accent); flex-shrink:0; }
.keyword-chips    { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.chip-label       { font-size:0.75rem; color:var(--muted); }
.keyword-chip     { padding:2px 10px; border-radius:12px; font-size:0.75rem; font-weight:500; }
.keyword-chip.matched { background:rgba(74,222,128,0.15); color:var(--good); }
.keyword-chip.missing { background:rgba(239,68,68,0.12); color:var(--low); }

body.light .upload-zone  { border-color:#dde3f0; background:#f8f9ff; }
body.light .form-select,
body.light .form-input   { background:#f8f9ff; border-color:#dde3f0; color:#1e293b; }

/* ── Study plan page ──────────────────────────────────────────────────────── */
.study-card        { background:var(--surface); border:1px solid var(--border);
    border-radius:12px; padding:20px; margin-bottom:16px; }
.study-card-header { display:flex; align-items:flex-start; gap:14px; margin-bottom:14px; }
.study-card-icon   { font-size:2rem; line-height:1; }
.study-card-title  { font-size:1rem; font-weight:600; color:var(--text); }
.study-priority    { display:inline-block; font-size:0.70rem; font-weight:700;
    text-transform:uppercase; letter-spacing:0.08em; padding:2px 8px;
    border-radius:4px; margin-top:4px; }
.priority-high   { background:rgba(239,68,68,0.15);  color:var(--low); }
.priority-medium { background:rgba(251,191,36,0.15); color:#fbbf24; }
.priority-low    { background:rgba(74,222,128,0.12); color:var(--good); }
.action-list     { margin:0; padding-left:20px; display:flex; flex-direction:column; gap:8px; }
.action-list li  { font-size:0.88rem; color:var(--muted); line-height:1.5; }

body.light .study-card  { background:#f8f9ff; border-color:#dde3f0; }
body.light .action-list li { color:#475569; }

/* ── Schedule page ────────────────────────────────────────────────────────── */
.schedule-form-card { padding:24px; margin-bottom:24px; }
.datetime-input     { width:100%; padding:10px 12px; border:1px solid var(--border);
    border-radius:8px; background:var(--surface); color:var(--text); font-size:0.9rem; }
.upcoming-list      { display:flex; flex-direction:column; gap:10px; margin-bottom:24px; }
.upcoming-item      { display:flex; align-items:center; gap:12px; flex-wrap:wrap;
    background:var(--surface); border:1px solid var(--border);
    border-radius:10px; padding:12px 16px; }
.upcoming-item.soon { border-color:rgba(251,191,36,0.5); background:rgba(251,191,36,0.06); }
.upcoming-item-info { flex:1; font-size:0.88rem; }
.soon-badge         { display:inline-block; background:rgba(251,191,36,0.2); color:#fbbf24;
    border-radius:10px; padding:1px 8px; font-size:0.75rem; font-weight:600; margin-left:8px; }

body.light .upcoming-item      { background:#f8f9ff; border-color:#dde3f0; }
body.light .upcoming-item.soon { background:#fffbeb; border-color:#fde68a; }
body.light .datetime-input     { background:#f8f9ff; border-color:#dde3f0; color:#1e293b; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .navbar { padding: 0 16px; }
    .navbar-links { gap: 12px; }
    .container { padding: 20px 16px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .history-card { flex-direction: column; align-items: flex-start; }
    .history-scores { gap: 16px; }
    .score-grid { grid-template-columns: repeat(2, 1fr); }
    .submit-row { flex-direction: column; }
    .result-actions { flex-direction: column; align-items: center; }
    .flash-container { right: 12px; left: 12px; }
    .flash { max-width: 100%; }
    .tailor-header { flex-direction: column; align-items: flex-start; }
}

/* ── Resume Tailoring Guide ──────────────────────────────────────────────── */
.tailor-result-card  { padding: 24px; }
.tailor-header       { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.tailor-header-text  { flex: 1; }
.tailor-header-text h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.tailor-assessment   { color: var(--muted); font-size: 0.9rem; margin-bottom: 6px; }

/* Larger ring for the instant result */
.large-ring          { width: 88px !important; height: 88px !important; flex-shrink: 0; }
.large-ring span     { font-size: 1rem !important; font-weight: 700; }

.tailor-tip-card     { padding: 20px 22px; margin-bottom: 14px;
                       border-left: 3px solid var(--border); }
.tailor-tip-card.priority-high   { border-left-color: var(--low); }
.tailor-tip-card.priority-medium { border-left-color: var(--ok); }
.tailor-tip-card.priority-low    { border-left-color: var(--good); }

.tailor-tip-header   { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tailor-tip-icon     { font-size: 1.15rem; }
.tailor-tip-section  { font-weight: 600; font-size: 0.95rem; flex: 1; }

.tailor-priority-badge          { padding: 2px 9px; border-radius: 10px;
                                  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; }
.tailor-priority-badge.priority-high   { background: rgba(248,113,113,0.15); color: var(--low); }
.tailor-priority-badge.priority-medium { background: rgba(250,204,21,0.12); color: var(--ok); }
.tailor-priority-badge.priority-low    { background: rgba(74,222,128,0.12); color: var(--good); }

.tailor-tip-advice   { font-size: 0.88rem; color: var(--text); line-height: 1.55; }

.tailor-example      { margin-top: 12px; background: var(--surface2);
                       border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.tailor-example-label{ font-size: 0.7rem; font-weight: 700; color: var(--accent);
                       text-transform: uppercase; letter-spacing: 0.06em; display: block;
                       margin-bottom: 4px; }
.tailor-example-text { font-size: 0.84rem; color: var(--text); font-style: italic;
                       line-height: 1.5; }
.copy-btn            { margin-top: 8px; padding: 4px 14px; border-radius: 6px;
                       background: transparent; border: 1px solid var(--border);
                       color: var(--muted); font-size: 0.78rem; cursor: pointer;
                       transition: all 0.15s; }
.copy-btn:hover      { border-color: var(--accent); color: var(--accent); }

body.light .tailor-result-card  { background: #fff; }
body.light .tailor-tip-card     { background: #fff; }
body.light .tailor-example      { background: #f1f4fb; border-color: #dde3f0; }
body.light .copy-btn            { border-color: #c9d3e8; color: #64748b; }
