@font-face {
  font-family: Manrope;
  src: url('assets/manrope-regular.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Manrope;
  src: url('assets/manrope-bold.woff2') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --blue: #1160ff;
  --blue-hover: #0052f7;
  --blue-text: #0c50cc;
  --blue-light: #d6e4ff;
  --blue-wash: #eff5ff;
  --navy: #09162f;
  --ink: #141d2e;
  --muted: #506078;
  --line: #e0e7f1;
  --canvas: #f4f7fc;
  --white: #fff;
  --green: #146043;
  --green-light: #e6f5ed;
  --red: #943d31;
  --red-light: #fcf0ed;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 1rem/1.55 Manrope, system-ui, sans-serif;
}

h1, h2, h3, p { margin: 0; }
button { font: inherit; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shell { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }

.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand img { display: block; width: clamp(140px, 17vw, 198px); height: auto; }

.course-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--blue-text);
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 700;
}

.course-link:hover { background: var(--blue-wash); border-color: var(--blue-light); }
.main-content { padding-block: 36px 64px; }

.hero {
  display: flex;
  align-items: center;
  min-height: 269px;
  overflow: hidden;
  isolation: isolate;
  position: relative;
  padding: 35px 48px;
  border-radius: 20px;
  color: var(--white);
  background: var(--navy);
}

