/* A focused study workspace, informed by the school's learning platform.
   Approved previous design: checkpoint/approved-design-2026-10-05. */
:root {
  --purple: #763dca;
  --bright: #763dca;
  --ink: #172333;
  --muted: #68707b;
  --line: #e6e7eb;
  --bg: #ffffff;
  --soft: #f0e9fa;
}
body {
  background: white;
}
h1,
h2,
h3 {
  color: var(--ink);
}
h1 {
  font-weight: 650;
  letter-spacing: -1px;
}
.button {
  border-radius: 10px;
  font-weight: 500;
}
.button:hover {
  background: #6330ad;
}
.button.secondary {
  color: var(--ink);
  background: #f0f1f3;
  border-color: transparent;
}
.button.secondary:hover {
  background: #e7e4ed;
}
.button.small {
  min-height: 38px;
}
.panel {
  border-radius: 14px;
  border-color: var(--line);
}
.public-header {
  height: 76px;
  background: white;
}
.public-header .brand {
  width: 166px;
}
.public-header .quiet-link {
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
}
.public-header .quiet-link:hover {
  background: #f3f0f7;
}
.header-label {
  border: 0;
  padding-left: 0;
  color: #626977;
  font-size: 13px;
}
footer {
  color: #737983;
}
.eyebrow {
  color: var(--muted);
  letter-spacing: 0.035em;
}
.page-context {
  color: var(--muted);
}
.help-strip {
  background: #f4f1f8;
  color: #59606b;
}
input[type="text"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="email"],
input[type="url"],
select,
textarea {
  background: white;
  border-color: #dadde3;
  border-radius: 8px;
}
.field label,
form > p > label {
  color: #424b59;
}

/* Welcome: course-like grouping and direct, circular class navigation. */
.home-page .main {
  padding-top: 28px;
}
.olympiad-hero {
  background: #fae9e2;
  border-radius: 22px;
  min-height: 290px;
  padding: 30px 42px;
  gap: 28px;
  grid-template-columns: 1.2fr 1fr;
}
.hero-subjects {
  color: #535565;
  margin-bottom: 14px;
}
.olympiad-hero h1 {
  color: var(--ink);
  font-size: clamp(38px, 4vw, 54px);
  line-height: 1.1;
  letter-spacing: -1.7px;
  margin-bottom: 16px;
}
.hero-description {
  color: #595d68;
  font-size: 15px;
}
.hero-illustration {
  max-width: 360px;
  max-height: 245px;
}
.class-selection {
  margin-top: 36px;
}
.selection-heading {
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.selection-heading h2 {
  font-size: 24px;
}
.class-grid {
  gap: 12px;
}
.class-card {
  align-items: center;
  text-align: center;
  background: white;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 22px 16px 16px;
  transition: background-color 0.15s;
}
.class-card:hover {
  border-color: transparent;
  box-shadow: none;
  background: #f8f5fc;
}
.class-card-top {
  position: relative;
  margin: 0 0 20px;
  justify-content: center;
  width: 100%;
}
.class-card-number {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--purple);
  color: white;
  font-size: 43px;
  font-weight: 550;
  letter-spacing: -1px;
}
.class-card-number small {
  color: #f3e9ff;
  font-size: 11px;
  margin-top: 1px;
}
.class-card h3 {
  width: 100%;
  max-width: 180px;
  min-height: 44px;
  font-size: 15px;
  margin-bottom: 14px;
  font-weight: 550;
}
.class-card-meta {
  justify-content: center;
  width: 100%;
  color: #69717d;
}
.class-card-action {
  width: 100%;
  justify-content: center;
  border: 0;
  padding-top: 12px;
  margin-top: 8px;
  color: var(--purple);
  font-size: 13px;
}
.class-card .card-arrow {
  width: 22px;
  height: 22px;
  background: transparent;
}
.class-card:hover .card-arrow {
  background: transparent;
  color: var(--purple);
}
.class-card-python {
  background: white;
  border-color: transparent;
}
.subject-label {
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  border: 3px solid white;
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 10px;
}
.registration-note {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 16px;
}

