:root {
  --bg: #0f172a;
  --panel: #111c35;
  --panel-2: #182747;
  --text: #e5edf9;
  --muted: #a6b4cc;
  --line: rgba(255,255,255,.12);
  --accent: #8dd3ff;
  --accent-2: #a78bfa;
  --danger: #ffb4b4;
  --success: #b8f7c1;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif; background: radial-gradient(circle at top left, #1e3a8a 0, #0f172a 36rem); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { min-height: 72px; display: flex; align-items: center; gap: 1.5rem; padding: 0 2rem; border-bottom: 1px solid var(--line); background: rgba(15,23,42,.86); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 5; }
.brand { color: white; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.topbar nav { display: flex; gap: 1rem; flex-wrap: wrap; flex: 1; }
.topbar nav a { color: var(--muted); font-weight: 600; }
.accountbar { display: flex; align-items: center; gap: .8rem; }
.accountbar form { display: inline; }
.container { width: min(1120px, calc(100% - 2rem)); margin: 2rem auto 4rem; }
.footer { border-top: 1px solid var(--line); padding: 1.25rem 2rem; color: var(--muted); display: flex; gap: 1rem; justify-content: center; }
.hero { display: grid; grid-template-columns: 1.4fr .8fr; gap: 2rem; align-items: center; padding: 3.5rem 0; }
.hero h1 { font-size: clamp(3rem, 8vw, 6rem); line-height: .9; margin: .2rem 0 1rem; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 760px; }
.eyebrow, .pill { display: inline-block; color: #dbeafe; background: rgba(141,211,255,.14); border: 1px solid rgba(141,211,255,.22); padding: .35rem .7rem; border-radius: 999px; font-size: .85rem; font-weight: 700; }
.hero-card, .card, .form-card, .notice, .result-card { background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04)); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 22px 50px rgba(0,0,0,.28); }
.hero-card { padding: 1.5rem; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.card { padding: 1.25rem; }
.card h2, .card h3 { margin-top: .2rem; }
.admin-link { color: white; font-weight: 800; font-size: 1.25rem; min-height: 110px; display: flex; align-items: center; justify-content: center; }
.actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; padding: .8rem 1.1rem; font-weight: 800; color: #07111f; background: linear-gradient(135deg, var(--accent), var(--accent-2)); cursor: pointer; }
.button.secondary { background: rgba(255,255,255,.1); color: white; border: 1px solid var(--line); }
.button.small { padding: .55rem .8rem; font-size: .9rem; }
.linkbutton { background: transparent; color: var(--accent); border: 0; cursor: pointer; font: inherit; }
.form-card { max-width: 520px; padding: 1.5rem; margin: 0 auto; }
.form-card.wide { max-width: 860px; }
label { display: block; margin: .9rem 0 .35rem; color: var(--muted); font-weight: 700; }
input, select, textarea { width: 100%; padding: .85rem; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--text); }
textarea { min-height: 120px; }
select option { color: #0f172a; }
.checkbox { display: flex; align-items: center; gap: .6rem; }
.checkbox input { width: auto; }
.validation { color: var(--danger); font-size: .9rem; }
.notice { padding: 1rem; margin: 1rem 0; color: #dbeafe; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.5rem 0; }
.stat { padding: 1.25rem; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.06); }
.stat strong { font-size: 2rem; display: block; }
.stat span { color: var(--muted); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.5rem 0 1rem; }
.filters { display: flex; gap: .8rem; align-items: center; margin: 1rem 0 1.5rem; }
.filters input { max-width: 320px; }
.filters select { max-width: 260px; }
.table { width: 100%; border-collapse: collapse; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.table th, .table td { text-align: left; border-bottom: 1px solid var(--line); padding: .85rem; vertical-align: top; }
.table th { color: white; background: rgba(255,255,255,.08); }
.lesson-list { padding-left: 1.2rem; }
.lesson-list li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: .7rem 0; gap: 1rem; }
.lesson { max-width: 820px; }
.lesson-content { font-size: 1.15rem; line-height: 1.7; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 20px; padding: 1.5rem; }
.progressbar { height: 14px; background: rgba(255,255,255,.09); border-radius: 999px; overflow: hidden; }
.progressbar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.quiz-form fieldset { margin: 1rem 0; }
.quiz-form legend { font-weight: 800; padding: .4rem; }
.option { display: block; background: rgba(255,255,255,.05); border-radius: 14px; padding: .75rem; margin: .5rem 0; }
.option input { width: auto; margin-right: .5rem; }
.result-card { padding: 1.5rem; margin: 1rem 0; }
.result-card.passed { border-color: rgba(184,247,193,.45); }
.result-card.failed { border-color: rgba(255,180,180,.45); }
code { background: rgba(255,255,255,.1); padding: .12rem .35rem; border-radius: .35rem; }
small { color: var(--muted); }
@media (max-width: 840px) {
  .topbar { flex-direction: column; align-items: flex-start; padding: 1rem; }
  .hero, .grid, .stats { grid-template-columns: 1fr; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters input, .filters select { max-width: none; }
}

body[data-theme="light"] {
  --bg: #f7fafc;
  --panel: #ffffff;
  --panel-2: #eef5ff;
  --text: #0f172a;
  --muted: #475569;
  --line: rgba(15,23,42,.14);
  --accent: #2563eb;
  --accent-2: #7c3aed;
  background: radial-gradient(circle at top left, #dbeafe 0, #f8fafc 34rem);
}
body[data-theme="contrast"] {
  --bg: #000;
  --panel: #090909;
  --panel-2: #111;
  --text: #fff;
  --muted: #facc15;
  --line: rgba(250,204,21,.55);
  --accent: #facc15;
  --accent-2: #22d3ee;
  background: #000;
}
.grid.two { grid-template-columns: repeat(2, 1fr); }
.button.danger { background: linear-gradient(135deg, #ffb4b4, #fb7185); color: #330a0a; }
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .55rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: .82rem; font-weight: 800; }
.badge.success { color: var(--success); border-color: rgba(184,247,193,.35); }
.badge.warn { color: #fde68a; border-color: rgba(253,230,138,.35); }
.badge.danger { color: var(--danger); border-color: rgba(255,180,180,.35); }
.kpi-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.kpi-list div { padding: .9rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.04); }
.kpi-list strong { display: block; font-size: 1.4rem; }
.inline-form { display: inline; }
.mini-form { display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: end; }
.stack { display: grid; gap: 1rem; }
.muted { color: var(--muted); }
pre { white-space: pre-wrap; background: rgba(255,255,255,.07); padding: 1rem; border-radius: 14px; border: 1px solid var(--line); }
@media (max-width: 840px) {
  .grid.two, .kpi-list { grid-template-columns: 1fr; }
  .mini-form { grid-template-columns: 1fr; }
}

.card.locked { opacity: .68; }
.lesson-content { white-space: pre-wrap; }

.review-list { display: grid; gap: 1rem; margin: 1rem 0 2rem; }
.card.passed { border-color: rgba(62, 207, 142, .65); }
.card.failed { border-color: rgba(255, 107, 107, .65); }
.lesson-content strong, .lesson-content b { color: var(--text); }

.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: end; }
.grid-form .wide-field { grid-column: 1 / -1; }
.text-danger { color: var(--danger); display: block; margin-top: .75rem; }
@media (max-width: 840px) { .grid-form { grid-template-columns: 1fr; } }


.multi-box { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 16px; padding: .75rem; background: rgba(255,255,255,.04); }
.multi-box .checkbox { align-items: flex-start; padding: .35rem 0; }
.license-window { padding: .7rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.05); margin-bottom: .75rem; color: var(--muted); }
.code-list { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; letter-spacing: .04em; }
