/* Closing cost calculator: inputs on the left, the estimate on the right */

.hero--small { padding-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.hero--small h1 { font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4.4rem); }

.calc { display: grid; gap: 1.5rem; padding-bottom: clamp(3rem, 6vw, 4.5rem); }
@media (min-width: 56rem) { .calc { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: start; } }

.calc__inputs, .calc__results { padding: clamp(1.25rem, 4vw, 2rem); border: 1px solid var(--line); background: #fff; }
.calc__inputs { display: grid; gap: 1.25rem; }
.calc__inputs > div { display: grid; gap: 1.25rem; }
.calc__inputs [hidden] { display: none !important; }
@media (min-width: 56rem) { .calc__results { position: sticky; top: 1.5rem; } }

.calc .form__field { display: grid; gap: 0.35rem; font-size: 0.8rem; font-weight: 500; }
.calc .form__field em { font-style: normal; font-weight: 400; color: var(--muted); }
.calc .form__field input, .calc .form__field select {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: 1rem var(--font);
}
.calc .form__field :focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.money, .percent { position: relative; display: block; }
.money input { padding-left: 1.6rem !important; }
.percent input { padding-right: 2rem !important; }
.money::before, .percent::after { position: absolute; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1rem; pointer-events: none; }
.money::before { content: '$'; left: 0.75rem; }
.percent::after { content: '%'; right: 0.85rem; }

/* Two-option toggles */
.seg { display: grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 0; border: 0; }
.seg legend { grid-column: 1 / -1; margin-bottom: 0.5rem; padding: 0; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: grid;
  place-items: center;
  min-height: 2.8rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  font-size: 0.92rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
}
.seg label + label span { border-left: 0; }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The estimate */
.calc__total { margin-top: 0.4rem; font-size: clamp(1.9rem, 1.4rem + 2vw, 2.8rem); font-weight: 300; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.calc__sub { margin-top: 0.5rem; color: var(--muted); font-size: 0.92rem; }
.calc__summary { margin-top: 1.25rem; padding: 0.9rem 1rem; background: var(--soft); font-size: 0.95rem; }
.calc__summary div, .calc__group li { display: flex; justify-content: space-between; gap: 1rem; font-variant-numeric: tabular-nums; }
.calc__summary div + div { margin-top: 0.35rem; }
.calc__summary-total { margin-top: 0.6rem !important; padding-top: 0.6rem; border-top: 1px solid var(--line); font-weight: 600; }
.calc__group { margin-top: 1.5rem; }
.calc__group h3 { padding-bottom: 0.5rem; border-bottom: 1px solid var(--ink); }
.calc__group li { padding-block: 0.6rem; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.calc__group li > span:first-child { display: grid; }
.calc__group em { font-style: normal; font-size: 0.78rem; color: var(--muted); }
.calc__group li > span:last-child { display: grid; justify-items: end; white-space: nowrap; }
/* Mortgage calculator: one bar split by each monthly cost, with matching color keys in the list */
.calc__bar { display: flex; gap: 3px; height: 0.9rem; margin-block: 1rem 0.4rem; }
.calc__bar span { min-width: 3px; }
.calc__key { display: flex !important; align-items: flex-start; gap: 0.7rem; }
.calc__key > i { flex: none; width: 0.8rem; height: 0.8rem; margin-top: 0.3rem; }
.calc__key > span { display: grid; }
.calc__swatch--1 { background: var(--ink); }
.calc__swatch--2 { background: var(--accent); }
.calc__swatch--3 { background: #c79a6c; }
.calc__swatch--4 { background: #a8a196; }
.calc__hint { margin-top: 1rem; font-size: 0.85rem; color: var(--accent); }
.calc__hint--quiet { color: var(--muted); }
/* The next step to the other calculator (same home carried over), then the buttons side by side */
.calc__next { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.75rem; padding: 0.9rem 1.1rem; border: 1px solid var(--ink); color: var(--ink); text-decoration: none; transition: background 0.15s, color 0.15s; }
.calc__next strong { display: block; font-size: 0.98rem; font-weight: 600; }
.calc__next em { display: block; margin-top: 0.15rem; font-size: 0.8rem; font-style: normal; color: var(--muted); }
.calc__next > span:last-child { font-size: 1.15rem; }
.calc__next:hover, .calc__next:focus-visible { background: var(--ink); color: var(--paper); }
.calc__next:hover em, .calc__next:focus-visible em { color: inherit; }
.calc__actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.75rem; margin-top: 1.75rem; }
.calc__next + .calc__actions { margin-top: 0.75rem; }
.calc__actions .btn { width: 100%; min-width: 0; padding-inline: 0.75rem; text-align: center; }
.calc__rate-note { font-size: 0.78rem; line-height: 1.45; }

.calc-notes { max-width: 52rem; padding-bottom: clamp(3rem, 6vw, 5rem); }
.calc-notes p { margin-top: 0.9rem; font-size: 0.88rem; color: var(--muted); }
.calc-notes a { color: inherit; }

/* Two short inputs side by side (shares and amount per share, maintenance and months) */
.calc__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
