:root {
  color-scheme: light;
  --ink: #111713;
  --muted: #657069;
  --line: #d9ddd6;
  --surface: #ffffff;
  --canvas: #f6f6f1;
  --green: #0d5d43;
  --green-dark: #0b3e30;
  --yellow: #f6cb57;
  --font-body: "DM Sans", sans-serif;
  --font-display: "Manrope", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 320px; background: var(--canvas); }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select { font: inherit; }

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

.calculator-header {
  width: min(1180px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: inline-flex; align-items: center; }

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  transform: rotate(45deg);
}

.brand-mark i { display: block; border-radius: 3px; background: var(--green); }
.brand-mark i:last-child { background: var(--yellow); }

.quiet-link { color: var(--ink); font-size: 13px; font-weight: 700; text-decoration: none; }
.quiet-link:hover { text-decoration: underline; }

.calculator-page {
  width: min(1180px, calc(100% - 40px));
  margin: 24px auto 56px;
}

.calculator-intro { max-width: 760px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; }

.calculator-intro h1 {
  max-width: 17ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.calculator-intro > p:last-child { max-width: 650px; margin: 18px 0 0; color: var(--muted); font-size: 17px; line-height: 1.55; }

.calculator-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 18px 54px rgba(22, 31, 26, 0.06); }

