* {
  box-sizing: border-box;
}

:root {
  --primary: #312d47;
  --secondary: #33415f;
  --terra: #714440;
  --vellum: #fdfdfb;
  --lavender: #caaeca;
  --coral: #ff6f61;
  --coral-hover: #f45f52;
  --surface: #ffffff;
  --surface-soft: rgba(202, 174, 202, 0.18);
  --surface-strong: rgba(202, 174, 202, 0.34);
  --line: rgba(49, 45, 71, 0.14);
  --line-strong: rgba(49, 45, 71, 0.22);
  --warn: #714440;
  --warn-bg: rgba(255, 111, 97, 0.12);
  --shadow: 0 26px 70px rgba(49, 45, 71, 0.12);
}

html {
  background: var(--vellum);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--vellum);
  color: var(--primary);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 300;
  line-height: 1.58;
  text-rendering: optimizeLegibility;
}

button,
input,
a {
  font: inherit;
}

turbo-frame {
  display: block;
}

.page-shell {
  width: min(100%, 940px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 44px);
  display: grid;
  align-items: center;
}

.quiz-card,
.result-card {
  width: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 72%, rgba(202, 174, 202, 0.12) 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: clamp(28px, 5vw, 56px);
}

.result-card {
  background: #ffffff;
}

.brand-bar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: clamp(30px, 5vw, 46px);
}

.brand-logo {
  display: block;
  width: clamp(128px, 18vw, 172px);
  height: auto;
  object-fit: contain;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
}

.brand-link:focus-visible {
  outline: 3px solid rgba(255, 111, 97, 0.42);
  outline-offset: 5px;
}

.intro,
.result-card {
  text-align: left;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--terra);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  color: var(--primary);
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.15rem, 5vw, 4.45rem);
  font-weight: 800;
  line-height: 1.02;
}

.intro-copy,
.result-summary {
  max-width: 700px;
  margin: 22px 0 0;
  color: var(--secondary);
  font-size: clamp(1.05rem, 2vw, 1.24rem);
  font-weight: 300;
}

.privacy-note {
  width: fit-content;
  max-width: 100%;
  margin: 20px 0 32px;
  padding: 10px 13px;
  border-left: 3px solid var(--lavender);
  background: rgba(202, 174, 202, 0.15);
  color: var(--secondary);
  font-size: 0.96rem;
  font-weight: 600;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  border-radius: 999px;
  padding: 13px 22px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.primary-button {
  background: var(--coral);
  color: var(--primary);
  box-shadow: 0 12px 26px rgba(255, 111, 97, 0.24);
}

.primary-button:hover {
  background: var(--coral-hover);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(255, 111, 97, 0.28);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.7);
  color: var(--secondary);
  border-color: var(--line-strong);
}

.secondary-button:hover {
  background: var(--surface-soft);
  color: var(--primary);
  border-color: rgba(202, 174, 202, 0.82);
}

.quiz-form {
  display: block;
}

.progress-wrap {
  margin-bottom: 34px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 11px;
  color: var(--secondary);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 700;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: rgba(202, 174, 202, 0.24);
  border-radius: 999px;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--coral);
  border-radius: inherit;
  transition: width 180ms ease;
}

.question-step {
  margin: 0;
  padding: 0;
  border: 0;
}

.question-step legend {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  margin-bottom: 26px;
  color: var(--primary);
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.38rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.18;
}

.question-step legend span {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--surface-strong);
  color: var(--primary);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
  font-weight: 700;
}

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

.option-card {
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 17px;
  display: flex;
  align-items: center;
  gap: 13px;
  cursor: pointer;
  color: var(--secondary);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 26px rgba(49, 45, 71, 0.05);
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

.option-card:hover {
  border-color: rgba(113, 68, 64, 0.35);
  background: #ffffff;
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(49, 45, 71, 0.08);
}

.option-card:has(input:checked) {
  border-color: var(--coral);
  background: rgba(255, 111, 97, 0.1);
  color: var(--primary);
  box-shadow: 0 14px 34px rgba(255, 111, 97, 0.15);
}

.option-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--coral);
  flex: 0 0 auto;
}

.option-card span {
  font-weight: 600;
}

.validation-message,
.alert {
  margin: 18px 0 0;
  padding: 13px 15px;
  border: 1px solid rgba(113, 68, 64, 0.14);
  border-radius: 14px;
  background: var(--warn-bg);
  color: var(--warn);
  font-weight: 600;
}

.quiz-actions,
.result-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 34px;
}

.result-section,
.next-step {
  margin-top: 30px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.result-section h2,
.next-step h2 {
  margin: 0 0 12px;
  color: var(--secondary);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.2;
}

.result-section p,
.next-step p {
  margin: 0;
  color: var(--secondary);
}

.result-section ul {
  margin: 0;
  padding-left: 20px;
  color: var(--secondary);
}

.result-section li + li {
  margin-top: 10px;
}

.result-section li::marker {
  color: var(--terra);
}

.alternatives-list {
  display: grid;
  gap: 12px;
}

.alternative-item,
.next-step {
  padding: 18px;
  border: 1px solid rgba(202, 174, 202, 0.62);
  border-radius: 16px;
  background: var(--surface-soft);
}

.alternative-item h3 {
  margin: 0 0 7px;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 800;
}

.alternative-item p {
  color: var(--secondary);
}

.next-step {
  border-color: rgba(255, 111, 97, 0.28);
  background: rgba(255, 111, 97, 0.08);
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .page-shell {
    padding: 14px;
    align-items: stretch;
  }

  .quiz-card,
  .result-card {
    min-height: calc(100vh - 28px);
    padding: 26px 18px;
    border-radius: 16px;
  }

  .brand-bar {
    margin-bottom: 30px;
  }

  h1 {
    font-size: clamp(2rem, 12vw, 3.05rem);
  }

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

  .option-card {
    min-height: 72px;
  }

  .quiz-actions,
  .result-actions {
    flex-direction: column-reverse;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}
