:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f3ee;
  color: #1f2729;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f5f3ee;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 24px;
  border-bottom: 1px solid #d7d4cd;
  background: #fff;
}

.brand {
  font-size: 15px;
  font-weight: 760;
}

.topbar-actions,
.language-control {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 18px;
}

.language-control {
  gap: 7px;
  margin: 0;
  color: #52706c;
  font-size: 12px;
  font-weight: 760;
}

.language-control select {
  min-height: 34px;
  width: auto;
  padding: 0 26px 0 9px;
  border-radius: 5px;
  font-size: 13px;
}

.secure-label,
.eyebrow {
  color: #52706c;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.shell {
  width: min(max(960px, calc(100% - 32px)), 1720px);
  margin: 0 auto;
  min-height: calc(100vh - 58px);
  padding: 28px 0 40px;
  display: flex;
  justify-content: center;
}

.view {
  width: 100%;
}

.view:not(.exam-view) {
  width: min(100%, 860px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.exam-view {
  width: min(100%, 1400px);
}

.view:not(.exam-view) > * {
  width: min(100%, 860px);
}

.view:not(.exam-view) .form-stack,
.view:not(.exam-view) .instructions,
.view:not(.exam-view) .demo-card,
.view:not(.exam-view) .message {
  width: min(100%, 620px);
  text-align: left;
}

.view:not(.exam-view) .start-button {
  margin-inline: auto;
}

.hidden {
  display: none !important;
}

h1 {
  margin: 8px 0 28px;
  color: #152326;
  font-size: clamp(34px, 8vw, 54px);
  line-height: 1.05;
  letter-spacing: 0;
}

.form-stack {
  display: grid;
  gap: 10px;
  max-width: 620px;
}

.form-section {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #d7d4cd;
  border-radius: 8px;
  background: #fff;
}

.form-section-title {
  margin: 0;
  color: #52706c;
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.field-grid {
  display: grid;
  gap: 12px;
}

.field-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

label {
  margin-top: 8px;
  color: #37494c;
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #b9bfbb;
  border-radius: 6px;
  background: #fff;
  color: #1f2729;
  font: inherit;
  padding: 0 12px;
}

input:focus,
select:focus {
  border-color: #24736c;
  outline: 3px solid #bce1d8;
}

button {
  cursor: pointer;
  font: inherit;
}

.primary,
.start-button {
  border: 1px solid #1d625d;
  border-radius: 6px;
  background: #246f69;
  color: #fff;
  font-weight: 760;
}

.primary {
  min-height: 46px;
  margin-top: 16px;
  padding: 0 18px;
}

.start-button {
  min-width: 170px;
  min-height: 58px;
  margin-top: 28px;
  padding: 0 28px;
  font-size: 20px;
}

.primary:hover,
.start-button:hover {
  background: #17544f;
}

.primary:disabled,
.start-button:disabled {
  cursor: default;
  opacity: 0.45;
  background: #7ca7a1;
  border-color: #7ca7a1;
}

.instructions {
  max-width: 620px;
  color: #445255;
  font-size: 17px;
  line-height: 1.65;
}

.intro-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: end;
  gap: 24px;
}

.seal-panel {
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.seal {
  width: 100%;
  max-width: 220px;
  height: auto;
}

.seal-bob {
  transform-origin: 50% 80%;
  animation: seal-bob 2.6s ease-in-out infinite;
}

.seal-professor .seal-bob {
  animation-duration: 2s;
}

.choice.selected {
  border-color: #1d625d;
  background: #d9eee9;
  box-shadow: inset 0 0 0 3px #bce1d8;
}

.message {
  max-width: 620px;
  margin-top: 18px;
  color: #8a471f;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.message a {
  color: #126a63;
}

.exam-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 20px;
  padding-top: 20px;
  align-items: start;
}

.exam-main {
  width: min(100%, 920px);
  min-width: 0;
}

.exam-view.exam-debug-enabled {
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr) minmax(0, 1fr);
  justify-items: stretch;
}

.exam-view.exam-debug-enabled .exam-main {
  width: 100%;
}

.debug-panel {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #20373a;
  border-radius: 8px;
  background: #0f1719;
  color: #d7ebe8;
}

.exam-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #d7d4cd;
  padding-bottom: 16px;
}

