:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --ink: #0c1f46;
  --muted: #5f6e86;
  --line: #d9e1ed;
  --brand: #0a214f;
  --brand-dark: #06183a;
  --brand-soft: #eef3fb;
  --accent: #8a929f;
  --danger: #b42318;
  --warn: #b54708;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--brand-dark); text-decoration: none; }
.shell { max-width: 1180px; margin: 0 auto; padding: 24px; }
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.topbar .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
  color: var(--brand);
}
.brand-logo {
  display: block;
  width: 174px;
  max-width: 42vw;
  height: auto;
}
.brand-mark {
  display: block;
  width: 24px;
  height: 32px;
  object-fit: contain;
}
.nav { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: start;
  padding-top: 44px;
}
.hero h1 { color: var(--brand-dark); }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.stat strong { display: block; font-size: 28px; margin-bottom: 4px; }
h1 { font-size: 34px; line-height: 1.1; margin: 0 0 14px; }
h2 { margin: 0 0 16px; font-size: 22px; }
h3 { margin: 0 0 10px; }
p { line-height: 1.5; color: var(--muted); }
label { display: block; font-weight: 700; margin: 12px 0 6px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.btn.secondary { background: var(--brand-soft); color: var(--brand); }
.btn.danger { background: var(--danger); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.flash { border-radius: 6px; padding: 12px 14px; margin-bottom: 16px; background: #e8f6f1; color: var(--brand-dark); }
.flash.error { background: #fee4e2; color: var(--danger); }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--brand-soft); font-size: 13px; color: var(--brand); }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #e8edf3; font-size: 12px; font-weight: 700; }
.badge.passed { background: #d1fadf; color: #067647; }
.badge.failed { background: #fee4e2; color: #b42318; }
.timer { font-weight: 700; color: var(--warn); }
.exam-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 10px rgba(12, 31, 70, 0.08);
}
.exam-topbar .brand {
  min-width: 0;
}
.exam-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.question { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.option { display: flex; gap: 10px; align-items: flex-start; margin: 9px 0; font-weight: 400; }
.option input { width: auto; margin-top: 3px; }
.muted { color: var(--muted); }
.footer {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.footer .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}
.footer img {
  width: 150px;
  height: auto;
}
.protocol-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--brand);
}
.protocol-header img {
  width: 190px;
  height: auto;
}
.protocol-title {
  text-align: right;
}
.protocol-title h1 {
  margin-bottom: 6px;
}
@media (max-width: 800px) {
  .hero, .two, .grid { grid-template-columns: 1fr; }
  .shell { padding: 18px; }
  .exam-topbar .shell { align-items: flex-start; }
  .exam-topbar .brand { font-size: 16px; }
  .exam-controls { align-items: flex-end; flex-direction: column; gap: 8px; }
  h1 { font-size: 28px; }
  .footer .shell { align-items: flex-start; flex-direction: column; }
  .protocol-header { flex-direction: column; }
  .protocol-title { text-align: left; }
}
@media print {
  body { background: #fff; }
  .actions { display: none; }
  .shell { max-width: none; padding: 0; }
  .panel { border: 0; padding: 0; }
  .protocol-header { page-break-inside: avoid; }
}
