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

:root {
  color-scheme: light;
  --ink: #31384a;
  --heading: #3d176f;
  --muted: #666666;
  --line: #d9dcea;
  --paper: #ffffff;
  --soft: #fbfaff;
  --accent: #3d176f;
  --lavender: #b6a7f5;
  --lavender-soft: #f1edff;
  --blue: #3f6df6;
  --shadow: 0 14px 32px rgba(61, 23, 111, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--lavender);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

button,
.button {
  position: relative;
  --button-base: var(--accent);
  --button-fill: #6f54b8;
  z-index: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 12px 28px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  background-color: var(--button-base);
  transition:
    color 0.18s ease;
}

button:not(.choice)::before,
.button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--button-fill);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease;
}

button,
.button {
  isolation: isolate;
}

button:not(:disabled):hover,
.button:hover {
  color: #fff;
}

button:not(.choice):not(:disabled):hover::before,
.button:hover::before {
  transform: scaleX(1);
}

button:not(:disabled):active,
.button:active {
  color: #fff;
}

button:focus-visible,
.button:focus-visible {
  outline: 3px solid rgba(63, 109, 246, 0.28);
  outline-offset: 3px;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.button.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.button-secondary {
  --button-base: #e9e8f4;
  --button-fill: var(--accent);
  color: var(--ink);
}

.button-secondary:hover {
  color: #fff;
}

.site-band {
  min-height: 196px;
  padding: 64px 24px 30px;
  background: var(--lavender);
  color: #fff;
  text-align: center;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.brand-mark img {
  display: block;
  width: min(320px, 72vw);
  height: auto;
}

.app {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 84px;
}

.form-card,
.results-card,
.chooser-card {
  overflow: hidden;
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}

.form-card {
  width: min(1180px, 100%);
  min-height: 520px;
  margin: 0 auto;
}

.question-panel {
  padding: 72px;
}

.intro-panel {
  padding: 72px;
  border-bottom: 1px solid var(--line);
}

.intro-panel h1,
.results-header h1,
.chooser-card h1 {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: clamp(2.1rem, 5vw, 3.5rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.intro-panel p,
.results-header p,
.chooser-card p {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
}

.question-title {
  margin: 0 0 24px;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.25;
  letter-spacing: 0;
}

.question-title.is-required::after {
  content: " *";
  color: #d8251d;
}

.choices {
  display: grid;
  gap: 14px;
  margin: 0;
  text-align: left;
}

.choice {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
  align-items: center;
  width: fit-content;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  font-weight: 400;
  text-align: left;
}

.choice:hover,
.choice.is-selected {
  background: transparent;
  color: var(--ink);
}

.choice-box {
  position: relative;
  width: 30px;
  height: 30px;
  border: 2px solid #b8bfcc;
  border-radius: 50%;
  background: #fff;
}

.choice.is-selected .choice-box {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 0 0 4px #dfe6ff;
}

.choice.is-selected .choice-box::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #fff;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin: 52px -72px -72px;
  padding: 36px 72px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.form-actions button {
  min-width: 180px;
  min-height: 64px;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  font-weight: 400;
}

.results-card {
  padding: 64px;
  background: #fff;
}

.results-card.is-revealed .results-header {
  animation: results-reveal 0.45s ease both;
}

.results-card.is-revealed .teacher-list {
  animation: results-reveal 0.45s ease 0.08s both;
}

.results-card.is-revealed .badge-guide {
  animation: results-reveal 0.45s ease 0.12s both;
}

.results-card.is-revealed .teacher-list > * {
  animation: results-reveal 0.45s ease both;
}

.results-card.is-revealed .results-next {
  animation: results-reveal 0.45s ease 0.14s both;
}

.results-header {
  margin: 0 auto 42px;
  text-align: center;
}

.answer-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 24px auto 0;
  padding: 0;
  list-style: none;
}

.answer-summary li {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--lavender-soft);
  color: var(--heading);
  font-size: 0.9rem;
  font-weight: 700;
}

.teacher-list {
  display: grid;
  gap: 62px;
}

.teacher-section {
  display: grid;
  grid-template-columns: minmax(200px, 320px) 1fr;
  gap: 44px;
  align-items: center;
  padding-bottom: 62px;
}

.teacher-section:nth-child(even) {
  grid-template-columns: 1fr minmax(200px, 320px);
}

.teacher-section:nth-child(even) .teacher-media {
  order: 2;
}

.teacher-media {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--lavender-soft);
}

.teacher-media img,
.teacher-media svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.teacher-media img {
  background: #fff;
}

.teacher-copy h2 {
  margin: 0 0 12px;
  color: var(--heading);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.12;
  letter-spacing: 0;
  text-transform: uppercase;
}

.headline {
  margin: 0 0 12px;
  color: var(--heading);
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.2;
}

.summary {
  margin: 0 0 18px;
  color: var(--muted);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.badges li {
  color: #333;
  font-size: 0.86rem;
}

.note {
  margin: 0 0 18px;
  font-size: 0.9rem;
  font-weight: 700;
}

.teacher-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-guide {
  width: min(720px, 100%);
  margin: 24px auto 28px;
  text-align: center;
}

.badge-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.badge-guide-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0;
  text-align: left;
}

.badge-guide-item img {
  display: block;
  width: 34px;
  height: auto;
  flex: 0 0 auto;
}

.badge-guide-item span {
  color: var(--heading);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
}

.badge-guide-link {
  position: relative;
  display: inline-block;
  width: fit-content;
  margin: 12px auto 0;
  padding: 2px 4px;
  color: var(--heading);
  font-size: 0.82rem;
  font-weight: 700;
  background-image: linear-gradient(to right, var(--lavender-soft) 50%, transparent 50%);
  background-position: 100% 0;
  background-size: 200% 100%;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition:
    background-position 0.28s ease,
    color 0.18s ease;
}

.badge-guide-link:hover {
  color: var(--accent);
  background-position: 0 0;
}

.empty {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: 36px;
  background: var(--soft);
  color: var(--muted);
  text-align: center;
}

.no-match-panel {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 42px 34px;
  background: var(--soft);
  text-align: center;
}

.no-match-panel h2 {
  margin: 0 0 24px;
  color: var(--heading);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.no-match-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
  width: min(360px, 100%);
  margin: 0 auto;
}

.no-match-actions .button {
  width: 100%;
  white-space: nowrap;
}

.loading-card {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 42px 30px;
  background: var(--soft);
  color: var(--heading);
  text-align: center;
}

.loading-card p {
  margin: 18px 0 0;
  color: var(--ink);
  font-weight: 700;
  transition: opacity 0.18s ease;
}

.loading-card p.is-changing {
  opacity: 0;
}

.loading-orbit {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 28px;
}

.loading-orbit span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  animation: loading-bounce 0.9s ease-in-out infinite;
}

