:root {
  --ink: #17221f;
  --ink-soft: #4d5a56;
  --paper: #f4f1eb;
  --white: #ffffff;
  --sage: #b8cbbf;
  --sage-dark: #355849;
  --sage-deep: #203d33;
  --gold: #d2a84c;
  --error: #a53d36;
  --shadow: 0 20px 60px rgba(18, 28, 24, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: #dde4df;
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--paper);
}

.screen {
  min-height: 100dvh;
}

.screen[hidden] {
  display: none;
}

.screen.is-entering {
  animation: screen-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.welcome-screen {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 48px 24px;
  background:
    linear-gradient(rgba(244, 241, 235, 0.68), rgba(244, 241, 235, 0.96)),
    linear-gradient(135deg, #f8f7f2 0%, #dce7df 100%);
}

.welcome-screen::before {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(32, 61, 51, 0.12);
  border-radius: 28px;
  content: "";
}

.welcome-accent {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
}

.welcome-accent--one {
  top: -160px;
  right: -110px;
  width: 360px;
  height: 360px;
  background: rgba(184, 203, 191, 0.45);
}

.welcome-accent--two {
  bottom: -210px;
  left: -130px;
  width: 420px;
  height: 420px;
  border: 80px solid rgba(210, 168, 76, 0.09);
}

.welcome-content {
  position: relative;
  z-index: 1;
  width: calc(100vw - 48px);
  max-width: 680px;
  min-width: 0;
  text-align: center;
}

.brand-mark {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  place-items: center;
  border: 1px solid rgba(53, 88, 73, 0.22);
  border-radius: 50%;
  color: var(--sage-dark);
  background: rgba(255, 255, 255, 0.5);
}

.brand-mark svg {
  width: 42px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--sage-dark);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.welcome-content h1,
.survey-header h2,
.success-content h2 {
  margin: 0;
  font-family: "Manrope", system-ui, sans-serif;
  letter-spacing: -0.045em;
}

.welcome-content h1 {
  font-size: clamp(2.35rem, 8vw, 4.5rem);
  line-height: 1.04;
}

.welcome-copy {
  max-width: 560px;
  margin: 24px auto 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 3vw, 1.18rem);
  line-height: 1.65;
}

.survey-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 28px 0 32px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 600;
}

.survey-meta span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.survey-meta svg {
  width: 18px;
  fill: none;
  stroke: var(--sage-dark);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.primary-button,
.secondary-button,
.submit-button {
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-width: 210px;
  padding: 17px 24px;
  border-radius: 5px;
  color: var(--white);
  background: var(--sage-deep);
  box-shadow: 0 12px 30px rgba(32, 61, 51, 0.22);
  font-weight: 700;
}

.primary-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.primary-button:hover,
.secondary-button:hover,
.submit-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.submit-button:disabled,
.progress-dock button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.submit-button:focus-visible,
.back-button:focus-visible,
.progress-dock button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(210, 168, 76, 0.72);
  outline-offset: 3px;
}

.privacy-note {
  margin: 16px 0 0;
  color: #68736f;
  font-size: 0.78rem;
}

.survey-screen {
  position: relative;
  color: var(--white);
  background: #27342f;
}

.survey-background,
.survey-overlay {
  position: fixed;
  inset: 0;
}

.survey-background {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(245, 225, 185, 0.82), transparent 22%),
    linear-gradient(112deg, #5d675f 0 22%, #b5b1a0 22% 29%, #54635d 29% 70%, #b6ad98 70% 78%, #59645e 78%);
  filter: saturate(0.65);
}

.survey-background::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(165deg, transparent 0 50%, rgba(224, 214, 195, 0.4) 50.3% 52%, transparent 52.3%),
    linear-gradient(15deg, transparent 0 50%, rgba(224, 214, 195, 0.32) 50.3% 52%, transparent 52.3%);
  filter: blur(8px);
  transform: scale(1.08);
}

.survey-overlay {
  background: linear-gradient(180deg, rgba(20, 33, 29, 0.62), rgba(20, 28, 25, 0.74));
  backdrop-filter: blur(4px);
}

.hallway-light,
.hallway-line {
  position: absolute;
}

.hallway-light {
  top: 13%;
  width: 15%;
  height: 31%;
  border: 7px solid rgba(244, 231, 203, 0.52);
  background: rgba(255, 243, 211, 0.35);
  filter: blur(5px);
}

.hallway-light--one { left: 15%; }
.hallway-light--two { right: 15%; }

.hallway-line {
  bottom: -5%;
  width: 2px;
  height: 67%;
  background: rgba(245, 237, 219, 0.33);
  transform-origin: bottom;
}

.hallway-line--one { left: 7%; transform: rotate(34deg); }
.hallway-line--two { right: 7%; transform: rotate(-34deg); }

.survey-scroll {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 54px 20px 126px;
}

.survey-header {
  position: relative;
  margin-bottom: 34px;
  padding: 0 8px 0 56px;
}

.back-button {
  position: absolute;
  top: -3px;
  left: 0;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: var(--white);
  background: rgba(24, 38, 33, 0.28);
  cursor: pointer;
}

.back-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.eyebrow--light {
  color: #dce8e1;
}

.survey-header h2 {
  font-size: clamp(2rem, 7vw, 3.5rem);
  line-height: 1.08;
}

.survey-header > p:last-child {
  max-width: 600px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.55;
}

#survey-form {
  display: grid;
  gap: 18px;
}

.question-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.question-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 24px 65px rgba(18, 28, 24, 0.28);
}

.question-card > label {
  display: block;
  padding: 17px 22px;
  color: var(--white);
  background: rgba(26, 38, 34, 0.92);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 600;
}

