:root {
  --bg: #000000;
  --surface: #080808;
  --surface-hover: #0f0f0f;
  --text: #f5f5f2;
  --muted: #8a8a84;
  --line: #1d1d1d;
  --accent: #f5f5f2;
  --error: #ff775f;
  --page-pad: clamp(1.25rem, 4vw, 4rem);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  font-size: 16px;
}

body {
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  cursor: default;
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none !important;
  user-select: none !important;
}

:where(input, textarea, select, [contenteditable="true"]) {
  cursor: text;
  -webkit-user-select: text !important;
  user-select: text !important;
}

:where(a, button, label) { cursor: pointer; }

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 82px;
  padding: 0 var(--page-pad);
}

.brand {
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  width: 11px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2.5px var(--bg);
  background: var(--text);
}

.progress-copy {
  display: flex;
  gap: 0.35rem;
  color: var(--muted);
  font-family: "Manrope", sans-serif;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
}

#current-step {
  color: var(--text);
}

.progress-divider {
  color: #3d3d3d;
}

.progress-track {
  position: fixed;
  top: 81px;
  right: var(--page-pad);
  left: var(--page-pad);
  z-index: 10;
  height: 1px;
  background: #202020;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.quiz-shell {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 8rem var(--page-pad) 7rem;
}

#quiz-form {
  width: min(100%, 920px);
}

.question-stage {
  width: 100%;
}