/* Organizer: quieter chrome, clearer hierarchy. */
.admin-body {
  background: #f7f8fa;
}
.sidebar {
  background: white;
}
.sidebar nav a {
  color: #4e5663;
}
.sidebar nav a.active {
  color: var(--purple);
  background: #f0e9fa;
}
.sidebar nav a:hover {
  color: var(--purple);
  background: #f6f2fb;
}
.admin-top {
  color: #646b77;
}
.stats > div,
.stats > div:first-child {
  background: white;
  border-color: var(--line);
  color: var(--ink);
  border-radius: 14px;
}
.stats > div:first-child span,
.stats span {
  color: var(--muted);
}
.stats strong {
  color: var(--ink);
}
.test-list {
  border-radius: 14px;
}
.test-row:hover {
  background: #faf9fc;
}
.class-tile {
  background: #f1ebf9;
  color: var(--purple);
  border-radius: 50%;
  width: 58px;
  height: 58px;
}
.class-tile.yellow {
  background: #fbebbc;
  color: #695111;
}
.count {
  background: #f0ebf6;
}
.registration-aside .class-tile.large {
  border-radius: 50%;
  width: 90px;
  height: 90px;
}
.registration-aside h1 {
  font-size: 33px;
}
.registration-panel {
  border-color: var(--line);
}
.login-panel {
  border-color: var(--line);
}
.duration {
  background: #f4f1f8;
}
.success-icon {
  border-radius: 50%;
}
.prepare .eyebrow {
  color: #727784;
}

