:root {
  color-scheme: light;
  --ink: #152d36;
  --muted: #5c6d73;
  --brand: #075b62;
  --brand-dark: #034148;
  --brand-soft: #e6f3f2;
  --accent: #d79628;
  --surface: #ffffff;
  --canvas: #f3f6f5;
  --line: #d5dfdc;
  --line-strong: #9eb1ad;
  --danger: #a52a2a;
  --danger-soft: #fff0ee;
  --success: #176b46;
  --success-soft: #e8f6ef;
  --focus: #117f91;
  --shadow: 0 18px 48px rgba(19, 50, 58, 0.1);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, rgba(7, 91, 98, 0.08), transparent 30rem),
    var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

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

button,
label,
select,
input[type="radio"],
input[type="checkbox"] {
  cursor: pointer;
}

a {
  color: var(--brand);
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  color: white;
  background: var(--brand-dark);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(17, 127, 145, 0.45);
  outline-offset: 3px;
}

.site-header {
  color: white;
  background: linear-gradient(122deg, var(--brand-dark), var(--brand) 70%, #26777b);
  border-bottom: 4px solid var(--accent);
}

.site-header__inner {
  display: flex;
  width: min(100% - 2rem, 1040px);
  margin: 0 auto;
  padding: 1.6rem 0;
  align-items: center;
  gap: 1rem;
}

.brand-mark {
  display: grid;
  flex: 0 0 3.25rem;
  width: 3.25rem;
  height: 3.25rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  place-items: center;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.18;
}

.eyebrow,
.header-subtitle {
  margin: 0;
}

.eyebrow {
  color: #d1edeb;
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.header-subtitle {
  margin-top: 0.2rem;
  color: #e4f3f2;
  font-size: 0.93rem;
}

.page-shell {
  width: min(100% - 2rem, 1040px);
  min-height: calc(100vh - 13rem);
  margin: 2rem auto;
}

.panel {
  padding: clamp(1.2rem, 4vw, 2.4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel--narrow {
  width: min(100%, 680px);
  margin-inline: auto;
}

.panel h2,
.panel h3 {
  line-height: 1.25;
}

.panel h2 {
  margin: 0.2rem 0 0.65rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.step-kicker {
  margin: 0;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.privacy-note,
.section-note,
.draft-note {
  margin: 1.25rem 0;
  padding: 1rem 1.05rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: #fff8e9;
}

.privacy-note p,
.section-note p,
.draft-note p {
  margin: 0.25rem 0 0;
}

.draft-note {
  border-left-color: var(--brand);
  background: var(--brand-soft);
}

label,
legend {
  color: var(--ink);
  font-weight: 700;
}

.input-action {
  display: flex;
  margin-top: 0.45rem;
  gap: 0.65rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  background: white;
}

textarea {
  min-height: 7.5rem;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--brand);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(17, 127, 145, 0.13);
  outline: 0;
}

.button {
  display: inline-flex;
  min-height: 2.85rem;
  padding: 0.65rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 9px;
  align-items: center;
  justify-content: center;
  font-weight: 750;
  line-height: 1.2;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.button--primary {
  color: white;
  background: var(--brand);
}

.button--primary:hover:not(:disabled) {
  background: var(--brand-dark);
}

.button--secondary {
  border-color: var(--line-strong);
  color: var(--brand-dark);
  background: white;
}

.button--secondary:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.progress-wrap {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.progress-meta {
  display: flex;
  margin-bottom: 0.45rem;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe8e6;
}

.progress-bar {
  width: 17%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #3c8f8e);
  transition: width 200ms ease;
}

.step-list {
  display: grid;
  margin: 1rem 0 0;
  padding: 0;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
  list-style: none;
}

.step-list li {
  color: var(--muted);
  font-size: 0.71rem;
  text-align: center;
}

.step-list .step-number {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  margin: 0 auto 0.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  place-items: center;
  background: white;
  font-size: 0.76rem;
  font-weight: 800;
}

.step-list li.is-active,
.step-list li.is-complete {
  color: var(--brand-dark);
  font-weight: 700;
}

.step-list li.is-active .step-number {
  border-color: var(--brand);
  color: white;
  background: var(--brand);
}

.step-list li.is-complete .step-number {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.step-heading {
  margin: 1.65rem 0 1.25rem;
}

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

.step-heading p:last-child {
  margin: 0;
  color: var(--muted);
}

.fields {
  display: grid;
  gap: 1.35rem;
}

.field-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-label,
.field-group legend {
  display: block;
  margin-bottom: 0.5rem;
}

.required-mark {
  margin-left: 0.22rem;
  color: var(--danger);
}

.field-help,
.character-count {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.character-count {
  text-align: right;
}

.field-error {
  min-height: 1.2rem;
  margin: 0.35rem 0 0;
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 650;
}

.field-group.has-error input,
.field-group.has-error select,
.field-group.has-error textarea,
.field-group.has-error .option-card {
  border-color: var(--danger);
}

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

.option-card {
  display: flex;
  min-height: 3.15rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  align-items: flex-start;
  gap: 0.65rem;
  background: #fbfcfc;
  font-weight: 520;
  line-height: 1.35;
}

.option-card:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.option-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.option-card input {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.12rem 0 0;
  accent-color: var(--brand);
}

.conditional-field {
  margin-top: 0.7rem;
  padding: 0.85rem;
  border-radius: 10px;
  background: #f7f9f9;
}

.metric-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 0.65rem;
}

.metric-note {
  grid-column: 1 / -1;
}

.autocomplete {
  position: relative;
}

.autocomplete-results {
  position: absolute;
  z-index: 15;
  right: 0;
  left: 0;
  max-height: 17rem;
  margin: 0.25rem 0 0;
  padding: 0.3rem;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: white;
  box-shadow: 0 15px 35px rgba(19, 50, 58, 0.18);
  list-style: none;
}

.autocomplete-results button {
  display: block;
  width: 100%;
  padding: 0.7rem;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.autocomplete-results button:hover,
.autocomplete-results button:focus {
  background: var(--brand-soft);
  outline: 0;
}

.autocomplete-results small {
  display: block;
  margin-top: 0.1rem;
  color: var(--muted);
}

.alert {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border-radius: 9px;
}

.alert--error {
  border: 1px solid #e8b6af;
  color: #782020;
  background: var(--danger-soft);
}

.alert--info {
  border: 1px solid #a8d1cd;
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.form-actions {
  display: flex;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  justify-content: space-between;
  gap: 0.75rem;
}

.review-header {
  display: flex;
  margin-bottom: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.review-header h3 {
  margin: 0.2rem 0 0;
  font-size: 1.35rem;
}

.review-card {
  margin: 0 0 1rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfc;
}

.review-card__header {
  display: flex;
  margin-bottom: 0.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.review-card h4 {
  margin: 0;
  font-size: 1.05rem;
}

.review-edit {
  padding: 0.35rem 0.55rem;
  border: 0;
  color: var(--brand);
  background: transparent;
  font-weight: 750;
  text-decoration: underline;
}

.review-list {
  display: grid;
  margin: 0;
  gap: 0.65rem;
}

.review-list div {
  display: grid;
  grid-template-columns: minmax(9rem, 0.45fr) minmax(0, 1fr);
  gap: 0.8rem;
}

.review-list dt {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.review-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.success-icon {
  display: grid;
  width: 4rem;
  height: 4rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-soft);
  place-items: center;
  font-size: 2rem;
  font-weight: 900;
}

.protocol {
  padding: 0.75rem;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  overflow-wrap: anywhere;
  background: #f7f9f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
}

.site-footer {
  display: flex;
  width: min(100% - 2rem, 1040px);
  margin: 0 auto;
  padding: 0.5rem 0 2rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.site-footer p {
  margin: 0;
}

.is-hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 700px) {
  .page-shell {
    width: min(100% - 1rem, 1040px);
    margin-block: 0.8rem 1.5rem;
  }

  .site-header__inner,
  .site-footer {
    width: min(100% - 1.5rem, 1040px);
  }

  .panel {
    border-radius: 13px;
  }

  .step-list li span:last-child {
    display: none;
  }

  .option-grid,
  .metric-grid,
  .review-list div {
    grid-template-columns: 1fr;
  }

  .review-list div {
    gap: 0.1rem;
  }

  .input-action,
  .review-header {
    align-items: stretch;
    flex-direction: column;
  }

  .input-action .button,
  .review-header .button {
    width: 100%;
  }

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

@media (max-width: 420px) {
  .brand-mark {
    flex-basis: 2.7rem;
    width: 2.7rem;
    height: 2.7rem;
  }

  .site-header__inner {
    align-items: flex-start;
  }

  .form-actions {
    flex-wrap: wrap;
  }

  .form-actions .button {
    flex: 1 1 100%;
  }

  #previous-button {
    order: 2;
  }
}

@media print {
  body {
    background: white;
  }

  .site-header,
  .progress-wrap,
  .step-heading,
  .fields,
  .form-actions,
  .site-footer,
  .review-header .button {
    display: none !important;
  }

  .page-shell,
  .panel {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .review {
    display: block !important;
  }

  .review-card {
    break-inside: avoid;
  }
}

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