/* Visual-only re-theme for the 13 quiz subject pages, to match the new
   index.html / content-page palette. Loaded AFTER quiz.css - overrides only
   its :root custom properties (colors, radius, shadow). No selectors, no
   layout rules, no id/class targeting - the quiz app's structure, state
   machine and mobile-nav mechanics are completely untouched.

   --radius-sm intentionally stays more conservative here (8px, not the 10px
   used on the content pages) - quiz.css uses it on small fixed-size widgets
   (30px tracker boxes, 22px option letters, 9px legend dots) where the
   content-page value reads as a blob rather than a soft corner.

   Dark mode ([data-theme="dark"]) is left alone: quiz.css redefines accent/
   correct/wrong/flag/shadow-card at higher specificity for that selector, so
   this file's plain :root override only ever reaches light mode for those -
   radius has no dark-mode override in quiz.css, so it applies in both,
   which is what we want (shape is theme-independent). */

:root {
    --surface-1:    #f6f8fb;
    --surface-2:    #eef2f9;
    --line:         #e3e8f0;
    --line-subtle:  #ecf0f6;
    --line-strong:  #94a3b8;
    --ink-900:      #0d1b2a;
    --ink-700:      #334155;
    --ink-500:      #64748b;
    --accent:       #2563eb;
    --accent-tint:  #eef4ff;
    --accent-100:   #dbe7fd;
    --accent-600:   #1d4ed8;
    --accent-700:   #1d4ed8;
    --chrome-900:   #0d1b2a;
    --chrome-900-hover: #1d2f45;
    --shadow-card:  0 1px 2px rgba(13,27,42,.04), 0 12px 32px -16px rgba(13,27,42,.12);
    --correct:      #0f9d6e;
    --correct-tint: #e6f7f0;
    --wrong:        #dc2626;
    --wrong-tint:   #fef2f2;
    --flag:         #b45309;
    --flag-tint:    #fef3e0;
    --radius-sm:    8px;
    --radius:       16px;
}

/* ── New top nav, replacing the old #sidebar + #topbar shell ─────────────
   body stays display:flex (quiz.css) but switches from its old implicit
   row (sidebar | main) to column (header above, #main filling the rest of
   the 100vh viewport) - #main's own flex:1 and #content/#mainArea/
   #trackerArea's internal scroll model are completely untouched, so the
   exam screen's single-viewport/internal-scroll behavior is unaffected. */
body { flex-direction: column; }

header.site { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); flex-shrink: 0; }
:root[data-theme="dark"] header.site { background: rgba(38,43,51,.85); }
header.site .nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; max-width: 1400px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 17px; color: var(--ink-900); font-family: var(--font-ui); }
.brand-tld { color: var(--accent); font-weight: 600; }
header.site nav.links { display: flex; align-items: center; gap: 22px; }
header.site nav.links a { font-size: 14px; font-weight: 500; color: var(--ink-700); text-decoration: none; }
header.site nav.links a:hover { color: var(--accent); }
@media (max-width: 860px) { header.site nav.links { display: none; } }

/* Sidebar brand mark is gone along with the sidebar itself, but keep this
   rule in case any cached/old markup still references .brand-icon. */
.brand-icon { background: linear-gradient(145deg, var(--accent), #60a5fa); border-radius: 9px; }

/* ── Subject-switcher (replaces the always-visible sidebar subject list) ── */
.subject-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.subject-switch { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.subject-switch-label { font-size: var(--fs-100); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-500); }
.subject-switch select { font-family: var(--font-ui); font-size: var(--fs-300); font-weight: 600; color: var(--ink-900); background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 32px 8px 12px; cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; transition: var(--transition); min-width: 220px; }
.subject-switch select:hover { border-color: var(--accent); }
.subject-switch select:focus { outline: none; border-color: var(--accent); }
@media (max-width: 560px) { .subject-switch select { min-width: 0; width: 100%; } }

/* Exam-start panel (.hero-start-strip and its children) is a flat dark band,
   fully defined in quiz.css - deliberately no extra gradient/shadow/sizing
   override here this time, after two passes that read as an oversized, overly
   glossy "fake download ad" button. Markup/ids untouched - quiz-engine.js
   reads the same #numQuestions/#unseenOnly/etc elements exactly as before. */

.reset-seen-btn { border-radius: 999px; }

/* ── Sign-in / account menu in the header - same markup/behaviour as
   index.html/account.html/admin.html/stats.html's dropdown (js/auth.js's
   toggleAccountMenu() etc. already handle all of it); this is purely the
   missing CSS, since quiz.css/quiz-revamp.css never had a reason to define
   a generic .btn or the account-menu-* classes before. */
.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; font-family: var(--font-ui); text-decoration: none; border-radius: 999px; padding: 8px 16px; white-space: nowrap; cursor: pointer; transition: var(--transition); border: none; }
.btn-ghost { color: var(--ink-900); border: 1px solid var(--line); background: var(--surface-0); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.nav-auth-user:not([hidden]) { display: flex; align-items: center; position: relative; }
.nav-auth-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.nav-auth-name { font-size: 14px; font-weight: 600; color: var(--ink-900); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 960px) { .nav-auth-name { display: none; } }
.account-menu-btn { display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; padding: 6px 10px; border-radius: 999px; font: inherit; }
.account-menu-btn:hover { background: var(--surface-1); }
.account-menu-caret { color: var(--ink-500); font-size: 11px; margin-left: -2px; }
.account-menu-dropdown:not([hidden]) { display: block; }
.account-menu-dropdown { position: absolute; top: calc(100% + 8px); right: 0; min-width: 200px; background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-card); padding: 6px; z-index: 50; }
.account-menu-item:not([hidden]) { display: flex; }
.account-menu-item { align-items: center; justify-content: space-between; width: 100%; box-sizing: border-box; padding: 9px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--ink-700); text-decoration: none; border: none; background: none; cursor: pointer; text-align: left; font-family: inherit; }
.account-menu-item:hover { background: var(--surface-1); color: var(--ink-900); }
.account-menu-sep { height: 1px; background: var(--line); margin: 6px 2px; }
.account-menu-signout { color: #b42318; }
.account-menu-signout:hover { background: #fef2f2; color: #b42318; }

/* ── Centred setup screen: title, meta, subject switcher, test box and
   question search share one centre line. ─────────────────────────────── */
.subject-header { flex-direction: column; align-items: center; justify-content: flex-start; text-align: center; gap: var(--sp-3); }
.subject-switch { flex-direction: row; align-items: center; gap: var(--sp-2); }
.subject-switch-label { text-transform: none; letter-spacing: 0; font-size: var(--fs-200); font-weight: 500; }
.subject-switch select { min-width: 0; font-size: var(--fs-200); padding: 6px 30px 6px 10px; }
.test-setup { margin-left: auto; margin-right: auto; }
.intro-ref-search { justify-content: center; text-align: center; }
@media (max-width: 560px) { .subject-switch select { width: auto; } }