.hero-art {
  position: absolute;
  top: -6%;
  right: 0;
  z-index: -1;
  width: auto;
  height: 112%;
  mask-image: linear-gradient(90deg, transparent, #000 52%);
}

.hero-label {
  margin-bottom: 9px;
  color: #b6d2ff;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); line-height: 1.08; letter-spacing: -0.056em; }
.hero-description { max-width: 46ch; margin-top: 13px; color: #d9e5fb; font-size: 1.0625rem; }
.hero-meta { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 0; margin: 22px 0 0; }
.hero-meta li { display: flex; align-items: center; gap: 7px; color: #e1edff; font-size: 0.875rem; font-weight: 700; }
.hero-meta .icon { color: #9dc1ff; }

.quiz-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(288px, 0.44fr); align-items: start; gap: 24px; margin-top: 26px; }

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 4px 16px #152b5007;
}

.question-panel, .result-panel { padding: clamp(22px, 3.1vw, 36px); scroll-margin-top: 16px; }
.question-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px 16px; margin-bottom: 16px; }
.question-number { color: var(--muted); font-size: 0.875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.section-label { border-radius: 5px; background: var(--blue-wash); color: var(--blue-text); padding: 4px 9px; font-size: 0.75rem; font-weight: 700; }
.question-panel h2, .result-panel h2 { font-size: clamp(1.55rem, 2.45vw, 2.15rem); line-height: 1.22; letter-spacing: -0.033em; }
.question-panel h2:focus, .result-panel h2:focus { outline: none; }
.question-instruction { margin-top: 8px; color: var(--muted); font-size: 0.9375rem; }

fieldset { display: grid; gap: 9px; min-width: 0; margin: 22px 0 0; padding: 0; border: 0; }

.choice {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 19px;
  gap: 13px;
  align-items: center;
  min-height: 58px;
  padding: 10px 15px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}

.choice:hover:not(:has(:disabled)) { border-color: #9bbdff; background: #f8faff; }
.choice:has(:checked):not(:has(:disabled)) { border-color: var(--blue); background: var(--blue-wash); }
.choice:has(:focus-visible) { outline: 3px solid var(--blue); outline-offset: 2px; }
.choice:has(:disabled) { cursor: default; }
.choice-input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.choice-letter { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; background: var(--canvas); color: var(--muted); font-size: 0.875rem; font-weight: 700; }
.choice-text { font-size: 0.9375rem; }
.choice-marker { display: grid; place-items: center; width: 19px; height: 19px; border: 1.5px solid #899bb1; border-radius: 50%; }
.choice:has(:checked) .choice-letter { color: var(--blue-text); background: var(--blue-light); }
.choice:has(:checked) .choice-marker { border-color: var(--blue); }
.choice:has(:checked) .choice-marker::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }

.choice.is-correct { border-color: #8bc6aa; background: #f4fbf7; }
.choice.is-incorrect { border-color: #dfab9f; background: #fff8f6; }
.choice.is-correct .choice-letter, .review-mark.is-correct { background: var(--green-light); color: var(--green); }
.choice.is-incorrect .choice-letter, .review-mark.is-incorrect { background: var(--red-light); color: var(--red); }
.choice.is-correct .choice-marker { background: var(--green); border-color: var(--green); }
.choice.is-incorrect .choice-marker { background: var(--red); border-color: var(--red); }
.choice.is-correct .choice-marker::after, .choice.is-incorrect .choice-marker::after {
  width: auto;
  height: auto;
  background: transparent;
  color: var(--white);
  font: 700 13px/1 system-ui, sans-serif;
}
.choice.is-correct .choice-marker::after { content: '✓'; }
.choice.is-incorrect .choice-marker::after { content: '×'; }

.field-error:not(:empty) { margin-top: 10px; color: var(--red); font-size: 0.875rem; font-weight: 700; }
.feedback:not(:empty) { margin-top: 16px; padding: 15px 17px; border-left: 3px solid currentColor; border-radius: 5px 9px 9px 5px; }
.feedback.is-correct { color: var(--green); background: #f0f9f4; }
.feedback.is-incorrect { color: var(--red); background: #fff5f2; }
.feedback-title { margin-bottom: 4px; font-weight: 700; }
.feedback-explanation, .review-explanation { color: var(--ink); font-size: 0.9375rem; }
.slide-reference { margin-top: 9px; color: var(--muted); font-size: 0.8125rem; font-weight: 700; }
.question-actions { display: flex; justify-content: flex-end; margin-top: 22px; }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  scroll-margin-bottom: 12px;
}

.primary-button { background: var(--blue); color: var(--white); }
.primary-button:hover { background: var(--blue-hover); }
.secondary-button { border-color: var(--blue-light); background: var(--blue-wash); color: var(--blue-text); }
.secondary-button:hover { background: var(--blue-light); }

.overview { padding: 24px; }
.overview h2 { font-size: 1.1875rem; letter-spacing: -0.02em; }
.progress-block { margin-top: 16px; }
.progress-label { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); margin-bottom: 8px; font-size: 0.8125rem; font-weight: 700; }
#progress-count { color: var(--blue-text); font-variant-numeric: tabular-nums; }
progress { display: block; width: 100%; height: 7px; border: 0; border-radius: 10px; overflow: hidden; appearance: none; background: #e9f0fc; color: var(--blue); }
progress::-webkit-progress-bar { background: #e9f0fc; }
progress::-webkit-progress-value { background: var(--blue); border-radius: 10px; }
progress::-moz-progress-bar { background: var(--blue); border-radius: 10px; }

.topics { list-style: none; display: grid; gap: 4px; margin: 20px 0 0; padding: 15px 0 0; border-top: 1px solid var(--line); }
.topic { display: grid; align-items: center; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; padding: 8px; border-radius: 8px; }
.topic.is-current { background: var(--blue-wash); }
.topic-marker { display: grid; place-items: center; width: 30px; height: 30px; background: var(--canvas); color: var(--muted); border-radius: 6px; font-size: 0.75rem; font-weight: 700; }
.topic.is-current .topic-marker { background: var(--blue); color: var(--white); }
.topic.is-complete .topic-marker { background: var(--green-light); color: var(--green); }
.topic-title { font-size: 0.875rem; font-weight: 700; }
.topic-count { color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }

.result-header { display: flex; align-items: center; gap: 15px; }
.result-mark { display: grid; place-items: center; flex: none; width: 54px; height: 54px; border-radius: 12px; background: var(--blue-wash); color: var(--blue-text); font-size: 1.6rem; }
.result-score { margin-top: 5px; color: var(--muted); font-weight: 700; }
.result-actions { margin-top: 21px; }
.review { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 21px; }
.review h3 { margin-bottom: 13px; font-size: 1.125rem; }
.review-item { border-bottom: 1px solid var(--line); }
.review-item:last-child { border-bottom: 0; }
.review-summary { display: grid; grid-template-columns: 26px 1fr 10px; align-items: center; gap: 10px; padding: 12px 4px; list-style: none; cursor: pointer; }
.review-summary::-webkit-details-marker { display: none; }
.review-summary::after { content: ''; width: 8px; height: 8px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.review-item[open] .review-summary::after { transform: translateY(2px) rotate(225deg); }
.review-summary:hover { color: var(--blue-text); }
.review-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 5px; font-weight: 700; }
.review-question { font-size: 0.875rem; font-weight: 700; }
.review-details { padding: 0 14px 15px 40px; }
.review-answer { margin-bottom: 5px; font-size: 0.875rem; font-weight: 700; }
.review-explanation { margin-top: 8px; }
.noscript { padding: 18px; margin-top: 20px; }

@media (max-width: 840px) {
  .shell { width: min(720px, calc(100% - 40px)); }
  .main-content { padding-top: 26px; }
  .quiz-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 18px; }
  .hero { padding-inline: 32px; }
  .hero-art { opacity: 0.6; }
}

@media (max-width: 520px) {
  .shell { width: calc(100% - 28px); }
  .header-inner { min-height: 62px; }
  .course-link { padding: 7px 9px; font-size: 0.75rem; }
  .main-content { padding-block: 16px 36px; }
  .hero { min-height: 228px; padding: 24px; border-radius: 14px; }
  .hero-art { opacity: 0.3; }
  .hero-description { font-size: 0.9375rem; }
  .hero-meta { margin-top: 16px; }
  .hero-meta li { font-size: 0.8125rem; }
  .question-panel, .result-panel, .overview { padding: 18px; border-radius: 13px; }
  .choice { grid-template-columns: 28px minmax(0, 1fr) 16px; gap: 9px; padding: 9px; }
  .choice-letter { width: 28px; height: 28px; }
  .choice-marker { width: 16px; height: 16px; }
  .choice-text { font-size: 0.875rem; }
  .question-actions .button { width: 100%; }
}