.step-header { padding: 22px 30px 20px; border-bottom: 1px solid var(--line); background: #fbfbf8; }
.step-heading { display: flex; justify-content: space-between; gap: 20px; font-size: 12px; }
.step-heading span { color: var(--muted); }
.step-heading strong { color: var(--green); }

.progress-track { height: 4px; margin: 13px 0 18px; overflow: hidden; border-radius: 999px; background: #e5e7e1; }
.progress-track i { width: 25%; height: 100%; display: block; border-radius: inherit; background: var(--green); transition: width 220ms ease; }

.step-list { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; }
.step-list li { display: flex; align-items: center; gap: 8px; color: #8a938e; font-size: 11px; }
.step-list span { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #cfd4cd; border-radius: 50%; font-size: 10px; font-style: normal; }
.step-list em { font-style: normal; }
.step-list li.is-complete,
.step-list li[aria-current="step"] { color: var(--ink); font-weight: 700; }
.step-list li.is-complete span,
.step-list li[aria-current="step"] span { color: white; border-color: var(--green); background: var(--green); }

.calculator-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; }
.wizard { min-width: 0; padding: 38px; }
.wizard fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.wizard legend { padding: 0; font-family: var(--font-display); font-size: clamp(25px, 3vw, 34px); font-weight: 700; line-height: 1.12; letter-spacing: -0.025em; }
.step-copy { max-width: 630px; margin: 12px 0 28px; color: var(--muted); line-height: 1.55; }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.choice-card { position: relative; min-height: 174px; padding: 24px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fbfbf8; cursor: pointer; transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease; }
.choice-card:hover { transform: translateY(-2px); border-color: #aab6ae; }
.choice-card:has(input:checked) { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green), 0 10px 24px rgba(13, 93, 67, 0.08); background: #f5faf7; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card strong { font-family: var(--font-display); font-size: 20px; }
.choice-card small { max-width: 32ch; color: var(--muted); line-height: 1.45; }
.choice-check { position: absolute; top: 20px; right: 20px; width: 20px; height: 20px; border: 1px solid #bbc2bd; border-radius: 50%; background: white; }
.choice-card:has(input:checked) .choice-check { border: 5px solid var(--green); }
.choice-card:focus-within { outline: 3px solid rgba(13, 93, 67, 0.18); outline-offset: 3px; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field-grid label { display: grid; gap: 8px; color: #414943; font-size: 12px; font-weight: 700; }
.field-grid input,
.field-grid select { width: 100%; min-height: 52px; padding: 0 14px; color: var(--ink); border: 1px solid #cbd1ca; border-radius: 8px; background: #fbfbf8; font-size: 16px; font-weight: 600; }
.field-grid input:focus,
.field-grid select:focus { outline: 3px solid rgba(13, 93, 67, 0.16); border-color: var(--green); }
.field-grid small { color: var(--muted); font-size: 10px; font-weight: 500; }
.included-benefit { min-height: 52px; padding: 12px 14px; display: flex; align-items: center; gap: 11px; border: 1px solid #b9d7c8; border-radius: 8px; color: var(--green-dark); background: #f3faf6; }
.included-benefit > span { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: white; background: var(--green); font-size: 12px; font-weight: 800; }
.included-benefit div { display: grid; gap: 3px; }
.included-benefit strong { font-size: 12px; }
.included-benefit small { color: var(--muted); font-size: 10px; line-height: 1.35; }

.billing-choice { margin-top: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.billing-choice label { position: relative; cursor: pointer; }
.billing-choice input { position: absolute; opacity: 0; }
.billing-choice span { min-height: 70px; padding: 15px 18px; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 9px; background: #fbfbf8; }
.billing-choice input:checked + span { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); background: #f5faf7; }
.billing-choice strong { font-size: 14px; }
.billing-choice small { color: var(--muted); font-size: 11px; }

.special-choice { margin-top: 18px; padding: 16px 18px; display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.special-choice input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--green); }
.special-choice span { display: grid; gap: 3px; }
.special-choice strong { font-size: 13px; }
.special-choice small { color: var(--muted); font-size: 11px; line-height: 1.4; }

.form-error { margin: 16px 0 0; padding: 12px 14px; color: #852d28; border: 1px solid #e4b7b3; border-radius: 8px; background: #fff5f4; font-size: 12px; }

.wizard-actions { margin-top: 34px; padding-top: 22px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }
.button { min-height: 46px; padding: 0 24px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--green-dark); border-radius: 7px; color: white; background: var(--green-dark); font-weight: 700; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--green); }
.button:disabled { opacity: 0.55; cursor: wait; }
.button-secondary { color: var(--ink); border-color: var(--line); background: white; }
.button-secondary:hover { background: #f2f3ef; }

.live-summary { padding: 34px 30px; color: white; background: #17221d; }
.summary-kicker { margin: 0 0 10px; color: var(--yellow); font-size: 9px; font-weight: 800; letter-spacing: 0.12em; }
.live-summary h2 { margin: 0; font-family: var(--font-display); font-size: 25px; }
.live-summary dl { margin: 28px 0 0; }
.live-summary dl div { padding: 13px 0; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid #344039; }
.live-summary dt { color: #aeb9b3; font-size: 11px; }
.live-summary dd { margin: 0; font-size: 12px; font-weight: 700; text-align: right; }
.summary-note { margin: 28px 0 0; color: #aeb9b3; font-size: 11px; line-height: 1.5; }

.quote-loading { min-height: 290px; display: grid; place-items: center; align-content: center; text-align: center; }
.quote-loading strong { margin-top: 18px; font-family: var(--font-display); font-size: 22px; }
.quote-loading p { max-width: 390px; color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid #dfe4de; border-top-color: var(--green); border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.quote-result { min-height: 290px; }
.result-badge { display: inline-flex; padding: 6px 9px; border-radius: 999px; color: var(--green-dark); background: #dfeee7; font-size: 9px; font-weight: 800; letter-spacing: 0.08em; }
.result-badge.manual { color: #714e00; background: #fff0bd; }
.manual-reasons { margin: 18px 0 22px; padding: 14px 16px 14px 34px; color: #714e00; border: 1px solid #ead59b; border-radius: 9px; background: #fffaf0; font-size: 12px; }
.manual-reasons li + li { margin-top: 6px; }
.quote-result h2 { max-width: 18ch; margin: 15px 0 10px; font-family: var(--font-display); font-size: clamp(28px, 4vw, 40px); line-height: 1.05; }
.quote-result > p { max-width: 620px; color: var(--muted); line-height: 1.55; }
.result-price { margin: 26px 0 20px; display: flex; align-items: baseline; gap: 8px; }
.result-price strong { font-family: var(--font-display); font-size: 38px; }
.result-price span { color: var(--muted); font-size: 12px; }
.result-details { margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 9px; list-style: none; overflow: hidden; }
.result-details li { padding: 15px; border-right: 1px solid var(--line); }
.result-details li:last-child { border-right: 0; }
.result-details span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.result-details strong { display: block; margin-top: 4px; font-size: 12px; }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.edit-link { color: var(--green); border: 0; background: none; font-weight: 700; cursor: pointer; }
.handoff-steps { margin-top: 24px; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.handoff-steps span::before { content: "✓"; margin-right: 5px; color: var(--green); font-weight: 800; }

.calculator-footnote { margin: 18px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 840px) {
  .calculator-layout { grid-template-columns: 1fr; }
  .live-summary { order: -1; padding: 24px 28px; }
  .live-summary dl { display: grid; grid-template-columns: repeat(2, 1fr); }
  .live-summary dl div { margin-right: 18px; }
  .summary-note { margin-top: 18px; }
}

@media (max-width: 600px) {
  .calculator-header,
  .calculator-page { width: min(100% - 24px, 1180px); }
  .calculator-header { min-height: 64px; }
  .calculator-page { margin-top: 12px; }
  .calculator-intro h1 { font-size: 35px; }
  .calculator-intro > p:last-child { font-size: 15px; }
  .step-header { padding: 18px; }
  .step-list em { display: none; }
  .step-list li { justify-content: center; }
  .wizard { padding: 26px 20px; }
  .choice-grid,
  .field-grid,
  .billing-choice { grid-template-columns: 1fr; }
  .choice-card { min-height: 138px; }
  .live-summary { padding: 24px 20px; }
  .live-summary dl { grid-template-columns: 1fr; }
  .live-summary dl div { margin-right: 0; }
  .wizard-actions { justify-content: stretch; }
  .wizard-actions .button { flex: 1; padding: 0 16px; }
  .result-details { grid-template-columns: 1fr; }
  .result-details li { border-right: 0; border-bottom: 1px solid var(--line); }
  .result-details li:last-child { border-bottom: 0; }
  .result-actions .button { width: 100%; }
}

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