.loading-orbit span:nth-child(2) {
  animation-delay: 0.14s;
}

.loading-orbit span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes results-reveal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loading-bounce {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0) scale(0.85);
  }

  40% {
    opacity: 1;
    transform: translateY(-10px) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  button,
  .button,
  .results-card.is-revealed .results-header,
  .results-card.is-revealed .teacher-list,
  .results-card.is-revealed .badge-guide,
  .results-card.is-revealed .teacher-list > *,
  .results-card.is-revealed .results-next,
  .loading-orbit span {
    animation: none;
    transition: none;
  }

  button:not(:disabled):hover,
  .button:hover,
  button:not(:disabled):active,
  .button:active {
    transform: none;
  }
}

.retake {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 42px;
}

.results-next {
  width: min(760px, 100%);
  margin: 42px auto 0;
  padding: 42px 34px;
  background: var(--soft);
  text-align: center;
}

.results-next h2 {
  margin: 0 0 18px;
  color: var(--heading);
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.results-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
  width: min(360px, 100%);
  margin: 0 auto;
}

.results-actions .button {
  width: 100%;
  white-space: nowrap;
}

.chooser-card {
  padding: 64px;
}

.chooser-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.demo-steps {
  max-width: 840px;
  margin: 34px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  list-style: none;
}

.demo-steps li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 18px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.demo-steps span {
  color: var(--heading);
  font-size: 0.88rem;
  font-weight: 700;
}

.demo-steps p {
  margin: 0;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.55;
}

.demo-steps strong {
  color: var(--heading);
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .app {
    width: min(100% - 22px, 1060px);
  }

  .site-band {
    min-height: 132px;
    padding: 38px 20px 22px;
  }

  .intro-panel,
  .question-panel,
  .results-card,
  .chooser-card {
    padding: 28px 22px;
  }

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

  .form-actions {
    margin: 36px -22px -28px;
    padding: 22px;
  }

  .form-actions button {
    min-width: 120px;
    min-height: 52px;
  }

  .choice {
    width: 100%;
    font-size: 1.15rem;
  }

  .demo-steps li {
    grid-template-columns: 42px 1fr;
    gap: 12px;
  }

  .teacher-section,
  .teacher-section:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-bottom: 42px;
  }

  .teacher-section:nth-child(even) .teacher-media {
    order: 0;
  }

  .results-next {
    width: auto;
    margin-right: 0;
    margin-left: 0;
    padding: 34px 22px;
  }

  .badge-guide {
    width: auto;
    margin-right: 0;
    margin-left: 0;
    margin-bottom: 22px;
    padding: 2px 0 0;
  }

  .badge-guide-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .badge-guide-item {
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  .badge-guide-item:last-child {
    border-bottom: 0;
  }

  .badge-guide-item img {
    width: 30px;
  }

  .badge-guide-item span {
    font-size: 0.88rem;
  }

  .badge-guide-link {
    display: block;
    margin: 10px auto 0;
    font-size: 0.84rem;
  }

  .no-match-panel {
    padding: 34px 22px;
  }

  .no-match-actions {
    grid-template-columns: 1fr;
  }
}
