@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;500;600;700;800&display=swap");

:root {
  --color-purple: #6457a5;
  --color-lilac: #e6e5f3;
  --color-blue: #bee6fa;
  --color-green: #c6de8a;
  --color-rose: #c78d9f;
  --color-pink: #fcd4d2;
  --color-orange: #f79665;
  --color-yellow: #fcf49d;
  --color-ink: #332f50;
  --color-ink-soft: #5b5482;
  --color-surface: #ffffff;
  --color-surface-soft: #f8f7fc;
  --color-border: rgba(100, 87, 165, 0.22);
  --color-shadow: rgba(100, 87, 165, 0.16);
  --font-display: "Bricolage Grotesque", Arial, sans-serif;
  --font-body: Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--color-ink);
  background: var(--color-surface-soft);
  font-family: var(--font-body);
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--color-purple);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.academy-quiz {
  width: 100%;
  padding: 28px 0;
  background:
    linear-gradient(90deg, var(--color-green) 0 16%, var(--color-blue) 16% 32%, var(--color-pink) 32% 48%, var(--color-yellow) 48% 64%, var(--color-orange) 64% 80%, var(--color-rose) 80% 100%) top left / 100% 7px no-repeat,
    transparent;
}

.quiz-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(520px, 1.28fr);
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-lilac);
  box-shadow: 0 18px 42px var(--color-shadow);
}

.quiz-intro {
  display: flex;
  min-height: 430px;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 46%),
    var(--color-lilac);
}

.quiz-intro h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 2.4vw, 2.35rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0;
}

.quiz-intro p {
  max-width: 34rem;
  margin: 0;
  color: rgba(51, 47, 80, 0.78);
  font-size: 0.95rem;
}

.quiz-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.quiz-highlights span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--color-ink-soft);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
}

.quiz-panel {
  display: grid;
  min-height: 430px;
  align-content: stretch;
  border-left: 1px solid var(--color-border);
  padding: 28px;
  background: rgba(255, 255, 255, 0.86);
}

.quiz-progress {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.quiz-progress__label {
  color: var(--color-ink-soft);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
}

.quiz-progress__track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(100, 87, 165, 0.13);
}

.quiz-progress__bar {
  display: block;
  width: 12.5%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-purple), var(--color-rose));
  transition: width 220ms ease;
}

.quiz-form {
  display: grid;
  min-height: 338px;
  grid-template-rows: 1fr auto;
}

.quiz-step {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.quiz-step legend,
.result-panel h3 {
  margin: 0 0 10px;
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.8vw, 1.65rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0;
}

.question-help,
#result-copy {
  margin: 0 0 18px;
  color: rgba(51, 47, 80, 0.76);
  font-size: 0.94rem;
}

.answer-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.answer-option {
  position: relative;
}

