/* =====================================================================
   MedAce design system — green & white
   ===================================================================== */

:root {
    --green-50: #eefaf3;
    --green-100: #d6f3e3;
    --green-200: #aee7c8;
    --green-300: #79d4a6;
    --green-400: #45bd83;
    --green-500: #17a468;
    --green-600: #0f7a4d;
    --green-700: #0b5c3a;
    --green-800: #094a2f;
    --green-900: #073a25;

    --ink: #0b1f17;
    --ink-2: #274238;
    --muted: #5f7a70;
    --line: #e2ece7;
    --line-strong: #cfe0d8;
    --bg: #ffffff;
    --bg-soft: #f5faf7;
    --bg-tint: #edf7f1;
    --surface: #ffffff;
    --danger: #dc2626;
    --danger-soft: #fdecec;
    --amber: #d97706;
    --amber-soft: #fef3e2;
    --blue: #2563eb;
    --blue-soft: #e8efff;
    --radius: 14px;
    --radius-sm: 9px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(11, 31, 23, .05), 0 1px 3px rgba(11, 31, 23, .04);
    --shadow: 0 6px 24px -12px rgba(11, 31, 23, .18), 0 2px 8px -4px rgba(11, 31, 23, .08);
    --shadow-lg: 0 24px 60px -24px rgba(11, 31, 23, .28);
    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
    --nav-h: 68px;
}

[data-theme="dark"] {
    --ink: #eaf5ef;
    --ink-2: #c3d8cd;
    --muted: #8fae9f;
    --line: #1e3329;
    --line-strong: #2a4638;
    --bg: #0a1512;
    --bg-soft: #0e1d18;
    --bg-tint: #10241c;
    --surface: #0f1f19;
    --green-50: #0d2119;
    --green-100: #123527;
    --shadow: 0 8px 30px -16px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    font-size: 15.5px;
}

img { max-width: 100%; height: auto; }
a { color: var(--green-600); text-decoration: none; }
a:hover { color: var(--green-700); }
h1, h2, h3, h4 { line-height: 1.2; color: var(--ink); margin: 0 0 .4em; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(1.9rem, 3.2vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.4vw, 2.15rem); }
h3 { font-size: 1.22rem; }
p { margin: 0 0 1rem; color: var(--ink-2); }
hr { border: none; border-top: 1px solid var(--line); margin: 1.5rem 0; }
small { color: var(--muted); }

