:root {
  color-scheme: light dark;
  --bg: #f5f6f1;
  --panel: #ffffff;
  --panel-translucent: rgba(255, 255, 255, 0.96);
  --control-bg: #ffffff;
  --text: #17211b;
  --muted: #627066;
  --border: #d7ddd5;
  --accent: #12664f;
  --accent-hover: #0d533f;
  --accent-quiet: #e5f1ec;
  --warning: #a33d2c;
  --focus: #d68c45;
  --focus-ring: rgba(214, 140, 69, 0.18);
  --field-label: #26312a;
  --progress-track: #e8ece7;
  --button-primary-text: #ffffff;
  --bg-wash-start: rgba(18, 102, 79, 0.08);
  --bg-wash-end: rgba(214, 140, 69, 0.12);
  --shadow: 0 18px 55px rgba(28, 44, 34, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111713;
    --panel: #18201b;
    --panel-translucent: rgba(24, 32, 27, 0.96);
    --control-bg: #101611;
    --text: #eef4ee;
    --muted: #aab8ae;
    --border: #35433b;
    --accent: #58c7a2;
    --accent-hover: #74d8b9;
    --accent-quiet: #18372d;
    --warning: #f18b78;
    --focus: #e0a256;
    --focus-ring: rgba(224, 162, 86, 0.24);
    --field-label: #dde8df;
    --progress-track: #27322c;
    --button-primary-text: #06120d;
    --bg-wash-start: rgba(88, 199, 162, 0.12);
    --bg-wash-end: rgba(224, 162, 86, 0.1);
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.36);
  }
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, var(--bg-wash-start), transparent 38%),
    linear-gradient(315deg, var(--bg-wash-end), transparent 34%),
    var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.masthead {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 16ch;
  margin-bottom: 12px;
  font-size: 4.5rem;
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.description,
.status-text {
  max-width: 62ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.survey-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-translucent);
  box-shadow: var(--shadow);
}

.step {
  padding: 28px;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-label {
  color: var(--field-label);
  font-size: 0.95rem;
  font-weight: 750;
}

.required-mark {
  color: var(--warning);
  font-weight: 800;
}

.input,
.textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--control-bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input {
  min-height: 48px;
  padding: 0 14px;
}

.textarea {
  min-height: 150px;
  resize: vertical;
  padding: 14px;
  line-height: 1.45;
}

.input:focus,
.textarea:focus,
.choice-input:focus-visible + .choice-label,
.scale-input:focus-visible + .scale-label {
  border-color: var(--focus);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.required-label {
  color: var(--warning);
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--progress-track);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.2s ease;
}

.question-fieldset {
  min-width: 0;
  margin: 28px 0 0;
  padding: 0;
  border: 0;
}

#question-label {
  display: block;
  width: 100%;
  margin-bottom: 18px;
  color: var(--text);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 0;
}

.answer-control {
  display: grid;
  gap: 12px;
}

.choice-list,
.scale-list {
  display: grid;
  gap: 10px;
}

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

.choice-label,
.scale-label {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--control-bg);
  color: var(--text);
  font-weight: 750;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.choice-label {
  justify-content: flex-start;
  padding: 0 14px;
}

.choice-input:checked + .choice-label,
.scale-input:checked + .scale-label {
  border-color: var(--accent);
  background: var(--accent-quiet);
  color: var(--accent);
}

.scale-list {
  grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
}

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

.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.actions-end {
  justify-content: flex-end;
}

.button {
  min-width: 116px;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--accent);
  color: var(--button-primary-text);
}

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

.button-secondary {
  border-color: var(--border);
  background: var(--control-bg);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.button[disabled] {
  opacity: 0.55;
  cursor: progress;
}

.error-text {
  margin: 14px 0 0;
  color: var(--warning);
  font-weight: 750;
  line-height: 1.45;
}

[hidden] {
  display: none !important;
}

@media (max-width: 540px) {
  .app-shell {
    width: min(100% - 24px, 760px);
    padding: 28px 0;
  }

  .step {
    padding: 20px;
  }

  h1 {
    max-width: 12ch;
    font-size: 2.55rem;
  }

  #question-label {
    font-size: 1.45rem;
  }

  .progress-row,
  .actions,
  .scale-labels {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}