.answer-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.answer-option label {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  min-height: 104px;
  align-items: start;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 13px;
  background: var(--color-surface);
  color: var(--color-ink);
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.answer-option label::before {
  content: "";
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border: 2px solid rgba(100, 87, 165, 0.35);
  border-radius: 50%;
  background: #ffffff;
}

.answer-option strong {
  display: block;
  margin-bottom: 3px;
  font-family: var(--font-display);
  font-size: 0.92rem;
  line-height: 1.25;
}

.answer-option span {
  display: block;
  color: rgba(51, 47, 80, 0.7);
  font-size: 0.84rem;
  line-height: 1.4;
}

.answer-option input:focus-visible + label {
  outline: 3px solid rgba(100, 87, 165, 0.24);
  outline-offset: 3px;
}

.answer-option input:hover + label,
.answer-option input:checked + label {
  border-color: rgba(100, 87, 165, 0.72);
  box-shadow: 0 12px 28px rgba(100, 87, 165, 0.12);
  transform: translateY(-1px);
}

.answer-option input:checked + label::before {
  border: 6px solid var(--color-purple);
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-top: 22px;
}

.quiz-actions--result {
  justify-content: flex-start;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 18px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 800;
  text-decoration: none;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible {
  outline: 3px solid rgba(100, 87, 165, 0.24);
  outline-offset: 3px;
}

.button--primary {
  background: var(--color-purple);
  color: #ffffff;
}

.button--primary:hover {
  background: #51468d;
}

.button--ghost {
  border-color: var(--color-border);
  background: #ffffff;
  color: var(--color-ink);
}

.button--ghost:hover {
  border-color: rgba(100, 87, 165, 0.34);
  background: var(--color-surface-soft);
}

.button[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.result-meta,
.result-reasoning {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
}

.result-meta span,
.result-reasoning p {
  margin: 0;
  border-left: 4px solid var(--color-purple);
  border-radius: 6px;
  padding: 10px 12px;
  background: #ffffff;
  color: rgba(51, 47, 80, 0.78);
  font-size: 0.88rem;
}

@media (max-width: 860px) {
  .academy-quiz {
    padding: 16px 0;
  }

  .quiz-shell {
    width: min(100% - 28px, 680px);
    grid-template-columns: 1fr;
  }

  .quiz-intro,
  .quiz-panel {
    padding: 18px;
  }

  .quiz-intro,
  .quiz-panel {
    min-height: auto;
  }

  .quiz-panel {
    border-left: 0;
    border-top: 1px solid var(--color-border);
  }

  .quiz-form {
    min-height: 0;
  }

  .answer-list,
  .result-meta,
  .result-reasoning {
    grid-template-columns: 1fr;
  }

  .answer-option label {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .academy-quiz {
    padding: 8px 0;
  }

  .quiz-shell {
    width: min(100% - 16px, 480px);
    box-shadow: 0 10px 24px rgba(100, 87, 165, 0.12);
  }

  .quiz-intro {
    padding: 14px 14px 12px;
  }

  .quiz-panel {
    padding: 14px;
  }

  .quiz-intro h2 {
    margin-bottom: 8px;
    font-size: 1.38rem;
  }

  .quiz-intro p {
    font-size: 0.86rem;
    line-height: 1.38;
  }

  .quiz-highlights {
    display: none;
  }

  .quiz-progress {
    gap: 7px;
    margin-bottom: 12px;
  }

  .quiz-progress__label {
    font-size: 0.8rem;
  }

  .quiz-progress__track {
    height: 6px;
  }

  .quiz-step legend,
  .result-panel h3 {
    margin-bottom: 7px;
    font-size: 1.12rem;
    line-height: 1.12;
  }

  .question-help,
  #result-copy {
    margin-bottom: 12px;
    font-size: 0.84rem;
    line-height: 1.38;
  }

  .answer-list {
    gap: 7px;
  }

  .answer-option label {
    grid-template-columns: 18px 1fr;
    gap: 9px;
    padding: 10px;
  }

  .answer-option label::before {
    width: 17px;
    height: 17px;
    margin-top: 1px;
  }

  .answer-option input:checked + label::before {
    border-width: 5px;
  }

  .answer-option strong {
    margin-bottom: 0;
    font-size: 0.86rem;
    line-height: 1.18;
  }

  .answer-option span span {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-3px);
    transition: max-height 220ms ease, margin-top 220ms ease, opacity 180ms ease, transform 220ms ease;
  }

  .answer-option input:checked + label span span {
    max-height: 90px;
    margin-top: 5px;
    opacity: 1;
    transform: translateY(0);
  }

  .quiz-actions {
    display: grid;
    gap: 8px;
    margin-top: 14px;
  }

  .button {
    width: 100%;
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.9rem;
  }

  .result-meta,
  .result-reasoning {
    gap: 7px;
    margin-top: 10px;
  }

  .result-meta span,
  .result-reasoning p {
    padding: 8px 10px;
    font-size: 0.82rem;
    line-height: 1.35;
  }
}

@media (max-width: 520px) and (max-height: 720px) {
  .quiz-intro {
    padding-bottom: 10px;
  }

  .quiz-intro p {
    display: none;
  }

  .quiz-intro h2 {
    margin-bottom: 0;
    font-size: 1.22rem;
  }

  .question-help {
    display: none;
  }
}

@media (max-width: 520px) and (prefers-reduced-motion: reduce) {
  .answer-option span span {
    transition: none;
    transform: none;
  }
}