:focus-visible {
    outline: 3px solid var(--green-400);
    outline-offset: 2px;
    border-radius: 4px;
}

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.container-wide { max-width: 1400px; }
.section { padding: 76px 0; }
.section-sm { padding: 48px 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.hide-mobile { display: initial; }
.show-mobile { display: none; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.75rem; }
.mt-4 { margin-top: 2.5rem; }
.text-sm { font-size: .86rem; }
.text-lg { font-size: 1.1rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* -------- Buttons -------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .68rem 1.15rem; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-weight: 600; font-size: .94rem; cursor: pointer; transition: all .16s ease;
    background: var(--bg-tint); color: var(--green-700); text-align: center; line-height: 1.1;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--green-600); color: #fff; box-shadow: 0 6px 18px -8px rgba(15, 122, 77, .7); }
.btn-primary:hover { background: var(--green-700); color: #fff; }
.btn-accent { background: var(--green-500); color: #fff; }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--green-400); color: var(--green-700); background: var(--green-50); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-tint); color: var(--green-700); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-sm { padding: .42rem .8rem; font-size: .82rem; border-radius: 7px; }
.btn-lg { padding: .9rem 1.6rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-icon { padding: .5rem; border-radius: 8px; background: transparent; border: 1px solid var(--line); color: var(--ink-2); }
.btn-icon:hover { background: var(--bg-tint); color: var(--green-700); }

/* -------- Cards -------- */
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.35rem; box-shadow: var(--shadow-sm);
}
.card-pad-lg { padding: 2rem; }
.card-hover { transition: all .18s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--green-200); }
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .35rem; }
.card-flat { box-shadow: none; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* -------- Badges & pills -------- */
.badge {
    display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem;
    border-radius: 999px; font-size: .74rem; font-weight: 600; letter-spacing: .01em;
    background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-100);
}
.badge-neutral { background: var(--bg-soft); color: var(--muted); border-color: var(--line); }
.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: #f6ddb9; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: #f7c9c9; }
.badge-blue { background: var(--blue-soft); color: var(--blue); border-color: #cfe0ff; }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill { padding: .3rem .75rem; border-radius: 999px; border: 1px solid var(--line); font-size: .8rem; background: var(--bg-soft); color: var(--ink-2); cursor: pointer; }
.pill:hover { border-color: var(--green-300); color: var(--green-700); }
.pill.active { background: var(--green-600); color: #fff; border-color: var(--green-600); }

/* -------- Forms -------- */
label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .35rem; color: var(--ink-2); }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], input[type="tel"], select, textarea {
    width: 100%; padding: .66rem .8rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    font: inherit; color: var(--ink); background: var(--surface); transition: border .15s, box-shadow .15s;
}
.input:focus, input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--green-400); box-shadow: 0 0 0 3px var(--green-50);
}
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 1rem; }
.field-help { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.input-group { display: flex; gap: 8px; }
.check { display: flex; align-items: flex-start; gap: .55rem; font-weight: 500; font-size: .9rem; }
.check input { width: auto; margin-top: .2rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; }
legend { font-weight: 700; padding: 0 .4rem; color: var(--green-700); }

/* -------- Alerts -------- */
.alert { padding: .85rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-soft); margin-bottom: 1rem; font-size: .92rem; }
.alert-success { background: var(--green-50); border-color: var(--green-100); color: var(--green-800); }
.alert-error { background: var(--danger-soft); border-color: #f7c9c9; color: #991b1b; }
.alert-info { background: var(--blue-soft); border-color: #cfe0ff; color: #1e40af; }
.alert-warning { background: var(--amber-soft); border-color: #f6ddb9; color: #92400e; }

/* -------- Top navigation -------- */
.site-header {
    position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 26px; height: var(--nav-h); }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.24rem; color: var(--ink); letter-spacing: -.02em; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--green-500), var(--green-700)); color: #fff; font-weight: 800;
    box-shadow: 0 6px 16px -6px rgba(15, 122, 77, .7);
}
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a { padding: .5rem .7rem; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: .93rem; }
.nav-links a:hover { background: var(--bg-tint); color: var(--green-700); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; }

/* -------- App shell (learner) -------- */
.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
    border-right: 1px solid var(--line); background: var(--bg-soft); padding: 1.25rem 1rem;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { margin: .3rem .4rem 1.4rem; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
    display: flex; align-items: center; gap: .7rem; padding: .62rem .75rem; border-radius: 10px;
    color: var(--ink-2); font-weight: 500; font-size: .92rem;
}
.side-nav a:hover { background: var(--bg-tint); color: var(--green-700); }
.side-nav a.active { background: var(--green-600); color: #fff; box-shadow: 0 8px 20px -12px rgba(15, 122, 77, .8); }
.side-nav .nav-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 1.1rem .75rem .3rem; font-weight: 700; }
.side-nav svg { width: 18px; height: 18px; }
.main-area { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: var(--nav-h); border-bottom: 1px solid var(--line); display: flex; align-items: center;
    gap: 16px; padding: 0 24px; background: var(--surface); position: sticky; top: 0; z-index: 40;
}
.topbar .search { max-width: 380px; flex: 1; }
.page { padding: 30px 30px 60px; max-width: 1240px; width: 100%; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 1.75rem; margin-bottom: .2rem; }
.breadcrumb { display: flex; gap: .4rem; align-items: center; font-size: .82rem; color: var(--muted); margin-bottom: .5rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--green-600); }

/* -------- Stat cards -------- */
.stat { display: flex; flex-direction: column; gap: .3rem; }
.stat-label { font-size: .82rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.stat-sub { font-size: .8rem; color: var(--muted); }
.stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--green-50); color: var(--green-600); }

