:root {
  --green: #67b66d;
  --green-dark: #2f7b43;
  --green-soft: #eaf6ed;
  --blue: #183b63;
  --text: #23272f;
  --muted: #667085;
  --line: #d9e2dc;
  --bg: #f7f9f8;
  --white: #ffffff;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  align-items: center;
  background: var(--blue);
  color: var(--white);
  display: flex;
  justify-content: space-between;
  min-height: 82px;
  padding: 18px clamp(18px, 5vw, 64px);
}

.brand {
  align-items: center;
  display: flex;
  gap: 14px;
}

.brand-title {
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 700;
  line-height: 1.2;
  max-width: 720px;
}

.topnav {
  display: flex;
  gap: 10px;
}

.nav-link {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  color: var(--white);
  padding: 10px 14px;
  text-decoration: none;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hero {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  align-items: center;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) 360px;
  margin: 0 auto;
  max-width: 1180px;
  min-height: 360px;
  padding: 56px 24px;
}

.eyebrow {
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  color: #26313d;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 500;
  line-height: 1.08;
  max-width: 820px;
}

.hero-text {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  max-width: 700px;
}

.dashboard article {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.dashboard span {
  color: var(--blue);
  display: block;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
}

.dashboard small {
  color: var(--muted);
  display: block;
  margin-top: 6px;
}

.hero-media {
  align-items: center;
  display: flex;
  justify-content: center;
}

.hero-media img {
  border-radius: 8px;
  display: block;
  height: auto;
  max-height: 300px;
  max-width: 100%;
  object-fit: contain;
  width: 100%;
}

.section {
  margin: 0 auto;
  max-width: 1180px;
  padding: 42px 24px;
}

.section-head {
  margin-bottom: 20px;
}

.section-head h2 {
  font-size: 34px;
  font-weight: 500;
  margin-bottom: 0;
}

.test-shell,
.login-card,
.admin-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.form-grid,
.filters {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label span {
  color: #344054;
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 7px;
}

input,
select,
textarea {
  background: var(--white);
  border: 1px solid #cfd8d2;
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  min-height: 46px;
  padding: 10px 12px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green-dark);
  outline: 3px solid rgba(103, 182, 109, 0.22);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.test-meta {
  background: var(--green-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green-dark);
  font-weight: 700;
  margin-top: 18px;
  padding: 14px 16px;
}

.questions {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.consent-box {
  align-items: flex-start;
  background: #f8fbf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  line-height: 1.45;
  margin-top: 18px;
  padding: 14px 16px;
}

.consent-box input {
  margin-top: 3px;
  min-height: auto;
  width: auto;
}

.consent-box span {
  color: #344054;
  display: inline;
  font-size: 14px;
  font-weight: 400;
  margin: 0;
}

.consent-box a {
  color: var(--green-dark);
  font-weight: 700;
}

.question-title {
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 14px;
}

.option-list {
  display: grid;
  gap: 10px;
}

.option-list label {
  align-items: flex-start;
  border: 1px solid #e1e7e3;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
}

.option-list input {
  min-height: auto;
  margin-top: 3px;
  width: auto;
}

.form-actions,
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  padding: 10px 16px;
}

.primary-btn {
  background: var(--green);
  color: var(--white);
}

.primary-btn:hover {
  background: var(--green-dark);
}

.ghost-btn {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--blue);
}

.danger-btn {
  background: var(--danger-soft);
  border: 1px solid #f4b8b2;
  color: var(--danger);
}

.message {
  background: var(--green-soft);
  border: 1px solid var(--green);
  border-radius: 8px;
  color: var(--green-dark);
  font-size: 18px;
  font-weight: 700;
  margin-top: 18px;
  padding: 18px;
}

.message.warning {
  background: #fff7e6;
  border-color: #f3c36b;
  color: #8a5a00;
}

.login-card {
  align-items: end;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
}

.login-card p,
.admin-toolbar p {
  color: var(--muted);
  margin-bottom: 0;
}

.login-form {
  display: grid;
  gap: 12px;
}

.error-text {
  color: var(--danger);
  font-weight: 700;
}

.admin-toolbar {
  align-items: start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.dashboard {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 22px 0;
}

.filters {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.wide-filter {
  grid-column: span 2;
}

.test-head,
.panel-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.timer {
  background: var(--blue);
  border-radius: 8px;
  color: var(--white);
  font-size: 24px;
  font-weight: 700;
  min-width: 108px;
  padding: 12px 16px;
  text-align: center;
}

.inline-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.inline-form input {
  max-width: 280px;
}

.admin-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.list-item,
.summary-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.list-item p {
  color: var(--muted);
  margin: 8px 0 12px;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

table {
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f0f5f2;
  color: #344054;
  font-size: 13px;
  position: sticky;
  top: 0;
}

tbody tr:hover {
  background: #fbfdfb;
}

.score-badge {
  border-radius: 999px;
  display: inline-block;
  font-weight: 700;
  padding: 5px 10px;
}

.score-high {
  background: var(--green-soft);
  color: var(--green-dark);
}

.score-middle {
  background: #fff7e6;
  color: #9a6700;
}

.score-low {
  background: var(--danger-soft);
  color: var(--danger);
}

.details-btn {
  background: var(--blue);
  color: var(--white);
  min-height: 34px;
  padding: 7px 10px;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 820px;
  padding: 0;
  width: calc(100% - 32px);
}

dialog::backdrop {
  background: rgba(24, 59, 99, 0.35);
}

.dialog-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 16px 18px;
}

.dialog-head h3 {
  margin: 0;
}

.icon-btn {
  background: #f2f4f7;
  color: var(--text);
  min-height: 34px;
  padding: 6px 11px;
}

.details-body {
  display: grid;
  gap: 12px;
  max-height: 70vh;
  overflow: auto;
  padding: 18px;
}

.answer-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.answer-row.correct {
  border-color: var(--green);
}

.answer-row.wrong {
  border-color: #f4b8b2;
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .topbar,
  .admin-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-inner,
  .login-card {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .filters,
  .dashboard {
    grid-template-columns: 1fr;
  }

  .wide-filter {
    grid-column: span 1;
  }

  .test-head,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }
}
