/* HST Remit Lab — MarcBotAI / Marc Stevens */
:root {
  --bg: #f2f1ec;
  --surface: #faf9f6;
  --ink: #141816;
  --muted: #5c615c;
  --subtle: #8a8f8a;
  --border: #e0e2dc;
  --accent: #1a3d36;
  --accent-hover: #122c27;
  --accent-soft: rgba(26, 61, 54, 0.1);
  --teal: #0d7377;
  --teal-soft: rgba(13, 115, 119, 0.12);
  --save: #1a6b4a;
  --save-bg: #e8f5ef;
  --cost: #9b2c2c;
  --cost-bg: #fef2f2;
  --result-bg: #1a3d36;
  --result-ink: #f7f6f2;
  --result-muted: #a8b5b1;
  --warn-bg: #faf6eb;
  --warn-border: #e4d9b8;
  --warn-ink: #5c4a1f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 24, 22, 0.06), 0 12px 32px rgba(20, 24, 22, 0.08);
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--teal);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(960px, 100% - 2rem);
  margin-inline: auto;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.brand-name {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-tag {
  font-size: 0.85rem;
  color: var(--muted);
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
}

.hero {
  padding: 2.25rem 0 1.5rem;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

.hero p.lead {
  margin: 0;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.disclaimer {
  margin: 1.25rem 0 0;
  padding: 1rem 1.15rem;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  color: var(--warn-ink);
  font-size: 0.9rem;
}

.disclaimer strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.4rem;
  margin-bottom: 1.25rem;
}

.panel h2 {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.panel h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.25rem 0 0.65rem;
  color: var(--ink);
}

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

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 860px) {
  .layout {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 1.25rem;
    align-items: start;
  }
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--ink);
}

.hint {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--subtle);
  margin-top: 0.25rem;
}

.field {
  margin-bottom: 0.15rem;
}

.input-row {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-row:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.prefix,
.suffix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: #f4f5f2;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  border: none;
  outline: none;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-size: 1rem;
  background: transparent;
  color: var(--ink);
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.segmented label.seg {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  margin: 0;
}

.segmented input {
  accent-color: var(--teal);
}

.segmented label.seg:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--accent);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.85rem;
  font-size: 0.9rem;
}

.check-row input {
  margin-top: 0.2rem;
  accent-color: var(--teal);
}

.check-row label {
  font-weight: 500;
  margin: 0;
  cursor: pointer;
}

.rate-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
  padding: 0.65rem 0.8rem;
  background: var(--accent-soft);
  border-radius: 10px;
}

.results {
  background: var(--result-bg);
  color: var(--result-ink);
  border: none;
}

.results h2 {
  color: var(--result-ink);
}

.result-grid {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 480px) {
  .result-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.result-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.result-card .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--result-muted);
  margin-bottom: 0.25rem;
}

.result-card .value {
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.result-card.span-2 {
  grid-column: 1 / -1;
}

.verdict {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.95rem;
  line-height: 1.5;
}

.verdict.save {
  background: rgba(26, 107, 74, 0.35);
}

.verdict.cost {
  background: rgba(155, 44, 44, 0.35);
}

.verdict.neutral {
  background: rgba(255, 255, 255, 0.1);
}

.math-box {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--result-muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  white-space: pre-wrap;
  line-height: 1.45;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  border: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: #e8f0ee;
  color: var(--accent);
}

.btn-primary:hover {
  background: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--result-muted);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-ghost:hover {
  color: var(--result-ink);
  border-color: rgba(255, 255, 255, 0.4);
}

.unlock {
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.unlock p {
  margin: 0;
  flex: 1 1 200px;
  font-size: 0.85rem;
  color: var(--result-muted);
}

.rates-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 0.5rem 0 0;
}

.rates-table th,
.rates-table td {
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
}

.rates-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--subtle);
  font-weight: 600;
}

.site-footer {
  padding: 2rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