.question-panel {
  animation: question-in 550ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.question-number,
.eyebrow {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 1.1rem;
  color: var(--muted);
  font-family: "Manrope", sans-serif;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.question-number::before,
.eyebrow::before {
  width: 18px;
  height: 1px;
  background: currentColor;
  content: "";
}

.question-title {
  max-width: 880px;
  margin: 0 0 clamp(1.7rem, 4vw, 2.7rem);
  font-family: "Manrope", sans-serif;
  font-size: clamp(2rem, 4.5vw, 4.7rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 1.02;
  text-wrap: balance;
}

.text-answer {
  width: 100%;
  margin-bottom: 1.7rem;
  padding: 0.9rem 0 1rem;
  border: 0;
  border-bottom: 1px solid #444;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  font-size: clamp(1.25rem, 2.4vw, 2.1rem);
  line-height: 1.4;
  transition: border-color 180ms ease;
}

textarea.text-answer {
  min-height: 106px;
  max-height: 210px;
  resize: none;
}

.text-answer::placeholder {
  color: #484848;
}

.text-answer:focus {
  border-color: var(--text);
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  max-width: 760px;
  margin-bottom: 1.7rem;
}

.choice {
  position: relative;
  display: flex;
  min-height: 63px;
  gap: 0.9rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  background: var(--surface);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.choice:hover {
  border-color: #4a4a4a;
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.choice:has(input:focus-visible) {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.choice:has(input:checked) {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice-key {
  display: grid;
  flex: 0 0 25px;
  height: 25px;
  place-items: center;
  border: 1px solid #4a4a4a;
  border-radius: 4px;
  color: var(--muted);
  font-family: "Manrope", sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
}

.choice:has(input:checked) .choice-key {
  border-color: var(--bg);
  color: var(--bg);
}

.choice-copy {
  font-size: 0.92rem;
  line-height: 1.35;
}

.choice-check {
  margin-left: auto;
  font-size: 0.85rem;
  opacity: 0;
}

.choice:has(input:checked) .choice-check {
  opacity: 1;
}

.privacy-consent {
  display: flex;
  max-width: 700px;
  gap: .9rem;
  align-items: flex-start;
  margin: 0 0 1.7rem;
  padding: 1.2rem 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  cursor: pointer;
}

.privacy-consent input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.privacy-consent-box { display: grid; flex: 0 0 1.25rem; width: 1.25rem; height: 1.25rem; place-items: center; margin-top: .15rem; border: 1px solid #555; color: #050505; font-size: .74rem; line-height: 1; transition: background .18s ease, border-color .18s ease; }
.privacy-consent input:checked + .privacy-consent-box { border-color: var(--text); background: var(--text); }
.privacy-consent:has(input:focus-visible) .privacy-consent-box { outline: 2px solid var(--text); outline-offset: 4px; }
.privacy-consent a { color: var(--text); text-underline-offset: .18em; }

.primary-button {
  display: inline-flex;
  gap: 0.8rem;
  align-items: center;
  min-height: 52px;
  padding: 0 1.35rem;
  border: 1px solid var(--text);
  border-radius: 100px;
  cursor: pointer;
  background: var(--text);
  color: var(--bg);
  font-family: "Manrope", sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.primary-button:hover {
  background: transparent;
  color: var(--text);
  transform: translateY(-1px);
}

.error-message {
  min-height: 1.3rem;
  margin: 0.75rem 0 0;
  color: var(--error);
  font-size: 0.78rem;
}

.footer {
  position: fixed;
  right: var(--page-pad);
  bottom: 2rem;
  left: var(--page-pad);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-privacy-link { color: var(--muted); font-family: "DM Mono", monospace; font-size: .64rem; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.quiz-privacy-link:hover { color: var(--text); }

.nav-button {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  padding: 0.4rem 0;
  border: 0;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.nav-button:hover {
  color: var(--text);
}

.nav-button[hidden] {
  display: none;
}

.keyboard-hint {
  margin: 0;
  color: #616161;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

kbd {
  color: var(--muted);
  font-family: inherit;
}

.completion-card {
  max-width: 880px;
  animation: question-in 600ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.completion-card h1 {
  margin: 0 0 1.5rem;
  font-family: "Manrope", sans-serif;
  font-size: clamp(2.5rem, 6vw, 6.2rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.96;
}

.completion-card p {
  max-width: 540px;
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.65;
}

#quiz-form:has(.calendar-panel) {
  width: min(100%, 1280px);
}

.calendar-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(480px, 1.18fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

body:has(.calendar-panel) {
  overflow-y: auto;
}

.quiz-shell:has(.calendar-panel) {
  min-height: 820px;
  align-items: start;
  padding-top: 7.5rem;
  padding-bottom: 4rem;
}

.calendar-copy .question-title {
  margin-bottom: 1.25rem;
  font-size: clamp(2.2rem, 4vw, 4.5rem);
}

.calendar-note {
  max-width: 430px;
  margin: 0 0 2rem;
  color: var(--muted);
  line-height: 1.6;
}

.calendar-email {
  display: block;
  width: fit-content;
  margin: -0.75rem 0 2rem;
  border-bottom: 1px solid #555;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.calendar-email:hover {
  border-color: var(--text);
}

.calendar-embed {
  min-height: 720px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #050505;
}

.booking-frame {
  display: block;
  width: 100%;
  height: 720px;
  background: #000;
}

.booking-frame iframe {
  width: 100%;
  min-height: 720px;
  border: 0;
}

.calendar-placeholder {
  display: grid;
  min-height: 620px;
  padding: 2rem;
  place-content: center;
  text-align: center;
}

.calendar-placeholder span {
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.calendar-placeholder strong {
  max-width: 330px;
  font-family: "Manrope", sans-serif;
  font-size: clamp(1.3rem, 2vw, 2rem);
  font-weight: 500;
  line-height: 1.2;
}

@keyframes question-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 680px) {
  .topbar {
    height: 68px;
  }

  .progress-track {
    top: 67px;
  }

  .brand {
    font-size: 0.62rem;
  }

  .quiz-shell {
    place-items: center start;
    padding-top: 7.5rem;
    padding-bottom: 6.5rem;
  }

  .question-title {
    margin-bottom: 1.7rem;
  }

  .choices {
    grid-template-columns: 1fr;
    max-height: min(49svh, 360px);
    overflow-y: auto;
    padding-right: 0.25rem;
  }

  .choice {
    min-height: 54px;
  }

  .keyboard-hint {
    display: none;
  }

  .footer {
    bottom: 1.35rem;
  }
}

@media (max-width: 900px) {
  body:has(.calendar-panel) {
    overflow: auto;
  }

  .quiz-shell:has(.calendar-panel) {
    display: block;
    padding-top: 7rem;
  }

  .calendar-panel {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .calendar-embed,
  .booking-frame,
  .calendar-placeholder {
    min-height: 680px;
    height: 680px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
