:root {
  --bg: #0f1220;
  --panel: #171a2e;
  --panel-2: #1f2340;
  --text: #e8eaf6;
  --muted: #a3a8c9;
  --accent: #6c8cff;
  --accent-2: #43d9ad;
  --danger: #ff6b6b;
  --ok: #43d9ad;
  --border: #2a2f52;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #1b2050 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding: 14px 22px;
  background: rgba(15,18,32,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.logo {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0d18;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text small { color: var(--muted); font-size: 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  background: transparent; color: var(--muted);
  border: 1px solid transparent; padding: 9px 14px;
  border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.tab:hover { color: var(--text); background: var(--panel); }
.tab.active { color: #fff; background: var(--panel-2); border-color: var(--border); }

main { max-width: 1040px; margin: 0 auto; padding: 28px 22px 80px; }
h1 { font-size: 30px; margin: 0 0 6px; }
h2 { font-size: 22px; margin: 26px 0 12px; }
h3 { font-size: 18px; margin: 0 0 8px; }
p { color: var(--muted); line-height: 1.6; }
.lead { font-size: 17px; color: var(--text); }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px;
}
.card.section-card { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pill {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--muted);
}
.pill.ok { color: #06231a; background: var(--ok); border-color: transparent; }
.pill.locked { color: var(--muted); }
.pill.score { color: #dbe2ff; background: #2b3467; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent), #8a6cff);
  color: #fff; border: none; padding: 12px 18px; border-radius: 10px;
  font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.full { width: 100%; }

.progress-wrap { margin: 14px 0 24px; }
.progress { height: 12px; background: var(--panel); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0%; transition: width .35s ease; }
.progress-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

video { width: 100%; border-radius: var(--radius); background: #000; display: block; }
.video-note { font-size: 13px; color: var(--muted); margin-top: 8px; }

.q { padding: 16px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; background: var(--panel); }
.q .q-text { font-weight: 700; color: var(--text); margin-bottom: 10px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.opt:hover { background: var(--panel-2); }
.opt input { margin-top: 3px; accent-color: var(--accent); }
.opt.correct { border-color: var(--ok); background: rgba(67,217,173,.12); }
.opt.wrong { border-color: var(--danger); background: rgba(255,107,107,.12); }
.explain { font-size: 13px; color: var(--muted); margin-top: 6px; }

.banner { border-radius: 12px; padding: 14px 16px; margin: 16px 0; border: 1px solid var(--border); }
.banner.ok { background: rgba(67,217,173,.12); border-color: var(--ok); }
.banner.bad { background: rgba(255,107,107,.12); border-color: var(--danger); }

.score-big { font-size: 44px; font-weight: 800; margin: 6px 0; }
.center { text-align: center; }

.cert {
  background: #fff; color: #16203a; border-radius: 16px; padding: 40px;
  border: 10px solid #16203a; position: relative; max-width: 820px; margin: 0 auto;
}
.cert h1 { color: #16203a; font-size: 34px; letter-spacing: 1px; }
.cert .seal {
  width: 92px; height: 92px; border-radius: 50%; margin: 0 auto 14px;
  display: grid; place-items: center; font-weight: 800; font-size: 26px; color: #fff;
  background: linear-gradient(135deg, #16203a, #3a4a86);
}
.cert .name { font-size: 30px; font-weight: 800; margin: 14px 0 4px; border-bottom: 2px solid #16203a; display: inline-block; padding: 0 20px 4px; }
.cert .meta { color: #4a5678; font-size: 14px; margin-top: 8px; }
.cert .sig { margin-top: 30px; display: flex; justify-content: space-between; gap: 20px; }
.cert .sig div { flex: 1; border-top: 1px solid #16203a; padding-top: 6px; font-size: 12px; color: #4a5678; }
.cert .code { margin-top: 18px; font-family: ui-monospace, monospace; font-size: 12px; color: #6a7698; }

.footer { display: flex; justify-content: center; gap: 16px; align-items: center; padding: 22px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 13px; text-decoration: underline; }

.hidden { display: none !important; }

@media print {
  .topbar, .footer, .no-print { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .cert { border-width: 8px; box-shadow: none; }
}
