:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #16202a;
  --muted: #5d6978;
  --line: #d9e0e8;
  --brand: #f2b705;
  --brand-dark: #725400;
  --accent: #176b87;
  --good: #147a42;
  --bad: #b42318;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
select,
input {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px clamp(16px, 4vw, 48px);
  background: #111820;
  color: white;
  border-bottom: 6px solid var(--brand);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: 0;
}

.score {
  min-width: 150px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  text-align: right;
}

.score span {
  display: block;
  color: #d7dce2;
  font-size: 13px;
}

.score strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(240px, 310px) minmax(0, 1fr);
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto;
}

.sidebar,
.quiz {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(28, 38, 49, 0.08);
}

.sidebar {
  align-self: start;
  padding: 18px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
}

input[type="email"],
input[type="password"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
}

.user-panel {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.user-panel h2 {
  margin-bottom: 14px;
  font-size: 17px;
}

.signup-form {
  display: grid;
  gap: 0;
}

#signupButton {
  width: 100%;
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.user-status {
  display: grid;
  gap: 12px;
}

.user-status span {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 700;
}

.form-message {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.form-message.success {
  color: var(--good);
}

.form-message.error {
  color: var(--bad);
}

.checkline {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
}

.actions,
.quiz-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

#confirmButton {
  background: var(--brand);
  border-color: var(--brand);
  color: #171200;
}

#nextButton {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.status {
  margin-top: 24px;
}

.status h2 {
  font-size: 17px;
}

.meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf3;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 180ms ease;
}

#progressText {
  margin: 10px 0 0;
  color: var(--muted);
}

.quiz {
  padding: clamp(18px, 4vw, 34px);
}

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.question-meta a {
  color: var(--accent);
}

#lessonTitle {
  margin-bottom: 12px;
  font-size: 22px;
}

.question {
  margin-bottom: 22px;
  font-size: 20px;
  line-height: 1.45;
}

.answers {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.answer {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.45;
  cursor: pointer;
}

.answer input {
  margin-top: 3px;
}

.answer.correct {
  border-color: rgba(20, 122, 66, 0.45);
  background: #ebf7f0;
}

.answer.wrong {
  border-color: rgba(180, 35, 24, 0.45);
  background: #fff0ee;
}

.feedback {
  margin-top: 22px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.feedback.good {
  border-color: rgba(20, 122, 66, 0.35);
}

.feedback.bad {
  border-color: rgba(180, 35, 24, 0.35);
}

.feedback h3 {
  margin-bottom: 8px;
}

.official-label {
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.license {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .topbar,
  .layout {
    display: block;
  }

  .score {
    margin-top: 18px;
    text-align: left;
  }

  .sidebar {
    margin-bottom: 18px;
  }

  .question-meta {
    display: grid;
  }
}
