:root {
  --bg: #08090b;
  --panel: #121318;
  --panel-2: #181a20;
  --text: #f5f6f7;
  --muted: #a8abb3;
  --silver: #d9dce2;
  --silver-dark: #8b909a;
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.28);
  --success: #dce9df;
  --warning: #f3d7a4;
  --danger: #f2aaa8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 255, 255, 0.07), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.test-header {
  min-height: 70px;
  padding: 12px clamp(18px, 4vw, 54px);
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 11, 0.94);
  backdrop-filter: blur(18px);
}

.test-logo {
  width: fit-content;
  font-family: "Manrope", sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.07em;
  background: linear-gradient(110deg, #74777e, #fff 25%, #9ca1aa 48%, #f8f8f8 67%, #777c84);
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}

.module-status {
  text-align: center;
}

.module-status span,
.module-status strong {
  display: block;
}

.module-status span {
  color: var(--muted);
  font-size: 12px;
}

.module-status strong {
  font-family: "Manrope", sans-serif;
  font-size: 16px;
}

.timer-wrap {
  justify-self: end;
  text-align: right;
}

.timer-wrap span,
.timer-wrap strong {
  display: block;
}

.timer-wrap span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.timer-wrap strong {
  font-family: "Manrope", sans-serif;
  font-size: 23px;
  letter-spacing: -0.03em;
}

.timer-wrap.warning strong {
  color: var(--warning);
}

.timer-wrap.danger strong {
  color: var(--danger);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.welcome-shell,
.results-shell {
  width: min(1180px, calc(100% - 34px));
  margin: 0 auto;
  padding: 72px 0 90px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 30px;
  align-items: start;
}

.eyebrow {
  color: var(--silver);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.welcome-copy h1,
.transition-card h1,
.results-main > h1 {
  margin-top: 10px;
  font-family: "Manrope", sans-serif;
  font-size: clamp(46px, 7vw, 80px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.lead {
  max-width: 720px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 19px;
}

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

.test-summary article {
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
}

.test-summary strong,
.test-summary span {
  display: block;
}

.test-summary strong {
  font-family: "Manrope", sans-serif;
  font-size: 23px;
}

.test-summary span {
  color: var(--muted);
  font-size: 13px;
}

.instructions {
  margin-top: 36px;
}

.instructions h2,
.start-card h2 {
  font-family: "Manrope", sans-serif;
  font-size: 23px;
}

.instructions ul,
.placement-list {
  margin-top: 13px;
  padding-left: 20px;
  color: #c8cad0;
  display: grid;
  gap: 9px;
}

.start-card,
.results-main,
.review-panel {
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    var(--panel);
}

.start-card label:not(.check-row) {
  margin-top: 20px;
  display: block;
  color: #d6d8dd;
  font-size: 13px;
  font-weight: 700;
}

.start-card input[type="text"],
.start-card input[type="email"] {
  width: 100%;
  min-height: 50px;
  margin-top: 7px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: rgba(0, 0, 0, 0.26);
  color: var(--text);
}

.start-card input:focus {
  border-color: var(--line-strong);
}

.check-row {
  margin: 20px 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #c8cad0;
  font-size: 13px;
}

.check-row input {
  margin-top: 3px;
}

.demo-note {
  margin: 18px 0;
  padding: 12px 14px;
  border-left: 2px solid var(--silver);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
}

.primary-button,
.secondary-button,
.submit-module-button,
.text-button {
  cursor: pointer;
}

.primary-button,
.secondary-button,
.submit-module-button {
  min-height: 48px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 160ms ease, border-color 160ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.submit-module-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, #fafafa, #9da2ab);
  color: #08090b;
}

.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.start-card .primary-button {
  width: 100%;
}

.error-message,
.submission-status {
  min-height: 22px;
  margin-top: 10px;
  color: var(--danger);
  font-size: 13px;
}

.test-layout {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

.question-panel,
.navigator-panel {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
}

.question-toolbar {
  min-height: 66px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.question-toolbar > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.question-count {
  font-weight: 800;
}

.skill-chip {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.review-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.question-content {
  min-height: 520px;
  padding: clamp(24px, 5vw, 54px);
}

.passage {
  max-width: 880px;
  color: #dadce0;
  font-size: 17px;
  line-height: 1.75;
}

.passage:empty {
  display: none;
}

.passage p + p {
  margin-top: 14px;
}

.question-content h2 {
  max-width: 900px;
  margin-top: 26px;
  font-family: "Manrope", sans-serif;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.answers {
  margin-top: 27px;
  display: grid;
  gap: 11px;
}

.answer-option {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 11px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.answer-option:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
}

.answer-option.selected {
  border-color: #f1f2f4;
  background: rgba(255, 255, 255, 0.09);
}

.answer-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-letter {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-weight: 800;
}

.answer-option.selected .choice-letter {
  background: #f4f5f6;
  color: #08090b;
}

.answer-text {
  color: #e2e3e7;
}

.question-footer {
  padding: 15px 18px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.question-footer button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

.navigator-panel {
  position: sticky;
  top: 94px;
  padding: 20px;
}

.navigator-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navigator-top h2 {
  font-family: "Manrope", sans-serif;
  font-size: 20px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--silver);
  font-size: 12px;
  font-weight: 700;
}

.question-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.question-nav-button {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.question-nav-button.answered {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.question-nav-button.review {
  box-shadow: inset 0 -3px 0 var(--warning);
}

.question-nav-button.current {
  border-color: #fff;
  color: #fff;
}

.legend {
  margin-top: 18px;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend i {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
}

.answered-dot {
  background: rgba(255, 255, 255, 0.6);
}

.review-dot {
  background: var(--warning);
}

.current-dot {
  border: 1px solid white;
}

.submit-module-button {
  width: 100%;
  margin-top: 20px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.transition-card {
  width: min(700px, calc(100% - 34px));
  margin: 0 auto;
  padding: 100px 0;
  text-align: center;
}

.transition-card p:not(.eyebrow) {
  max-width: 620px;
  margin: 22px auto 28px;
  color: var(--muted);
  font-size: 18px;
}

.break-timer {
  margin: 20px 0 28px;
  font-family: "Manrope", sans-serif;
  font-size: 70px;
  letter-spacing: -0.06em;
}

.total-score-card {
  margin-top: 28px;
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.045);
}

.total-score-card span,
.total-score-card strong,
.total-score-card p {
  display: block;
}

.total-score-card span {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.total-score-card strong {
  font-family: "Manrope", sans-serif;
  font-size: clamp(82px, 12vw, 128px);
  line-height: 1;
  letter-spacing: -0.08em;
  background: linear-gradient(135deg, #fff, #898e98);
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}

.total-score-card p {
  color: var(--muted);
}

.section-results {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.section-results article {
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.028);
}

.section-results span,
.section-results strong,
.section-results p {
  display: block;
}

.section-results span {
  color: var(--muted);
  font-size: 12px;
}

.section-results strong {
  font-family: "Manrope", sans-serif;
  font-size: 39px;
  letter-spacing: -0.04em;
}

.section-results p {
  color: var(--muted);
  font-size: 13px;
}

.recommendation {
  margin-top: 18px;
  padding: 21px;
  border-left: 2px solid var(--silver);
  background: rgba(255, 255, 255, 0.035);
}

.recommendation span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.recommendation h2 {
  margin-top: 5px;
  font-family: "Manrope", sans-serif;
  font-size: 34px;
}

.recommendation p {
  margin-top: 7px;
  color: var(--muted);
}

.result-actions {
  margin-top: 23px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.link-button {
  text-decoration: none;
}

.review-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.review-heading h2 {
  font-family: "Manrope", sans-serif;
}

.review-heading span {
  color: var(--muted);
  font-weight: 800;
}

.skill-summary {
  margin-top: 20px;
  display: grid;
  gap: 10px;
}

.skill-row {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.skill-row-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.skill-row-top span {
  color: #d7d9de;
  font-size: 13px;
}

.skill-row-top strong {
  color: var(--muted);
  font-size: 13px;
}

.skill-bar {
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.skill-bar div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #838892, #f7f7f7);
}

.answer-review {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.answer-review summary {
  cursor: pointer;
  font-weight: 800;
}

.review-item {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.review-item.correct {
  border-left: 3px solid var(--success);
}

.review-item.incorrect {
  border-left: 3px solid var(--danger);
}

.review-item h3 {
  font-size: 14px;
}

.review-item p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

dialog {
  width: min(600px, calc(100% - 30px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: var(--panel-2);
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

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

.dialog-head h2 {
  font-family: "Manrope", sans-serif;
}

.dialog-head button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}

.formula-grid {
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.formula-grid div {
  padding: 14px;
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.formula-grid span {
  color: var(--muted);
}

#confirmDialog > p {
  padding: 20px;
  color: var(--muted);
}

.dialog-actions {
  padding: 0 20px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 960px) {
  .welcome-shell,
  .results-shell {
    grid-template-columns: 1fr;
  }

  .test-layout {
    grid-template-columns: 1fr;
  }

  .navigator-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .test-header {
    padding: 10px 14px;
    grid-template-columns: auto 1fr auto;
  }

  .test-logo {
    font-size: 23px;
  }

  .module-status span {
    display: none;
  }

  .module-status strong {
    font-size: 13px;
  }

  .timer-wrap span {
    display: none;
  }

  .timer-wrap strong {
    font-size: 19px;
  }

  .welcome-shell,
  .results-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 45px;
  }

  .test-summary,
  .section-results {
    grid-template-columns: 1fr;
  }

  .question-toolbar {
    align-items: flex-start;
    gap: 12px;
  }

  .question-toolbar > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .review-toggle {
    white-space: nowrap;
  }

  .question-content {
    min-height: 440px;
    padding: 24px 18px;
  }

  .answer-option {
    grid-template-columns: 30px 1fr;
    padding: 12px;
  }

  .choice-letter {
    width: 29px;
    height: 29px;
  }

  .question-footer {
    gap: 9px;
  }

  .question-footer button {
    flex: 1;
  }

  .formula-grid {
    grid-template-columns: 1fr;
  }

  .result-actions > * {
    width: 100%;
  }
}
