@import url("https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,500;0,600;1,500&family=Inter:wght@400;500;600&display=swap");

:root {
  --paper: #f7f5f0;
  --surface: #ffffff;
  --ink: #232320;
  --ink-soft: #6b6a63;
  --line: #e4e0d6;
  --accent: #3f6659;
  --accent-soft: #e4ece8;
  --accent-ink: #24413a;
  --danger: #a4442f;
  --radius: 10px;
  --measure: 640px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.progress-rail {
  position: sticky;
  top: 0;
  height: 3px;
  background: var(--line);
  z-index: 20;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.25s ease;
}

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 48px 24px 96px;
}

.intro {
  margin-bottom: 44px;
}

.intro .eyebrow {
  font-size: 14px;
  color: var(--accent-ink);
  margin: 0 0 10px;
}

h1 {
  font-family: "Lora", Georgia, serif;
  font-weight: 600;
  font-size: 32px;
  line-height: 1.2;
  margin: 0 0 18px;
  color: var(--ink);
}

.intro p {
  color: var(--ink-soft);
  margin: 0 0 14px;
  max-width: 58ch;
}

.scale-legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--ink-soft);
}

.scale-legend strong {
  color: var(--ink);
  font-weight: 600;
}

fieldset {
  border: none;
  margin: 0 0 40px;
  padding: 0;
}

legend {
  font-family: "Lora", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  padding: 0 0 8px;
  color: var(--ink);
}

.question {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.question:last-child {
  border-bottom: 1px solid var(--line);
}

.question-text {
  display: flex;
  gap: 12px;
  margin: 0 0 16px;
  font-size: 16px;
}

.question-number {
  flex: none;
  font-family: "Lora", Georgia, serif;
  font-style: italic;
  color: var(--ink-soft);
  min-width: 26px;
}

.scale-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.scale-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.scale-btn:hover {
  border-color: var(--accent);
}

.scale-btn:active {
  transform: scale(0.94);
}

.scale-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.scale-btn.na {
  width: auto;
  border-radius: 999px;
  padding: 0 14px;
  margin-left: 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.scale-btn.na.selected {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
  color: #fff;
}

.scale-btn:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.choice-pill {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 14px;
  border-radius: 999px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.choice-pill:hover {
  border-color: var(--accent);
}

.choice-pill.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.other-input {
  display: none;
  width: 100%;
  max-width: 320px;
  margin: -8px 0 18px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
}

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

.open-question textarea {
  width: 100%;
  min-height: 88px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: "Inter", sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  resize: vertical;
}

.open-question p {
  margin: 0 0 10px;
  font-size: 15.5px;
}

.optional-tag {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 400;
}

.submit-row {
  margin-top: 8px;
}

.status {
  min-height: 22px;
  margin: 0 0 14px;
  font-size: 14px;
}

.status.error {
  color: var(--danger);
}

.status.hint {
  color: var(--ink-soft);
}

button.submit {
  appearance: none;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: "Inter", sans-serif;
  font-size: 15.5px;
  font-weight: 600;
  padding: 14px 26px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

button.submit:hover {
  background: var(--accent-ink);
}

button.submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.done-screen {
  padding: 64px 0;
}

.done-screen h1 {
  font-size: 26px;
}

.done-screen p {
  color: var(--ink-soft);
}

@media (max-width: 480px) {
  main {
    padding: 32px 18px 80px;
  }
  h1 {
    font-size: 26px;
  }
  .scale-btn {
    width: 30px;
    height: 30px;
  }
}
