:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.16);
  --paper: #f5f8ff;
  --panel: #ffffff;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #dbeafe;
  --rose: #c8553d;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.11), transparent 34%),
    radial-gradient(circle at 84% 20%, rgba(14, 165, 233, 0.16), transparent 28%),
    var(--paper);
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  padding: 28px clamp(18px, 4vw, 56px);
}

.topbar,
.progress-meta,
.footer-note,
.control-row,
.topbar-actions {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-logo {
  width: 113px;
  max-width: 32vw;
  height: auto;
  display: block;
}

.topbar-actions {
  gap: 8px;
}

.ghost-button {
  min-height: 38px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.ghost-button:disabled {
  color: rgba(15, 23, 42, 0.35);
  cursor: not-allowed;
}

.progress-wrap {
  width: min(840px, 100%);
  margin: 42px auto 0;
}

.progress-meta {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.12);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 320ms ease;
}

.stage {
  width: min(840px, 100%);
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 52px 0 36px;
}

.question-card {
  transform: translateY(0);
  opacity: 1;
  transition:
    opacity 210ms ease,
    transform 210ms ease;
}

.question-card.is-changing {
  transform: translateY(18px);
  opacity: 0;
}

.question-kicker {
  margin-bottom: 18px;
  color: var(--accent-dark);
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2rem, 4.8vw, 4.6rem);
  line-height: 1;
  letter-spacing: 0;
}

p {
  margin: 0;
}

#questionHelp {
  max-width: 660px;
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.28rem);
  line-height: 1.55;
}

.answer-zone {
  width: min(760px, 100%);
  margin-top: 34px;
}

.text-field {
  display: grid;
  gap: 10px;
}

.text-field span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  color: var(--ink);
  border: 0;
  border-bottom: 3px solid rgba(15, 23, 42, 0.24);
  outline: none;
  background: transparent;
  font-size: clamp(1.4rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
}

textarea {
  min-height: 180px;
  resize: vertical;
  font-size: clamp(1.15rem, 3vw, 2rem);
}

input:focus,
textarea:focus {
  border-color: var(--accent);
}

.choices {
  display: grid;
  gap: 12px;
}

.choice {
  width: 100%;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 12px 16px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.05);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.choice:hover,
.choice:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.62);
  outline: none;
}

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

.choice-key {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--accent-dark);
  border: 1px solid rgba(37, 99, 235, 0.42);
  border-radius: 7px;
  background: #fff;
  font-size: 0.86rem;
  font-weight: 800;
}

.choice-label {
  min-width: 0;
  font-size: clamp(1rem, 2.5vw, 1.22rem);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.error-message {
  min-height: 24px;
  margin-top: 18px;
  color: var(--rose);
  font-weight: 700;
}

.control-row {
  gap: 14px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.primary-button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 22px;
  color: #fff;
  border: 0;
  border-radius: 8px;
  background: var(--accent-dark);
  box-shadow: 0 14px 30px rgba(29, 78, 216, 0.24);
  font-weight: 800;
  cursor: pointer;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: #1e40af;
  outline: none;
}

.enter-hint {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 600;
}

.footer-note {
  justify-content: space-between;
  gap: 16px;
  color: rgba(15, 23, 42, 0.58);
  font-size: 0.85rem;
  font-weight: 700;
}

.scale-wrap {
  display: grid;
  gap: 14px;
}

.scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(54px, 1fr));
  gap: 10px;
}

.scale-button {
  aspect-ratio: 1;
  min-height: 58px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.scale-button:hover,
.scale-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.62);
  outline: none;
}

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

.scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.thank-you-note {
  display: grid;
  gap: 14px;
  margin-top: 34px;
  padding: 22px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.thank-you-note p {
  max-width: 620px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.55;
}

.summary {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.summary-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.summary-item strong {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

@media (max-width: 680px) {
  .app-shell {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand span:last-child {
    display: none;
  }

  .brand-logo {
    width: 104px;
  }

  .progress-wrap {
    margin-top: 28px;
  }

  .stage {
    align-items: start;
    padding-top: 42px;
  }

  h1 {
    font-size: clamp(2rem, 11vw, 3.3rem);
  }

  .scale {
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    gap: 8px;
  }

  .footer-note {
    align-items: flex-start;
    flex-direction: column;
  }
}