/* Exam navigation stays separate from the task content. */
.exam-page {
  background: #f3f2f7;
}
.exam-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(0, 2fr) auto;
  align-items: center;
  gap: 24px;
  padding: 15px 28px;
  min-height: 86px;
  background: #172333;
  color: white;
}
.exam-identity {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}
.exam-identity > div {
  min-width: 0;
}
.exam-identity span {
  display: block;
  color: #c8ced9;
  font-size: 11px;
  margin-bottom: 3px;
}
.exam-identity h1 {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: 0;
  font-weight: 550;
  color: white;
  overflow-wrap: anywhere;
}
.exam-back {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 9px;
  background: #2c3747;
  color: white;
}
.exam-back:hover {
  background: #3b4658;
}
.exam-top .question-nav {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-height: 96px;
  overflow-y: auto;
  padding: 4px;
}
.exam-top .question-nav button {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid #586273;
  border-radius: 50%;
  background: #263244;
  color: white;
  font-size: 14px;
  font-weight: 500;
}
.exam-top .question-nav button:hover {
  border-color: #d2c0ec;
  background: #38435a;
}
.exam-top .question-nav button.answered {
  background: #564374;
  border-color: #a38bbf;
}
.exam-top .question-nav button.answered::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: calc(50% - 2px);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #e0d2f3;
}
.exam-top .question-nav button.current {
  background: white;
  color: #6230ac;
  border-color: white;
  box-shadow: 0 0 0 2px #8c6cb5;
}
.exam-top .question-nav button.current::after {
  background: #763dca;
}
.exam-top .timer-box {
  background: transparent;
  border: 0;
  padding: 0 0 0 12px;
  min-width: 104px;
  text-align: right;
}
.exam-top .timer-box span {
  color: #c8ced9;
  font-size: 11px;
}
.exam-top .timer-box strong {
  display: block;
  color: white;
  font-size: 25px;
  line-height: 1.3;
  font-weight: 550;
}
.exam-top .timer-box.urgent strong {
  color: #ffdb80;
}
.exam-page .exam-main {
  max-width: 1420px;
  padding: 24px 32px 52px;
  min-height: calc(100vh - 170px);
}
.exam-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.exam-overview p {
  font-size: 13px;
  color: #626b79;
  margin: 0;
}
.exam-overview .button {
  background: #e8e6ee;
  font-size: 12px;
}
.exam-page .play-layout {
  display: block;
}
.exam-page .task-panel {
  display: grid;
  grid-template-columns: minmax(270px, 0.85fr) minmax(0, 2fr);
  grid-template-rows: auto auto;
  align-items: start;
  gap: 20px 24px;
  min-height: 420px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
}
.exam-page .task-statement,
.exam-page .code-task.has-image .task-statement {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: block;
  min-width: 0;
  padding: 26px;
  background: white;
  border-radius: 12px;
}
.exam-page .task-copy .eyebrow {
  color: #697281;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 16px;
}
.exam-page .task-copy h2,
.exam-page .code-task .task-copy h2 {
  font-size: 21px;
  line-height: 1.45;
  letter-spacing: -0.3px;
  font-weight: 600;
  margin-bottom: 18px;
}
.exam-page #task-help {
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}
.exam-page #task-image:not(:empty) {
  margin-top: 24px;
}
.exam-page #task-image .question-image {
  width: 100%;
  margin-bottom: 14px;
  padding: 8px;
  border: 1px solid #ebe8f1;
  border-radius: 8px;
  background: #faf9fc;
}
.exam-page #task-image .question-image:last-child {
  margin-bottom: 0;
}
.exam-page #task-image .question-image img {
  height: 190px;
}
.exam-page .task-response {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}
.exam-page #task-body {
  gap: 14px;
}
.exam-page #task-body:empty {
  display: none;
}
.exam-page .answer-option {
  padding: 20px 22px;
  min-height: 66px;
  border: 1px solid #e6e3ec;
  border-radius: 10px;
  background: white;
  font-size: 16px;
  box-shadow: none;
}
.exam-page .answer-option:hover {
  border-color: #b097d3;
  background: #fcfaff;
}
.exam-page .answer-option:has(input:checked) {
  background: #eee5fa;
  border-color: #9770cd;
  box-shadow: none;
}
.exam-page .answer-option input {
  width: 21px;
  height: 21px;
}
.exam-page #task-body > input {
  min-height: 62px;
  background: white;
  padding: 18px 22px;
  border-radius: 10px;
  font-size: 17px;
}
.exam-page .match-row {
  background: white;
  border-radius: 10px;
  border-color: #e6e3ec;
  padding: 18px 20px;
}
.exam-page .task-controls {
  grid-column: 2;
  grid-row: 2;
  border: 0;
  margin: 0;
  padding: 4px 0 0;
  align-self: start;
}
.exam-page #save-error {
  grid-column: 2;
  margin: 0;
}
.exam-page .python-workspace {
  margin: 0;
  padding: 24px;
  border: 0;
  border-radius: 12px;
  background: white;
}
.exam-page .python-heading h3 {
  font-size: 17px;
}
.exam-page .python-hint {
  font-size: 12px;
  margin-bottom: 20px;
}
.exam-page .python-actions {
  gap: 8px;
}
.exam-page .python-actions .button {
  padding: 9px 12px;
  min-height: 38px;
  font-size: 12px;
}
.exam-page .python-pane-label {
  background: #f5f4f8;
  color: var(--ink);
}
.exam-page .python-grid > div {
  border-radius: 9px;
  border-color: #e5e2eb;
}
.exam-page .python-result {
  background: #fcfbfd;
}
.exam-page footer {
  border: 0;
}

