:root {
  --ink: #202426;
  --muted: #5c666b;
  --line: #d8dee1;
  --paper: #ffffff;
  --wash: #f5f7f6;
  --green: #1f705d;
  --green-dark: #155241;
  --clay: #b9573c;
  --amber: #d49b2f;
  --focus: #156fd1;
  --shadow: 0 18px 50px rgba(32, 36, 38, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #ffffff 0, #f7f4ee 260px, var(--wash) 261px);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 24px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-logo {
  width: 112px;
  height: 112px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
}

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0;
}

h1 {
  font-size: 2.1rem;
}

h2 {
  font-size: 1.55rem;
}

h3 {
  font-size: 1.02rem;
}

.phone-link {
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 42px;
}

.step-rail {
  align-self: start;
  position: sticky;
  top: 18px;
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.step-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  text-align: left;
}

.step-tab span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--green-dark);
  background: #e4f0eb;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 700;
}

.step-tab.is-active {
  color: var(--ink);
  background: #f4faf7;
  border-color: #b7d7cc;
  font-weight: 700;
}

.step-tab.is-active span {
  color: #fff;
  background: var(--green);
}

.form-panel {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

form {
  display: grid;
  gap: 26px;
  padding: 28px;
}

.form-step {
  display: grid;
  gap: 22px;
}

.form-step.is-active {
  display: grid;
}

.step-heading {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

label,
fieldset {
  min-width: 0;
}

label {
  display: grid;
  gap: 7px;
}

label span,
legend {
  color: #344044;
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #bfc9ce;
  border-radius: 6px;
  padding: 10px 12px;
  outline: none;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(21, 111, 209, 0.14);
}

[aria-invalid="true"] {
  border-color: var(--clay);
}

.field-grid {
  display: grid;
  gap: 16px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-row,
.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.choice-row legend,
.check-grid legend {
  width: 100%;
  margin-bottom: 2px;
}

.choice-row label,
.check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: var(--ink);
  font-weight: 400;
}

.choice-row input,
.check-grid input {
  width: 18px;
  min-height: 18px;
}

.quote-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quote-toggle legend {
  width: 100%;
  margin-bottom: 2px;
  grid-column: 1 / -1;
}

.quote-toggle label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px 14px;
  color: var(--muted);
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
}

.quote-toggle input {
  width: 18px;
  min-height: 18px;
}

.quote-toggle label:has(input:checked) {
  color: var(--ink);
  background: #f4faf7;
  border-color: #8fc5b5;
}

.conditional {
  display: none;
}

.conditional.is-visible {
  display: grid;
}

.auto-area.is-visible {
  gap: 18px;
}

.repeater-heading,
.card-title,
.review-actions,
.form-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.repeater-list {
  display: grid;
  gap: 14px;
}

.repeater-card {
  display: grid;
  gap: 16px;
  padding: 16px;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.review-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.summary-box {
  min-height: 420px;
  max-height: 60vh;
  overflow: auto;
  margin: 0;
  padding: 18px;
  color: #172022;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.92rem;
}

.form-nav {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.primary,
.secondary,
.text-button {
  min-height: 42px;
  border-radius: 6px;
  font-weight: 700;
}

.primary {
  padding: 9px 16px;
  color: #fff;
  background: var(--green);
  border: 1px solid var(--green);
}

.primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.secondary {
  padding: 9px 16px;
  color: var(--green-dark);
  background: #f3f8f6;
  border: 1px solid #b7d7cc;
}

.secondary:hover {
  background: #e8f3ef;
}

.text-button {
  min-height: 34px;
  padding: 4px 8px;
  color: var(--clay);
  background: transparent;
  border: 1px solid transparent;
}

.text-button:hover {
  border-color: #e2b8ad;
  background: #fff6f3;
}

.submission-status {
  display: none;
  margin: -4px 0 0;
  padding: 12px 14px;
  color: var(--green-dark);
  background: #f3f8f6;
  border: 1px solid #b7d7cc;
  border-radius: 8px;
  font-weight: 700;
}

.submission-status.is-error {
  display: block;
  color: #7a2d1d;
  background: #fff6f3;
  border-color: #e2b8ad;
}

.submission-status.is-success {
  display: block;
}

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

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

.mode-review .current-address-field {
  grid-column: 1 / -1;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 320px;
  padding: 12px 14px;
  color: #fff;
  background: #202426;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(32, 36, 38, 0.22);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 24px 16px 18px;
  }

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

  .brand-logo {
    width: 84px;
    height: 84px;
  }

  h1 {
    font-size: 1.7rem;
  }

  .app-shell {
    padding: 0 16px 28px;
  }

  .step-rail {
    position: static;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow-x: auto;
  }

  .step-tab {
    justify-content: center;
    min-width: 96px;
    font-size: 0.86rem;
  }

  .step-tab span {
    width: 24px;
    height: 24px;
  }

  form {
    padding: 20px;
  }

  .field-grid.two,
  .field-grid.three,
  .quote-toggle {
    grid-template-columns: 1fr;
  }

  .review-actions,
  .form-nav {
    align-items: stretch;
    flex-direction: column;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .step-rail,
  .form-nav,
  .review-actions,
  .submission-status {
    display: none;
  }

  .app-shell {
    display: block;
    padding: 0;
  }

  .form-panel {
    border: 0;
    box-shadow: none;
  }

  form {
    padding: 0;
  }

  .form-step {
    display: none !important;
  }

  .form-step[data-step="4"] {
    display: grid !important;
  }

  .summary-box {
    max-height: none;
    border: 0;
    border-radius: 0;
  }
}