.countdown {
  min-width: 54px;
  color: #a24724;
  font-size: clamp(40px, 5vw, 54px);
  font-variant-numeric: tabular-nums;
  font-weight: 780;
  text-align: right;
}

.countdown.hidden-countdown {
  visibility: hidden;
}

.audio-state {
  min-height: 72px;
  padding-top: 28px;
  color: #445255;
  font-size: 15px;
  font-weight: 700;
}

.choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 32px;
}

.choice {
  aspect-ratio: 1;
  border: 2px solid #aab4b1;
  border-radius: 8px;
  background: #fff;
  color: #253a3d;
  font-size: clamp(52px, 14vw, 88px);
  font-weight: 800;
}

.choice:not(:disabled):hover,
.choice:not(:disabled):focus {
  border-color: #1d625d;
  background: #d9eee9;
  outline: 4px solid #bce1d8;
}

.choice:disabled {
  cursor: default;
  opacity: 0.5;
}

.skip-button {
  min-height: 46px;
  margin-top: 18px;
  padding: 0 18px;
  border: 1px solid #9aa6a3;
  border-radius: 6px;
  background: #fff;
  color: #314244;
  font-weight: 700;
}

.skip-button:not(:disabled):hover,
.skip-button:not(:disabled):focus {
  border-color: #1d625d;
  background: #d9eee9;
  outline: 4px solid #bce1d8;
}

.skip-button:disabled {
  cursor: default;
  opacity: 0.5;
}

.result-shell {
  width: min(680px, calc(100% - 32px));
  margin: 0 auto;
  padding: 90px 0;
}

.result-line {
  color: #2d4447;
  font-size: 22px;
  font-weight: 720;
}

.muted {
  margin-top: 34px;
  color: #697577;
  font-size: 14px;
  line-height: 1.6;
}

@keyframes seal-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(-2deg); }
}

@media (max-width: 520px) {
  .topbar {
    padding: 0 16px;
  }

  .secure-label {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
  }

  .shell {
    min-height: calc(100vh - 58px);
    padding: 24px 0 32px;
  }

  .intro-panel {
    grid-template-columns: 1fr;
  }

  .choices {
    gap: 10px;
  }

  .exam-view {
    grid-template-columns: 1fr;
  }
}


.demo-card {
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid #d7d4cd;
  border-radius: 8px;
  background: #fff;
}

.demo-card .message {
  min-height: 22px;
  margin: 8px 0 12px;
}

.secondary {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #1d625d;
  border-radius: 6px;
  background: #fff;
  color: #1d625d;
  font-weight: 760;
}

.demo-choices {
  max-width: 420px;
  margin-top: 16px;
}

.demo-review {
  max-width: 620px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #d7d4cd;
  border-radius: 8px;
  background: #fcfbf8;
}

.demo-review-line {
  margin: 8px 0 0;
  color: #314244;
  font-size: 14px;
  line-height: 1.55;
}

#exam-purpose-other-wrap {
  display: grid;
  gap: 10px;
}

#exam-purpose-other-wrap.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .field-grid-3,
  .field-grid-4 {
    grid-template-columns: 1fr;
  }
}

.debug-panel.hidden {
  display: none !important;
}

.debug-console-header {
  color: #78d7cb;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.02em;
}

