/* =========================================================
   QUIZZER — Professional theme
   Palette: deep navy / slate greys / teal accent
   ========================================================= */

:root {
    --navy-900: #0f172a;
    --navy-800: #1e293b;
    --navy-700: #334155;
    --slate-500: #64748b;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50:  #f8fafc;
    --teal-600: #0d9488;
    --teal-500: #14b8a6;
    --teal-100: #ccfbf1;
    --amber-500: #f59e0b;
    --red-500: #ef4444;
    --red-100: #fee2e2;
    --green-600: #16a34a;
    --green-100: #dcfce7;
    --white: #ffffff;
    --radius: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15,23,42,0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--slate-50);
    color: var(--navy-900);
    line-height: 1.55;
}

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

/* ---------- Topbar ---------- */
.topbar {
    background: var(--navy-900);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    color: var(--white);
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    background: var(--teal-500);
    color: var(--navy-900);
    width: 30px; height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}
.main-nav { display: flex; align-items: center; gap: 20px; }
.main-nav a { color: var(--slate-200); font-weight: 500; }
.main-nav a:hover { color: var(--white); text-decoration: none; }
.nav-user { color: var(--slate-300); font-size: 0.9rem; }
.btn-primary-sm, .btn-ghost {
    padding: 7px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}
.btn-primary-sm { background: var(--teal-500); color: var(--navy-900); }
.btn-primary-sm:hover { background: var(--teal-600); color: var(--white); text-decoration: none; }
.btn-ghost { border: 1px solid var(--slate-500); color: var(--slate-200); }
.btn-ghost:hover { background: var(--navy-800); text-decoration: none; }

/* ---------- Layout ---------- */
.page-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 64px;
    min-height: 70vh;
}
.footer {
    text-align: center;
    color: var(--slate-500);
    font-size: 0.85rem;
    padding: 24px;
}

h1, h2, h3 { color: var(--navy-900); }
h1 { font-size: 1.75rem; margin-bottom: 6px; }
.subtitle { color: var(--slate-500); margin-top: 0; margin-bottom: 28px; }

/* ---------- Cards ---------- */
.card {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}
.stat-card {
    background: var(--navy-900);
    color: var(--white);
    border-radius: var(--radius);
    padding: 20px;
}
.stat-card .stat-value { font-size: 2rem; font-weight: 800; color: var(--teal-500); }
.stat-card .stat-label { color: var(--slate-300); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; color: var(--navy-800); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number],
textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--slate-300);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: var(--font);
    background: var(--white);
    color: var(--navy-900);
    margin-bottom: 16px;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px var(--teal-100);
}
textarea { resize: vertical; min-height: 140px; }
fieldset { border: 1px solid var(--slate-200); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
legend { font-weight: 700; padding: 0 6px; color: var(--navy-800); }
.radio-row, .checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 400; }
.radio-row input, .checkbox-row input { width: auto; margin: 0; }
.form-hint { color: var(--slate-500); font-size: 0.82rem; margin-top: -10px; margin-bottom: 16px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 11px 22px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    font-family: var(--font);
}
.btn-primary { background: var(--teal-600); color: var(--white); }
.btn-primary:hover { background: var(--teal-500); text-decoration: none; }
.btn-secondary { background: var(--slate-100); color: var(--navy-800); border: 1px solid var(--slate-300); }
.btn-secondary:hover { background: var(--slate-200); text-decoration: none; }
.btn-danger { background: var(--red-500); color: var(--white); }
.btn-block { width: 100%; text-align: center; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 0.9rem; }
.alert-error { background: var(--red-100); color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: var(--green-100); color: #166534; border: 1px solid #86efac; }
.alert-info { background: var(--teal-100); color: #115e59; border: 1px solid #5eead4; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--slate-200); font-size: 0.9rem; }
th { color: var(--slate-500); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.04em; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.badge-easy { background: var(--green-100); color: #166534; }
.badge-medium { background: #fef3c7; color: #92400e; }
.badge-hard { background: var(--red-100); color: #991b1b; }
.badge-teal { background: var(--teal-100); color: #115e59; }

/* ---------- Quiz screen ---------- */
.quiz-progress-bar {
    height: 8px;
    background: var(--slate-200);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 24px;
}
.quiz-progress-fill {
    height: 100%;
    background: var(--teal-500);
    transition: width 0.3s ease;
}
.question-box { background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-md); }
.question-text { font-size: 1.15rem; font-weight: 600; margin-bottom: 20px; color: var(--navy-900); }
.option-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1.5px solid var(--slate-300);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    font-size: 0.98rem;
    font-family: var(--font);
    color: var(--navy-900);
    transition: all 0.15s ease;
}
.option-btn:hover { border-color: var(--teal-500); background: var(--slate-50); }
.option-btn.selected { border-color: var(--teal-500); background: var(--teal-100); }
.option-btn.correct { border-color: var(--green-600); background: var(--green-100); }
.option-btn.incorrect { border-color: var(--red-500); background: var(--red-100); }
.option-btn:disabled { cursor: default; }

.timer-pill {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--navy-900); color: var(--white);
    padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 0.85rem;
}
.timer-pill.low { background: var(--red-500); }

.explanation-box {
    margin-top: 18px;
    padding: 14px 16px;
    background: var(--slate-100);
    border-left: 4px solid var(--teal-500);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--navy-800);
}

/* ---------- Results ---------- */
.score-circle {
    width: 140px; height: 140px;
    border-radius: 50%;
    background: var(--navy-900);
    color: var(--white);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    margin: 0 auto 24px;
}
.score-circle .score-num { font-size: 2.2rem; font-weight: 800; color: var(--teal-500); }
.score-circle .score-den { font-size: 0.85rem; color: var(--slate-300); }

.review-item { border-bottom: 1px solid var(--slate-200); padding: 16px 0; }
.review-item:last-child { border-bottom: none; }
.review-item.wrong .question-text { color: #991b1b; }
.review-item.right .question-text { color: #166534; }

/* ---------- Landing ---------- */
.hero { text-align: center; padding: 60px 20px; }
.hero h1 { font-size: 2.4rem; }
.hero p { color: var(--slate-500); font-size: 1.1rem; max-width: 560px; margin: 12px auto 28px; }

/* ---------- Utility ---------- */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-20 { gap: 20px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }
.text-muted { color: var(--slate-500); }
.small { font-size: 0.85rem; }

@media (max-width: 640px) {
    .main-nav { gap: 12px; font-size: 0.85rem; }
    .nav-user { display: none; }
    .hero h1 { font-size: 1.8rem; }
}