@media (max-width: 1100px) {
  .exam-top {
    grid-template-columns: minmax(190px, 1fr) minmax(0, 1.5fr) auto;
    gap: 16px;
    padding-inline: 24px;
  }
  .exam-page .task-panel {
    grid-template-columns: minmax(230px, 0.8fr) minmax(0, 1.6fr);
    gap: 18px;
  }
  .exam-page .task-statement,
  .exam-page .code-task.has-image .task-statement {
    padding: 22px;
  }
  .exam-page .task-copy h2,
  .exam-page .code-task .task-copy h2 {
    font-size: 19px;
  }
  .exam-page .python-workspace {
    padding: 20px;
  }
}
@media (max-width: 900px) {
  .exam-top {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    padding: 14px 24px;
  }
  .exam-top .question-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }
  .exam-top .timer-box {
    grid-column: 2;
    grid-row: 1;
  }
  .exam-page .exam-main {
    padding: 20px 24px 40px;
  }
  .exam-page .task-panel {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .exam-page .task-statement,
  .exam-page .code-task.has-image .task-statement {
    grid-column: 1;
    grid-row: 1;
  }
  .exam-page .task-panel.has-image .task-statement {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 24px;
  }
  .exam-page .task-panel.has-image #task-image {
    margin-top: 0;
  }
  .exam-page .task-response {
    grid-column: 1;
    grid-row: 2;
  }
  .exam-page .task-controls {
    grid-column: 1;
    grid-row: 3;
  }
  .exam-page #save-error {
    grid-column: 1;
  }
}
@media (max-width: 740px) {
  .public-header {
    height: 72px;
  }
  .public-header .brand {
    width: 145px;
  }
  .home-page .main {
    padding-top: 20px;
  }
  .olympiad-hero {
    grid-template-columns: 1fr;
    padding: 28px;
    gap: 16px;
    border-radius: 18px;
  }
  .olympiad-hero h1 {
    font-size: 42px;
    letter-spacing: -1.5px;
  }
  .hero-subjects {
    font-size: 11px;
  }
  .hero-description {
    font-size: 13px;
  }
  .hero-illustration {
    max-width: 210px;
    max-height: 145px;
  }
  .class-selection {
    margin-top: 28px;
  }
  .selection-heading h2 {
    font-size: 22px;
  }
  .class-card {
    padding: 20px 10px 14px;
  }
  .class-card-top {
    margin-bottom: 18px;
  }
  .class-card-number {
    width: 78px;
    height: 78px;
    font-size: 38px;
  }
  .class-card-number small {
    font-size: 10px;
  }
  .class-card h3 {
    font-size: 14px;
    min-height: 40px;
  }
  .class-card-meta {
    font-size: 11px;
  }
  .class-card-action {
    font-size: 12px;
  }
  .registration-note {
    font-size: 11px;
  }
  .registration-aside h1 {
    font-size: 27px;
  }
  .exam-top {
    padding: 12px 18px;
    gap: 12px;
  }
  .exam-identity {
    gap: 10px;
  }
  .exam-identity h1 {
    font-size: 13px;
  }
  .exam-identity span {
    font-size: 10px;
  }
  .exam-back {
    width: 32px;
    height: 32px;
  }
  .exam-top .timer-box {
    min-width: 80px;
    padding-left: 0;
  }
  .exam-top .timer-box strong {
    font-size: 22px;
  }
  .exam-top .question-nav {
    gap: 8px;
  }
  .exam-top .question-nav button {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }
  .exam-page .exam-main {
    padding: 18px 20px 36px;
  }
  .exam-overview {
    margin-bottom: 18px;
  }
  .exam-overview p {
    font-size: 11px;
  }
  .exam-page .task-statement,
  .exam-page .code-task.has-image .task-statement {
    padding: 22px;
  }
  .exam-page .task-panel.has-image .task-statement {
    display: block;
  }
  .exam-page .task-panel.has-image #task-image {
    margin-top: 20px;
  }
  .exam-page #task-image .question-image {
    max-width: 320px;
  }
  .exam-page #task-image .question-image img {
    height: 165px;
  }
  .exam-page .task-copy h2,
  .exam-page .code-task .task-copy h2 {
    font-size: 20px;
  }
  .exam-page .answer-option {
    padding: 17px;
    font-size: 16px;
    min-height: 60px;
  }
  .exam-page .python-workspace {
    padding: 18px;
  }
  .exam-page .python-actions .button {
    min-height: 42px;
  }
  .exam-page .task-controls {
    gap: 10px;
  }
  .exam-page .task-controls .button {
    font-size: 13px;
    padding: 11px 15px;
  }
}
@media (max-width: 359px) {
  .olympiad-hero {
    padding: 24px;
  }
  .olympiad-hero h1 {
    font-size: 36px;
  }
  .class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .class-card {
    padding-inline: 6px;
  }
  .class-card h3 {
    font-size: 12px;
    min-height: 38px;
  }
  .class-card-number {
    width: 70px;
    height: 70px;
    font-size: 34px;
  }
  .class-card-meta {
    font-size: 10px;
  }
  .exam-page .exam-main {
    padding-inline: 14px;
  }
  .exam-top {
    padding-inline: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .class-card {
    transition: none;
  }
}

/* Participant refinements: balanced navigation and direct visual matching. */
.exam-top {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}
.exam-top .question-nav {
  max-width: 48vw;
}
.exam-top .timer-box {
  justify-self: end;
}
.exam-top .question-nav button {
  width: 46px;
  height: 46px;
  font-size: 22px;
}
.prepare .duration {
  display: block;
  padding: 28px 20px;
  text-align: center;
}
.prepare .duration strong {
  display: block;
  font: inherit;
  font-size: clamp(25px, 3.2vw, 38px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}
.olympiad-hero h1 {
  font-size: clamp(34px, 3.7vw, 50px);
  max-width: 640px;
}
.olympiad-hero {
  animation: hero-arrive 650ms ease-out both;
}
.hero-illustration {
  animation: hero-float 4s 650ms ease-in-out 1;
}
@keyframes hero-arrive {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes hero-float {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-7px) rotate(-1deg);
  }
}

.matching-workspace {
  background: white;
  border-radius: 14px;
  padding: 26px 22px 18px;
}
.matching-board {
  user-select: none;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(70px, 12vw, 170px) minmax(0, 1fr);
  align-items: start;
}
.matching-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.matching-left {
  grid-column: 1;
}
.matching-right {
  grid-column: 3;
}
.match-node {
  --match-color: #b5bdca;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  text-align: center;
}
.match-label {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  align-self: stretch;
  padding: 15px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #f2f3f6;
  font-size: 19px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.match-dot {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border: 2px solid #b5bdca;
  border-radius: 50%;
  background: white;
  transition:
    background-color 0.15s,
    box-shadow 0.15s;
}
.matching-right .match-dot {
  order: -1;
}
.match-node:hover .match-label {
  background: #eaeaf1;
}
.match-node.connected .match-dot,
.match-node.selected .match-dot {
  background: var(--match-color);
  border-color: var(--match-color);
}
.match-node.selected .match-dot {
  box-shadow: 0 0 0 5px #efe8fa;
}
.match-node.selected .match-label {
  border-color: var(--match-color);
  background: #f8f5fc;
}
.match-node:focus-visible {
  outline: 2px solid #763dca;
  outline-offset: 5px;
}
.match-node[data-color="0"] {
  --match-color: #8150d5;
}
.match-node[data-color="1"] {
  --match-color: #e1a91a;
}
.match-node[data-color="2"] {
  --match-color: #31a8c1;
}
.match-node[data-color="3"] {
  --match-color: #e16c87;
}
.match-node[data-color="4"] {
  --match-color: #48a47b;
}
.match-node[data-color="5"] {
  --match-color: #577ad4;
}
.matching-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}
.matching-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
}
.matching-status {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.matching-clear {
  font-size: 12px;
  white-space: nowrap;
}
.matching-clear:disabled {
  opacity: 0.4;
  cursor: default;
}
.registration-documents {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  margin: 16px 0;
}
@media (max-width: 1100px) and (min-width: 901px) {
  .matching-workspace {
    padding: 20px 14px 16px;
  }
  .matching-board {
    grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  }
  .match-label {
    font-size: 17px;
    padding: 12px 8px;
  }
  .match-node {
    gap: 8px;
  }
}
@media (max-width: 900px) {
  .exam-top {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .exam-top .question-nav {
    max-width: 100%;
    justify-content: center;
  }
}
@media (max-width: 740px) {
  .exam-top .question-nav button {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }
  .olympiad-hero h1 {
    font-size: clamp(30px, 7.6vw, 42px);
    letter-spacing: -1px;
  }
  .matching-workspace {
    padding: 20px 10px 16px;
  }
  .matching-board {
    grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  }
  .matching-column {
    gap: 18px;
  }
  .match-node {
    gap: 6px;
    min-height: 64px;
  }
  .match-label {
    font-size: 15px;
    padding: 12px 6px;
    border-radius: 8px;
  }
  .match-dot {
    flex-basis: 18px;
    width: 18px;
    height: 18px;
  }
  .matching-tools {
    align-items: start;
    margin-top: 22px;
  }
  .matching-status {
    font-size: 11px;
  }
  .matching-clear {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .olympiad-hero,
  .hero-illustration {
    animation: none;
  }
  .match-dot {
    transition: none;
  }
}
