:root {
  --bg: #f5f7f2;
  --surface: #ffffff;
  --surface-alt: #eef3ea;
  --ink: #17211b;
  --muted: #5f6c64;
  --line: #d7ded4;
  --accent: #1f7a5a;
  --accent-dark: #14543e;
  --accent-soft: #dff1e8;
  --warn: #7b4a13;
  --shadow: 0 18px 45px rgba(23, 33, 27, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 242, 0.94);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: white;
}

nav {
  display: none;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

nav a {
  text-decoration: none;
}

main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.5rem, 4vw, 3rem) 0 1rem;
}

.hero-copy {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(2.25rem, 9vw, 4.75rem);
}

h2 {
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.intro {
  max-width: 720px;
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
}

.trust-list li {
  padding: 0.42rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 800;
}

.tool-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1rem 0 2.5rem;
}

.calculator-panel,
.results-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.calculator-panel {
  padding: clamp(1rem, 4vw, 1.5rem);
}

.results-panel {
  padding: clamp(1rem, 4vw, 1.5rem);
}

.panel-heading {
  margin-bottom: 1rem;
}

.field-grid {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
  color: var(--ink);
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
}

input {
  padding: 0.72rem 0.9rem;
}

select {
  padding: 0.72rem 0.8rem;
}

input:focus,
select:focus {
  outline: 3px solid rgba(31, 122, 90, 0.2);
  border-color: var(--accent);
}

.input-prefix,
.input-suffix {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  overflow: hidden;
}

.input-suffix {
  grid-template-columns: 1fr auto;
}

.input-prefix span,
.input-suffix span {
  padding: 0 0.8rem;
  color: var(--muted);
  font-weight: 800;
}

.input-prefix input,
.input-suffix input {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.input-prefix:focus-within,
.input-suffix:focus-within {
  outline: 3px solid rgba(31, 122, 90, 0.2);
  border-color: var(--accent);
}

.form-note,
.disclaimer {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.result-hero {
  display: grid;
  gap: 0.2rem;
  padding: 1rem;
  border-radius: 8px;
  background: var(--accent-soft);
}

.result-hero span {
  color: var(--accent-dark);
  font-weight: 800;
}

.result-hero strong {
  font-size: clamp(2rem, 11vw, 3.5rem);
  line-height: 1;
}

.print-button {
  width: 100%;
  min-height: 2.8rem;
  margin-top: 0.9rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
}

.print-button:focus {
  outline: 3px solid rgba(31, 122, 90, 0.25);
  outline-offset: 3px;
}

.result-list,
.breakdown dl {
  display: grid;
  gap: 0.7rem;
  margin: 1rem 0 0;
}

.result-list div,
.breakdown dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  font-weight: 850;
  text-align: right;
}

.breakdown {
  margin-top: 1rem;
}

.breakdown summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 850;
}

.payment-schedule {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.payment-schedule h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.payment-schedule ol {
  display: grid;
  gap: 0.55rem;
  padding: 0;
  margin: 0.8rem 0 0;
  list-style: none;
}

.payment-schedule li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
}

.payment-schedule strong {
  color: var(--ink);
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 88px;
  padding: 1rem;
  border: 1px dashed #9cab9f;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  text-align: center;
}

.ad-slot span {
  font-size: 0.75rem;
  font-weight: 750;
  text-transform: uppercase;
}

.ad-slot strong {
  color: var(--ink);
}

.ad-slot-sidebar {
  display: none;
}

.content-section,
.faq-section {
  display: grid;
  gap: 1rem;
  max-width: 820px;
  padding: 2rem 0;
}

.content-section article,
.faq-section details {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.content-section p,
.faq-section p {
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.date-table {
  display: grid;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.date-table [role="row"] {
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: 1px solid var(--line);
}

.date-table [role="row"]:last-child {
  border-bottom: 0;
}

.date-table [role="columnheader"],
.date-table [role="cell"] {
  padding: 0.75rem;
}

.date-table [role="columnheader"] {
  display: none;
  background: var(--surface-alt);
  color: var(--ink);
  font-weight: 850;
}

.date-table [role="cell"] {
  color: var(--muted);
}

.date-table [role="cell"]:first-child {
  color: var(--ink);
  font-weight: 850;
}

.faq-section summary {
  cursor: pointer;
  font-weight: 850;
}

.site-footer {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 2rem clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.footer-links a {
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.legal-page {
  max-width: 820px;
  padding: clamp(1.5rem, 4vw, 3rem) 0;
}

.legal-page h1 {
  font-size: clamp(2rem, 8vw, 3.5rem);
}

.legal-page h2 {
  margin-top: 2rem;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
}

.legal-page ul {
  padding-left: 1.2rem;
}

@media (min-width: 720px) {
  nav {
    display: flex;
  }

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

  .date-table [role="row"] {
    grid-template-columns: 0.85fr 1.4fr 1fr;
  }

  .date-table [role="columnheader"] {
    display: block;
  }
}

@media (min-width: 980px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: end;
  }

  .tool-shell {
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr) 180px;
  }

  .results-panel {
    position: sticky;
    top: 5.5rem;
  }

  .ad-slot-sidebar {
    display: grid;
    min-height: 600px;
    position: sticky;
    top: 5.5rem;
  }
}

@media print {
  .site-header,
  .ad-slot,
  .content-section,
  .faq-section,
  .site-footer,
  .print-button {
    display: none;
  }

  body {
    background: white;
  }

  main {
    width: 100%;
  }

  .hero {
    padding: 0 0 1rem;
  }

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

  .calculator-panel,
  .results-panel {
    box-shadow: none;
    border-color: #999;
    break-inside: avoid;
    margin-bottom: 1rem;
  }
}