/* -------- Progress -------- */
.progress { height: 9px; border-radius: 999px; background: var(--bg-tint); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green-500), var(--green-700)); transition: width .5s ease; }
.progress.amber > span { background: linear-gradient(90deg, #f59e0b, #d97706); }
.progress.red > span { background: linear-gradient(90deg, #ef4444, #dc2626); }
.ring { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; stroke-linecap: round; }

/* -------- Tables -------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: var(--bg-soft); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); position: sticky; top: 0; }
.table tbody tr:hover { background: var(--bg-soft); }
.table td .row { gap: 8px; }

/* -------- Question UI -------- */
.question-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 2rem; box-shadow: var(--shadow-sm); }
.question-stem { font-size: 1.12rem; line-height: 1.65; color: var(--ink); }
.vignette { background: var(--bg-soft); border-left: 4px solid var(--green-400); padding: 1rem 1.2rem; border-radius: 0 12px 12px 0; margin-bottom: 1.2rem; }
.option {
    display: flex; gap: .85rem; align-items: flex-start; padding: .95rem 1.1rem; border: 1.5px solid var(--line);
    border-radius: 12px; margin-bottom: .65rem; cursor: pointer; transition: all .14s ease; background: var(--surface);
}
.option:hover { border-color: var(--green-300); background: var(--green-50); }
.option input { margin-top: .28rem; }
.option .opt-label { font-weight: 800; color: var(--green-700); min-width: 18px; }
.option.selected { border-color: var(--green-500); background: var(--green-50); }
.option.correct { border-color: var(--green-500); background: var(--green-50); }
.option.incorrect { border-color: var(--danger); background: var(--danger-soft); }
.option .opt-explain { display: block; font-size: .84rem; color: var(--muted); margin-top: .35rem; }
.stem-flags { display: flex; gap: 8px; }

/* -------- Chart primitives -------- */
.chart { width: 100%; height: 240px; }
.bar-row { display: grid; grid-template-columns: 160px 1fr 54px; gap: 12px; align-items: center; margin-bottom: .6rem; font-size: .85rem; }
.bar-track { height: 10px; background: var(--bg-tint); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--green-500); border-radius: 999px; }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.heatmap i { width: 12px; height: 12px; border-radius: 3px; background: var(--bg-tint); display: block; }
.heatmap i[data-l1] { background: var(--green-100); }
.heatmap i[data-l2] { background: var(--green-300); }
.heatmap i[data-l3] { background: var(--green-500); }
.heatmap i[data-l4] { background: var(--green-700); }

/* -------- Flashcard -------- */
.flashcard { perspective: 1400px; height: 320px; }
.flashcard-inner { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face {
    position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius-lg);
    padding: 2rem; display: grid; place-items: center; text-align: center; font-size: 1.2rem;
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.flashcard-back { transform: rotateY(180deg); background: var(--green-50); border-color: var(--green-200); }
.rating-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

/* -------- Exam navigator -------- */
.exam-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-soft); }
.exam-topbar { height: 62px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 22px; position: sticky; top: 0; z-index: 40; }
.exam-timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.15rem; padding: .35rem .8rem; border-radius: 10px; background: var(--green-50); color: var(--green-700); }
.exam-timer.warning { background: var(--amber-soft); color: var(--amber); }
.exam-timer.danger { background: var(--danger-soft); color: var(--danger); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .65; } }
.exam-body { display: grid; grid-template-columns: 1fr 300px; gap: 24px; padding: 24px; max-width: 1280px; margin: 0 auto; width: 100%; }
.navigator { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; position: sticky; top: 86px; height: fit-content; }
.nav-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin-top: .6rem; }
.nav-grid button { aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; font-size: .8rem; }
.nav-grid button.answered { background: var(--green-500); color: #fff; border-color: var(--green-500); }
.nav-grid button.flagged { border-color: var(--amber); box-shadow: inset 0 0 0 2px var(--amber-soft); }
.nav-grid button.current { outline: 3px solid var(--green-400); outline-offset: 1px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-top: .6rem; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* -------- Auth -------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-aside { background: linear-gradient(160deg, var(--green-700), var(--green-900)); color: #eaf5ef; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-aside h2 { color: #fff; }
.auth-aside .brand { color: #fff; }
.auth-form { display: grid; place-items: center; padding: 2.5rem; }
.auth-card { width: 100%; max-width: 420px; }

/* -------- Hero -------- */
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 500px at 80% -10%, var(--green-50), transparent 60%), var(--bg); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding: 72px 0 64px; }
.hero h1 { font-size: clamp(2.2rem, 4.4vw, 3.5rem); }
.hero .lead { font-size: 1.16rem; color: var(--ink-2); max-width: 540px; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .8rem; border-radius: 999px; background: var(--green-50); color: var(--green-700); font-weight: 600; font-size: .82rem; border: 1px solid var(--green-100); margin-bottom: 1.1rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 1.6rem; }
.hero-metrics { display: flex; gap: 30px; margin-top: 2.2rem; flex-wrap: wrap; }
.hero-metrics .stat-value { font-size: 1.6rem; }

/* -------- Marketing blocks -------- */
.feature-icon { width: 46px; height: 46px; border-radius: 13px; background: var(--green-50); color: var(--green-600); display: grid; place-items: center; margin-bottom: .9rem; }
.price-card { display: flex; flex-direction: column; height: 100%; }
.price-card.featured { border-color: var(--green-400); box-shadow: 0 20px 50px -30px rgba(15, 122, 77, .55); position: relative; }
.price-card.featured::after { content: "Most popular"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--green-600); color: #fff; padding: .2rem .8rem; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.price { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; }
.price small { font-size: .95rem; font-weight: 500; color: var(--muted); }
.feature-list { list-style: none; padding: 0; margin: 1rem 0; }
.feature-list li { display: flex; gap: .55rem; align-items: flex-start; padding: .34rem 0; color: var(--ink-2); font-size: .92rem; }
.feature-list svg { flex-shrink: 0; color: var(--green-500); margin-top: .2rem; }

.faq-item { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .65rem; overflow: hidden; }
.faq-item summary { padding: 1rem 1.2rem; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item[open] summary { background: var(--bg-soft); }
.faq-item .faq-body { padding: 0 1.2rem 1.1rem; color: var(--ink-2); }

/* -------- Footer -------- */
.site-footer { background: var(--green-900); color: #cfe3d7; padding: 60px 0 28px; margin-top: 40px; }
.site-footer a { color: #cfe3d7; }
.site-footer a:hover { color: #fff; }
.site-footer .brand { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 34px; }
.footer-grid h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .5rem; font-size: .9rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); margin-top: 40px; padding-top: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .84rem; }

/* -------- Empty states -------- */
.empty { text-align: center; padding: 3rem 1.5rem; }
.empty svg { color: var(--green-300); margin-bottom: .8rem; }
.empty h3 { margin-bottom: .3rem; }

/* -------- Toasts -------- */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--green-700); color: #fff; padding: .8rem 1.1rem; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: .9rem; animation: slideIn .25s ease; }
.toast.error { background: var(--danger); }
@keyframes slideIn { from { transform: translateY(12px); opacity: 0; } }

/* -------- Skeletons -------- */
.skeleton { background: linear-gradient(90deg, var(--bg-tint) 25%, var(--bg-soft) 37%, var(--bg-tint) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; min-height: 14px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* -------- Modal -------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(11,31,23,.5); display: none; place-items: center; z-index: 90; padding: 20px; }
.modal-backdrop.open { display: grid; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 1.6rem; max-width: 480px; width: 100%; box-shadow: var(--shadow-lg); }

/* -------- Tabs -------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; overflow-x: auto; }
.tabs button { background: none; border: none; padding: .7rem 1rem; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--green-700); border-bottom-color: var(--green-600); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* -------- Admin shell -------- */
.admin-badge { background: var(--green-900); color: #fff; }

/* -------- Responsive -------- */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .hero-grid { grid-template-columns: 1fr; gap: 32px; }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .exam-body { grid-template-columns: 1fr; }
    .navigator { position: static; }
}
@media (max-width: 860px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 60; transform: translateX(-105%);
        transition: transform .25s ease; box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }
    .nav-toggle { display: inline-flex; }
    .nav-links { display: none; }
    .page { padding: 22px 16px 60px; }
    .topbar { padding: 0 16px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .section { padding: 52px 0; }
    .question-card { padding: 1.2rem; }
    .hero-metrics { gap: 18px; }
    .footer-grid { grid-template-columns: 1fr; }
    .hide-mobile { display: none; }
    .show-mobile { display: initial; }
    .row-between { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
    .site-header, .sidebar, .topbar, .no-print { display: none !important; }
}

/* =====================================================================
   OSCE / OSPE attempt runner
   ===================================================================== */
.osce-runner { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-soft); }

.osce-runner-top {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 16px;
    padding: 12px 22px; background: var(--surface);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.osce-runner-brand { display: flex; align-items: center; gap: .7rem; min-width: 0; flex: 1; }
.osce-runner-brand .brand-mark { flex-shrink: 0; }
.osce-runner-title { font-weight: 700; font-size: 1rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.osce-runner-sub { font-size: .8rem; color: var(--muted); }
.osce-runner-timers { display: flex; gap: 10px; }
.osce-timer {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    min-width: 86px; padding: .35rem .7rem; border-radius: 10px;
    background: var(--bg-soft); border: 1px solid var(--line);
}
.osce-timer-label { font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.osce-timer-value { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.08rem; color: var(--green-700); }
.osce-timer-value.warning { color: var(--amber); }
.osce-timer-value.danger { color: var(--danger); animation: pulse 1.6s infinite; }

.osce-nav {
    position: sticky; top: 63px; z-index: 45;
    display: flex; gap: 8px; flex-wrap: wrap;
    padding: 12px 22px; background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.osce-nav-btn {
    width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--line-strong); background: var(--surface);
    font-weight: 700; font-size: .85rem; color: var(--ink-2); transition: all .14s ease;
}
.osce-nav-btn:hover { border-color: var(--green-300); color: var(--green-700); }
.osce-nav-btn.answered { background: var(--green-500); border-color: var(--green-500); color: #fff; }
.osce-nav-btn.current { outline: 3px solid var(--green-400); outline-offset: 1px; }

.osce-station-list { flex: 1; width: 100%; max-width: 920px; margin: 0 auto; padding: 26px 22px 90px; }
.osce-station { display: none; }
.osce-station.current { display: block; }
.osce-station-inside { animation: osceFade .2s ease; }
@keyframes osceFade { from { opacity: 0; transform: translateY(4px); } }

.osce-prompt { font-size: 1.04rem; font-weight: 600; color: var(--ink); line-height: 1.5; }
.osce-option {
    display: flex; gap: .7rem; align-items: flex-start;
    padding: .8rem 1rem; border: 1.5px solid var(--line); border-radius: 12px;
    cursor: pointer; background: var(--surface); transition: all .14s ease;
}
.osce-option:hover { border-color: var(--green-300); background: var(--green-50); }
.osce-option input { margin-top: .22rem; flex-shrink: 0; }
.osce-option-body { color: var(--ink-2); font-size: .95rem; }
.osce-option-body strong { color: var(--green-700); }

.osce-station-controls {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); flex-wrap: wrap;
}

@media (max-width: 720px) {
    .osce-runner-top { flex-wrap: wrap; }
    .osce-runner-brand { flex-basis: 100%; }
    .osce-runner-title { white-space: normal; }
    .osce-runner-timers { margin-right: auto; }
    .osce-nav { position: static; }
    .osce-station-controls .btn { flex: 1; }
    .osce-station-controls .muted { flex-basis: 100%; text-align: center; order: 3; margin: 0; }
}

/* -------- Image-left / text-right hero banner -------- */
.hero-banner { padding: 28px 0 8px; }
.hero-banner-inner {
    display: grid;
    grid-template-columns: .95fr 1.05fr;
    gap: 48px;
    align-items: center;
    padding: 40px;
    border: 1px solid var(--green-100);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #ffffff 0%, var(--bg-tint) 100%);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.hero-banner-media { position: relative; }
.hero-banner-media img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.hero-banner-body .lead { color: var(--ink-2); max-width: 520px; }
.hero-banner-list { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .7rem; }
.hero-banner-list li { display: flex; align-items: flex-start; gap: .6rem; color: var(--ink-2); font-weight: 500; }
.hero-banner-list li svg { color: var(--green-600); flex: none; margin-top: 2px; }

@media (max-width: 860px) {
    .hero-banner-inner { grid-template-columns: 1fr; gap: 26px; padding: 24px; }
    .hero-banner-media { order: -1; }
}