:root {
  --ksd-brand-950: #14342c;
  --ksd-brand-800: #215648;
  --ksd-brand-700: #2e6d5b;
  --ksd-brand-600: #3f816e;
  --ksd-brand-500: #4f987f;
  --ksd-accent-100: #dff4ea;
  --ksd-accent-50: #edf8f3;
  --ksd-neutral-25: #f7faf8;
  --ksd-neutral-100: #e6ece9;
  --ksd-neutral-700: #41534c;
  --ksd-neutral-900: #1d2a25;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--ds-font-family), sans-serif;
  font-feature-settings: "cv05" 1;
  color: var(--ksd-neutral-900);
  background:
    radial-gradient(circle at top right, rgba(79, 152, 127, 0.16), transparent 28%),
    linear-gradient(180deg, #f8fbfa 0%, #f2f6f4 100%);
}

.page-shell {
  min-height: 100vh;
}

.hero-band {
  padding: 3rem 1.5rem 2rem;
  border-bottom: 1px solid rgba(20, 52, 44, 0.08);
}

.hero-inner,
.main-layout {
  max-width: 76rem;
  margin: 0 auto;
}

.brand-lockup {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, var(--ksd-brand-800), var(--ksd-brand-500));
  color: white;
  font-weight: 700;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ksd-brand-700);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.08;
  max-width: 16ch;
}

.hero-copy {
  margin: 1.25rem 0 0;
  max-width: 48rem;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ksd-neutral-700);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hero-actions .ds-button {
  text-decoration: none;
}

.main-layout {
  padding: 1.5rem;
}

.context-panel,
.tool-surface,
.receipt-surface {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(20, 52, 44, 0.08);
  box-shadow: 0 16px 40px rgba(18, 39, 34, 0.06);
}

.context-panel,
.receipt-surface {
  border-radius: 0.5rem;
}

.context-panel {
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.tool-surface {
  border-radius: 0.5rem;
  overflow: hidden;
}

.review-banner {
  padding: 0.9rem 1rem;
  background: rgba(20, 52, 44, 0.06);
  border-bottom: 1px solid rgba(20, 52, 44, 0.08);
}

.review-banner p {
  margin: 0;
  line-height: 1.55;
  color: var(--ksd-brand-950);
}

.draft-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: rgba(223, 244, 234, 0.85);
  border-bottom: 1px solid rgba(20, 52, 44, 0.08);
}

.draft-banner p {
  margin: 0;
  line-height: 1.5;
  color: var(--ksd-brand-950);
}

.receipt-surface {
  padding: 1.5rem;
  margin-top: 1rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.info-item {
  min-width: 0;
}

.info-item h2,
.tool-surface h2,
.receipt-header h2 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}

.info-item p,
.receipt-header p,
.section-lead,
.question-help,
.status-message {
  margin: 0;
  line-height: 1.6;
  color: var(--ksd-neutral-700);
}

.stepper {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(223, 244, 234, 0.85), rgba(255, 255, 255, 0.3));
  border-bottom: 1px solid rgba(20, 52, 44, 0.08);
}

.step-pill {
  appearance: none;
  border: 1px solid rgba(33, 86, 72, 0.12);
  background: white;
  color: var(--ksd-brand-950);
  border-radius: 0.5rem;
  min-height: 2.75rem;
  padding: 0.6rem 0.8rem;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.step-pill.is-active {
  background: var(--ksd-brand-800);
  color: white;
  border-color: var(--ksd-brand-800);
}

#survey-form {
  padding: 1.5rem;
}

.survey-step {
  display: none;
}

.survey-step.is-active {
  display: block;
}

.survey-step h2 {
  margin-bottom: 0.4rem;
}

.section-lead {
  margin-bottom: 1.25rem;
}

.question-group,
.field-block {
  margin: 0 0 1.5rem;
}

.question-group {
  border: 0;
  padding: 0;
}

.question-group legend,
.ds-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--ksd-neutral-900);
}

.question-help {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.choice-row,
.consent-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.875rem 1rem;
  border: 1px solid rgba(20, 52, 44, 0.1);
  border-radius: 0.5rem;
  background: white;
}

.choice-row + .choice-row,
.question-group .choice-row + .choice-row {
  margin-top: 0.5rem;
}

.choice-row input,
.consent-row input {
  margin-top: 0.2rem;
}

.field-block .ds-input,
.compact-field .ds-input {
  width: 100%;
  box-sizing: border-box;
  background: white;
}

textarea.ds-input {
  min-height: 8rem;
  resize: vertical;
}

.consent-row {
  margin-top: 0.5rem;
}

.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(20, 52, 44, 0.08);
}

.footer-actions,
.receipt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

#submit-survey,
.receipt-surface.is-hidden,
#previous-step.is-hidden,
#next-step.is-hidden {
  display: none;
}

#submit-survey[disabled] {
  display: inline-flex;
  opacity: 0.55;
  cursor: not-allowed;
}

.status-message {
  min-height: 1.5rem;
}

.status-message[data-state="error"] {
  color: #9a1e2c;
}

.status-message[data-state="success"] {
  color: var(--ksd-brand-700);
}

.receipt-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  margin-top: 1rem;
}

.compact-field {
  flex: 1 1 20rem;
}

@media (max-width: 960px) {
  .info-grid,
  .stepper {
    grid-template-columns: 1fr;
  }

  .draft-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .form-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 720px) {
  .hero-band,
  .main-layout {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #survey-form,
  .receipt-surface,
  .context-panel {
    padding: 1rem;
  }

  .brand-lockup {
    align-items: flex-start;
  }
}