.debug-console-scroll {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding-right: 4px;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.debug-card {
  border: 1px solid #284246;
  border-radius: 8px;
  padding: 10px 12px;
  background: #0d1416;
}

.debug-card-current {
  border-color: #2f6d64;
}

.debug-row {
  margin: 4px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.debug-label {
  color: #78d7cb;
  font-weight: 700;
}

.debug-choice {
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid #24393d;
  border-radius: 6px;
  background: #0b1113;
}

.debug-choice.correct {
  border-color: #2f7d68;
  color: #b5f1df;
}

.debug-choice.incorrect {
  border-color: #9b4a31;
  color: #ffd9c7;
}

.debug-choice.selected {
  background: #132226;
  border-color: #cfb46d;
}


.checkbox-group {
  display: grid;
  gap: 10px;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin: 0;
  padding: 0 2px;
  color: #314244;
  font-size: 14px;
  font-weight: 600;
}

.checkbox-option input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
}

.result-shell {
  position: relative;
  width: min(100%, 1880px);
  max-width: none;
  margin: 0 auto;
  padding: 72px clamp(24px, 5vw, 80px) 120px;
}

.result-layout {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: none;
  margin: 0;
}

.result-main-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.result-block-full {
  grid-column: 1 / -1;
}

.result-title {
  margin: 12px 0 10px;
  color: #223338;
  font-size: 18px;
  font-weight: 760;
}

.result-caption {
  margin: 0;
  color: #445255;
  font-size: 15px;
  font-weight: 700;
}

.result-candidates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.result-main-grid > .result-section {
  grid-column: span 1;
}

.result-candidate,
.result-stat,
.result-section,
.result-action-card,
.result-dev-chart,
.result-dev-table {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #d7d4cd;
  border-radius: 8px;
  background: #fff;
}

.result-candidate-level {
  display: block;
  color: #223338;
  font-size: 18px;
  font-weight: 800;
}

.result-candidate-label {
  display: block;
  margin-top: 8px;
  color: #52706c;
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.result-candidate-score {
  display: block;
  margin-top: 8px;
  color: #20373a;
  font-size: 20px;
  font-weight: 780;
}

.result-candidate-meta {
  margin-top: 8px;
  color: #445255;
  font-size: 12px;
  line-height: 1.4;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.result-dev-chart,
.result-dev-table {
  grid-column: 1 / -1;
}

.result-stat-label,
.result-section-label,
.result-dev-chart-title,
.result-dev-table-title {
  color: #52706c;
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.result-stat-value {
  display: block;
  margin-top: 8px;
  color: #20373a;
  font-size: 24px;
  font-weight: 780;
}

.result-section-copy {
  margin: 8px 0 0;
  color: #223338;
  line-height: 1.6;
}

.result-dev-chart-title,
.result-dev-table-title {
  margin-bottom: 10px;
}

.result-dev-chart-svg {
  display: block;
  width: 100%;
  height: auto;
}

.result-dev-table-scroll {
  overflow: auto;
  max-height: 360px;
}

.result-dev-table-grid {
  width: 100%;
  min-width: 1380px;
  border-collapse: collapse;
}

.result-dev-table-grid th,
.result-dev-table-grid td {
  padding: 8px 10px;
  border-bottom: 1px solid #e7e3dc;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  font-size: 12px;
}

.result-dev-table-grid th {
  position: sticky;
  top: 0;
  background: #fcfbf8;
  color: #52706c;
  font-weight: 760;
  text-transform: uppercase;
}

.result-dev-question {
  max-width: 280px;
  white-space: normal;
  word-break: break-word;
}

.copy-button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #1d625d;
  border-radius: 6px;
  background: #246f69;
  color: #fff;
  font-weight: 760;
}

.copy-status {
  display: inline-block;
  color: #52706c;
  font-size: 13px;
  font-weight: 700;
}

.result-action-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.result-action-card {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
}

.result-action-card-inactive {
  border-color: #d7d4cd;
  background: #f4f1eb;
}

.result-action-copy {
  margin: 0;
  color: #223338;
  line-height: 1.6;
}

.result-action-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.result-retake-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  text-decoration: none;
}

.result-inactive-button {
  border-color: #c7c3bc;
  background: #d8d4cd;
  color: #7a756d;
  pointer-events: none;
}

.result-inactive-button:hover {
  background: #d8d4cd;
}

.result-seal-dock {
  position: fixed;
  right: 24px;
  bottom: 18px;
  width: 190px;
  height: 180px;
  pointer-events: none;
  opacity: 0.92;
}

.result-seal-svg {
  width: 100%;
  height: 100%;
}

.seal-float {
  transform-origin: 50% 75%;
  animation: seal-float 2.8s ease-in-out infinite;
}

.seal-sparkle {
  animation: seal-sparkle 1.8s ease-in-out infinite;
}

.seal-face {
  transform-origin: 50% 52%;
  animation: seal-face 3s ease-in-out infinite;
}

@keyframes seal-float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(-1.8deg);
  }
}

@keyframes seal-sparkle {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

@keyframes seal-face {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(1px);
  }
}

@media (max-width: 820px) {
  .result-shell {
    padding: 48px 16px 88px;
  }

  .result-main-grid,
  .result-stats,
  .result-candidates,
  .result-action-cards {
    grid-template-columns: 1fr;
  }

  .result-main-grid > .result-section {
    grid-column: 1 / -1;
  }

  .result-seal-dock {
    right: 12px;
    bottom: 12px;
    width: 140px;
    height: 132px;
  }
}
