:root {
  --bg: #eef2f6;
  --card: #ffffff;
  --text: #10253f;
  --muted: #5c7088;
  --line: #d5e0ec;
  --brand: #0086e8;
  --brand-dark: #006cc8;
  --ok: #1f7d42;
  --bad: #b03434;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Source Sans 3", "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; }
.layout { max-width: 1240px; margin: 0 auto; }

.topbar {
  background: #fff;
  border-bottom: 1px solid #e6edf4;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  width: 46px;
  height: 46px;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-family: Georgia, serif;
}
.brand h1 { margin: 0; font-size: 32px; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 18px; font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.menu-wrap { position: relative; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border-radius: 4px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-size: 21px;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.ghost { background: #fff; color: var(--brand); border-color: #bdd8f5; }
.btn.disabled { opacity: .55; pointer-events: none; }
.menu-btn::before { content: "\2630"; margin-right: 8px; font-size: 16px; }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 260px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 32px rgba(14, 42, 72, .14);
  padding: 8px;
  display: none;
  z-index: 12;
}
.menu-panel.open { display: block; }
.menu-link {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: #123255;
  font-size: 19px;
  font-weight: 700;
}
.menu-link:hover { background: #eef6ff; color: #005fb1; }

.hero {
  min-height: 350px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.15), rgba(0,132,230,.2)),
    url("/assets/crv-hero.jpg") center/cover no-repeat,
    linear-gradient(90deg, #d4dce4, #e7edf3);
  display: flex;
  align-items: end;
  padding: 40px 24px;
  position: relative;
}
.hero-box {
  background: rgba(0,134,232,.92);
  color: #fff;
  max-width: 700px;
  padding: 20px 24px;
}
.hero-box h2 { margin: 0 0 8px; font-size: 44px; line-height: 1.06; }
.hero-box p { margin: 0; font-size: 23px; line-height: 1.35; }
.hero-search {
  position: absolute;
  left: 50%;
  bottom: -28px;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 48px));
  background: #fff;
  border: 1px solid #d7e4f1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  overflow: hidden;
  box-shadow: 0 10px 18px rgba(20, 42, 64, .1);
}
.hero-search input {
  border: 0;
  outline: none;
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  font-size: 22px;
  color: #16385a;
}
.hero-search button {
  border: 0;
  background: var(--brand);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  min-height: 56px;
  width: 68px;
  cursor: pointer;
}
.hero-search button:hover { background: var(--brand-dark); }

.section { padding: 24px; }
.section.hero-gap { padding-top: 52px; }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
.columns-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.columns-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.card h2, .card h3 { margin: 0 0 8px; }
.card strong { font-size: 40px; color: var(--brand-dark); }
.card p { margin: 0 0 8px; color: #24415f; font-size: 22px; }
.links-list { margin: 0; padding: 0; list-style: none; }
.links-list li { margin-bottom: 8px; color: #22405f; font-size: 21px; }
.links-list li::before { content: "\203A"; color: #97a8bc; font-weight: 800; margin-right: 6px; }

.badge { display: inline-flex; align-items: center; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line); font-weight: 700; }
.badge.success { background: #e7f7ee; color: var(--ok); border-color: #cdeedb; }
.status { color: var(--muted); font-size: 19px; }
.ok { color: var(--ok); font-weight: 700; font-size: 20px; }
.bad { color: var(--bad); font-weight: 700; font-size: 20px; }
.lesson-card { border-left: 4px solid var(--brand); }
.stack { display: grid; gap: 12px; }
.question-block { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fff; }
.question-block p { margin: 0 0 10px; color: var(--text); font-weight: 700; font-size: 22px; }
.question-block label { display: block; margin-bottom: 8px; color: var(--text); font-size: 20px; }
input[type='radio'] { margin-right: 8px; }

.wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card { width: min(640px, 100%); }

.exam-shell { gap: 10px; }
.exam-topbar,
.exam-bottombar {
  background: #0f6f9e;
  color: #fff;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.exam-time, .exam-meta { font-size: 18px; font-weight: 700; }
.exam-tools, .exam-actions-right { display: flex; gap: 8px; align-items: center; }
.exam-tool-btn, .exam-nav-btn, .exam-submit-btn {
  border: 1px solid #b9dff5;
  border-radius: 4px;
  background: #fff;
  color: #0f4d72;
  padding: 8px 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.exam-submit-btn {
  background: #f7a900;
  border-color: #e39a00;
  color: #1f2d3a;
}
.exam-nav-btn:disabled { opacity: .45; cursor: not-allowed; }

.exam-overview {
  background: #f2f8fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(110px,1fr));
  gap: 8px;
}
.overview-item {
  border: 1px solid #bfd4e7;
  border-radius: 999px;
  padding: 8px 10px;
  background: #fff;
  color: #184066;
  font-weight: 700;
  cursor: pointer;
}
.overview-item.active { border-color: #0f6f9e; background: #e8f5fc; }
.overview-item.answered { border-color: #4da566; }
.overview-item.marked { box-shadow: inset 0 0 0 2px #f5b200; }

.exam-question { display: none; }
.exam-question.active { display: block; }
.exam-question.marked .exam-prompt { border-color: #f5b200; }
.exam-prompt {
  border: 1px solid #c8d7e4;
  background: #fff;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 32px;
  font-weight: 600;
}
.exam-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
}
.exam-media img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid #cad9e7;
  object-fit: cover;
}
.drag-question { width: 100%; }
.drag-canvas {
  position: relative;
  border: 1px solid #cad9e7;
  border-radius: 6px;
  overflow: hidden;
  min-height: 260px;
  background: #f5f8fb;
}
.drag-canvas img {
  display: block;
  width: 100%;
  height: auto;
}
.drag-bank {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  flex-wrap: wrap;
}
.drag-token {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 4px solid #f19f00;
  background: #fff;
  color: #f19f00;
  font-size: 28px;
  font-weight: 700;
  cursor: grab;
}
.drag-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 4px solid #f19f00;
  background: rgba(241, 159, 0, .25);
  color: #bf7300;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  pointer-events: none;
}
.exam-media-placeholder {
  min-height: 260px;
  border: 1px dashed #bfd1e2;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5f7690;
  font-size: 18px;
  background: #f6f9fc;
  padding: 12px;
}
.exam-answers label {
  display: block;
  border: 1px solid #cfdae6;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
  font-size: 22px;
}
.exam-answers label:has(input:checked) {
  border-color: #0f6f9e;
  background: #edf8ff;
}

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .columns-2, .columns-3 { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .hero { min-height: 270px; padding: 20px; }
  .hero-search { width: calc(100% - 24px); bottom: -22px; }
  .hero-search input { min-height: 48px; font-size: 18px; }
  .hero-search button { min-height: 48px; width: 56px; }
  .hero-box h2 { font-size: 31px; }
  .hero-box p { font-size: 20px; }
  .card p, .links-list li, .question-block p, .question-block label, .status, .ok, .bad { font-size: 18px; }
  .exam-topbar, .exam-bottombar { flex-wrap: wrap; }
  .exam-prompt { font-size: 24px; }
  .exam-body { grid-template-columns: 1fr; }
  .exam-answers label { font-size: 18px; }
}