.question-card > label span {
  margin-right: 9px;
  color: var(--sage);
  font-size: 0.75em;
  letter-spacing: 0.06em;
}

.question-card > label strong {
  color: #eac96f;
}

.answer-area {
  position: relative;
  min-height: 126px;
  padding: 31px 24px 20px;
  color: var(--ink);
}

.answer-area input,
.answer-area select {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 46px;
  border: 0;
  border-bottom: 1px solid #bcc4c0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  outline: none;
}

.answer-area input {
  padding: 12px 0 4px;
}

.answer-area select {
  appearance: none;
  padding: 6px 38px 4px 0;
  cursor: pointer;
}

.answer-area input:focus,
.answer-area select:focus {
  border-color: var(--sage-dark);
  box-shadow: 0 1px 0 var(--sage-dark);
}

.floating-label {
  position: absolute;
  top: 43px;
  left: 24px;
  color: #78827e;
  pointer-events: none;
  transition: transform 150ms ease, color 150ms ease, font-size 150ms ease;
}

input:focus + .floating-label,
input.has-value + .floating-label {
  color: var(--sage-dark);
  font-size: 0.72rem;
  transform: translateY(-20px);
}

.select-arrow {
  position: absolute;
  top: 45px;
  right: 25px;
  z-index: 2;
  width: 20px;
  fill: none;
  stroke: var(--sage-dark);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  pointer-events: none;
}

.field-message {
  display: inline-block;
  margin: 14px 0 0;
  padding: 5px 10px;
  border-radius: 999px;
  color: #59635f;
  background: #edf0ee;
  font-size: 0.7rem;
  font-weight: 600;
}

.question-card.is-answered .field-message {
  color: var(--sage-dark);
  background: #e3eee7;
}

.question-card.is-invalid {
  box-shadow: 0 0 0 2px rgba(215, 106, 95, 0.9), var(--shadow);
}

.question-card.is-invalid .field-message {
  color: var(--error);
  background: #f9e5e2;
}

.form-error {
  min-height: 20px;
  margin: -3px 0 0;
  color: #fff2c7;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: center;
}

.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  justify-self: center;
  padding: 15px 24px;
  border-radius: 5px;
  color: var(--sage-deep);
  background: var(--white);
  box-shadow: var(--shadow);
  font-weight: 700;
}

.submit-button svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.submit-button.is-submitting svg {
  animation: submit-spin 800ms linear infinite;
}

.progress-dock {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 70px;
  padding: 9px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.17);
  color: var(--white);
  background: rgba(24, 34, 30, 0.94);
  backdrop-filter: blur(12px);
}

.progress-track {
  width: min(160px, 30vw);
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.2);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 240ms ease;
}

.progress-dock p {
  margin: 0;
  font-size: 0.82rem;
}

.progress-dock strong {
  font-size: 1.04rem;
}

.progress-dock button {
  display: grid;
  width: 44px;
  height: 44px;
  justify-self: end;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.progress-dock button.is-ready {
  color: var(--sage-deep);
  background: var(--gold);
}

.progress-dock button svg {
  width: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.success-screen {
  display: grid;
  place-items: center;
  padding: 30px;
  background:
    radial-gradient(circle at 50% 35%, rgba(184, 203, 191, 0.46), transparent 30%),
    var(--paper);
}

.success-content {
  width: calc(100vw - 60px);
  max-width: 520px;
  min-width: 0;
  text-align: center;
}

.success-icon {
  display: grid;
  width: 82px;
  height: 82px;
  margin: 0 auto 25px;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--sage-deep);
  box-shadow: 0 16px 40px rgba(32, 61, 51, 0.25);
}

.success-icon svg {
  width: 38px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.success-content h2 {
  font-size: clamp(2.3rem, 8vw, 4rem);
  line-height: 1.06;
}

.success-content > p:not(.eyebrow) {
  margin: 18px 0 30px;
  color: var(--ink-soft);
}

.secondary-button {
  padding: 14px 20px;
  border: 1px solid rgba(32, 61, 51, 0.35);
  border-radius: 5px;
  color: var(--sage-deep);
  background: transparent;
  font-weight: 700;
}

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

@keyframes submit-spin {
  to { transform: rotate(360deg); }
}

@media (min-width: 840px) {
  .app-shell {
    width: min(100%, 1280px);
    margin: 0 auto;
    box-shadow: 0 0 80px rgba(20, 35, 29, 0.14);
  }

  .survey-background,
  .survey-overlay,
  .progress-dock {
    right: max(0px, calc((100vw - 1280px) / 2));
    left: max(0px, calc((100vw - 1280px) / 2));
  }

  .survey-scroll {
    padding-top: 80px;
  }
}

@media (max-width: 520px) {
  .welcome-screen {
    padding: 38px 24px;
  }

  .welcome-screen::before {
    inset: 10px;
    border-radius: 22px;
  }

  .brand-mark {
    width: 62px;
    height: 62px;
    margin-bottom: 18px;
  }

  .welcome-content h1 br {
    display: none;
  }

  .survey-meta {
    gap: 14px;
    margin: 24px 0 28px;
  }

  .survey-scroll {
    padding: 36px 14px 110px;
  }

  .survey-header {
    margin-bottom: 26px;
    padding-left: 50px;
  }

  .question-card > label {
    padding: 15px 18px;
  }

  .answer-area {
    min-height: 116px;
    padding: 27px 20px 16px;
  }

  .floating-label {
    top: 39px;
    left: 20px;
  }

  .select-arrow {
    top: 42px;
    right: 21px;
  }

  .progress-dock {
    min-height: 64px;
    padding: 8px 14px;
  }

  .progress-track {
    width: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
