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

:root {
  --bg: #FAFAF8;
  --text: #1A1A18;
  --border: #E0DBD4;
  --muted: #9A958F;
  --progress-h: 2px;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── Progress bar ── */

.progress-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--progress-h);
  background: var(--border);
  z-index: 100;
}

.progress-fill {
  height: 100%;
  background: var(--text);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* ── Form wrapper ── */

.form-wrapper {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 24px 120px;
}

/* ── Steps ── */

.step {
  display: none;
  width: 100%;
  max-width: 640px;
}

.step.active {
  display: block;
  animation: stepIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes stepIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Question number ── */

.q-number {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 18px;
}

/* ── Subtext / instruction line ── */

.q-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: -20px;
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

/* ── Headings ── */

h1 {
  font-size: clamp(42px, 7vw, 68px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin-bottom: 28px;
}

h2 {
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

/* ── Intro step ── */

.intro-description {
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 52px;
  max-width: 480px;
}

/* ── Fields ── */

.field-group {
  margin-bottom: 32px;
}

.field-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  font-family: inherit;
  font-size: 18px;
  font-weight: 400;
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--border);
  padding: 10px 0 12px;
  outline: none;
  transition: border-color 0.2s;
  border-radius: 0;
}

input[type="text"]:focus,
input[type="email"]:focus {
  border-bottom-color: var(--text);
}

input::placeholder {
  color: var(--border);
}

input.error {
  border-bottom-color: #B94040;
}

/* ── Textarea ── */

textarea {
  width: 100%;
  font-family: inherit;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 2px;
  padding: 20px 22px;
  outline: none;
  resize: vertical;
  min-height: 172px;
  transition: border-color 0.2s;
}

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

textarea::placeholder {
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
}

/* ── Checkbox options ── */

.checkbox-options {
  display: flex;
  flex-direction: column;
}

.checkbox-option {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.checkbox-option:first-child {
  border-top: 1px solid var(--border);
}

.checkbox-option input[type="checkbox"] {
  display: none;
}

.cb-box {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px 8px;
}

.checkbox-option input[type="checkbox"]:checked ~ .cb-box {
  background-color: var(--text);
  border-color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4.5L4.5 8L11 1' stroke='%23FAFAF8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.cb-label {
  font-size: 17px;
  line-height: 1.4;
  flex: 1;
}

.other-input {
  display: none;
  flex: 0 0 100%;
  margin-top: 12px;
  padding-left: 34px;
  font-size: 16px !important;
  padding-bottom: 8px !important;
}

.other-input.visible {
  display: block;
}

/* ── Chip options ── */

.chip-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
  outline: none;
  line-height: 1;
}

.chip:hover:not(.chip--disabled) {
  border-color: var(--muted);
}

.chip.selected {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.chip--disabled {
  opacity: 0.28;
  cursor: default;
  pointer-events: none;
}

/* ── Radio options ── */

.radio-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-option {
  padding: 18px 22px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  outline: none;
}

.radio-option:hover {
  border-color: var(--muted);
}

.radio-option:focus-visible {
  border-color: var(--text);
}

.radio-option.selected {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

/* ── Fill in the blank ── */

.fill-blank {
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.fill-blank-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fill-blank-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ── Thanks step ── */

.thanks-step h2 {
  font-size: clamp(42px, 7vw, 68px);
  margin-bottom: 20px;
}

.thanks-step p {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.65;
}

/* ── Footer navigation ── */

.form-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  z-index: 50;
}

.form-footer.hidden {
  display: none;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0;
  transition: color 0.2s, opacity 0.2s;
  letter-spacing: 0.02em;
}

.btn-back svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-back:hover:not(:disabled) {
  color: var(--text);
}

.btn-back:disabled {
  opacity: 0;
  pointer-events: none;
}

.btn-next {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--text);
  border: none;
  cursor: pointer;
  padding: 15px 36px;
  border-radius: 2px;
  transition: opacity 0.2s;
}

.btn-next:hover {
  opacity: 0.8;
}

.btn-next:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-next.hidden {
  visibility: hidden;
  pointer-events: none;
}

/* ── Responsive ── */

@media (max-width: 600px) {
  .form-wrapper {
    padding: 72px 20px 110px;
  }

  .form-footer {
    padding: 16px 20px;
  }

  .chip {
    font-size: 14px;
    padding: 9px 16px;
  }

  .radio-option {
    font-size: 16px;
    padding: 16px 18px;
  }
}
