/* BillFair — design system
   Palette: deep teal ink, warm paper, terracotta accent. */

:root {
  --ink: #0d2323;
  --ink-soft: #2c4444;
  --teal: #0f5c5b;
  --teal-dark: #0a4443;
  --mint: #e9f3ef;
  --mint-deep: #d3e8e0;
  --sand: #f8f5ec;
  --paper: #fffdf8;
  --accent: #c2653a;
  --accent-soft: #f6e5da;
  --line: #d8e2dd;
  --line-dark: #b9cbc4;
  --muted: #5f7370;
  --danger: #a3382c;
  --good: #1c6b4b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(13, 35, 35, .06), 0 10px 30px -18px rgba(13, 35, 35, .35);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 .5em;
  color: var(--ink);
}
h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.2em; }
li { margin: .35em 0; }
strong { font-weight: 650; }
small, .tiny { font-size: .82rem; }
.mono { font-family: var(--mono); font-size: .9em; }
.center { text-align: center; }
.wrap { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
.narrow { width: min(780px, calc(100% - 40px)); margin: 0 auto; }
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

/* Header */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 253, 248, .92);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.head-inner { display: flex; align-items: center; gap: 22px; padding: 12px 0; }
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--serif); font-size: 1.32rem; font-weight: 700;
  color: var(--ink); text-decoration: none; letter-spacing: -.02em;
}
.logo-mark { width: 30px; height: 30px; color: var(--teal); flex: none; }
.site-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-soft); text-decoration: none; font-size: .92rem;
  padding: 8px 11px; border-radius: 8px; font-weight: 500;
}
.site-nav a:hover { background: var(--mint); color: var(--teal-dark); }
.site-nav a.active { color: var(--teal-dark); background: var(--mint); }
.head-cta { margin-left: 4px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--teal); color: #fff; border: 1px solid var(--teal);
  padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: .97rem;
  text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s ease;
  font-family: var(--sans);
}
.btn:hover { background: var(--teal-dark); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--teal-dark); border-color: var(--line-dark); }
.btn-ghost:hover { background: var(--mint); color: var(--teal-dark); }
.btn-accent { background: var(--accent); border-color: var(--accent); }
.btn-accent:hover { background: #a7532e; }
.btn-sm { padding: 9px 15px; font-size: .88rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* Sections */
.section { padding: 64px 0; }
.section.tight { padding: 38px 0; }
.section.sand { background: var(--sand); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section.mint { background: var(--mint); }
.eyebrow {
  text-transform: uppercase; letter-spacing: .14em; font-size: .74rem;
  font-weight: 700; color: var(--accent); margin: 0 0 12px;
}
.lede { font-size: 1.16rem; color: var(--ink-soft); max-width: 62ch; }
.muted { color: var(--muted); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.section-head p { margin: 0; max-width: 54ch; color: var(--muted); }

/* Hero */
.hero { padding: 56px 0 40px; background: linear-gradient(180deg, var(--sand), var(--paper) 86%); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 52px; align-items: center; }
.hero h1 { margin-bottom: .35em; }
.hero .lede { font-size: 1.2rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 14px; }
.hero-note { font-size: .86rem; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.hero-note span::before { content: "✓"; color: var(--good); margin-right: 6px; font-weight: 700; }

.bill-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 22px 22px 18px; transform: rotate(-1.2deg);
  font-size: .92rem;
}
.bill-card .bc-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px dashed var(--line-dark); padding-bottom: 10px; margin-bottom: 12px; }
.bill-card .bc-title { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; }
.bill-card .bc-total { font-family: var(--serif); font-size: 1.9rem; font-weight: 700; color: var(--ink); }
.bill-card .bc-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; color: var(--ink-soft); }
.bill-card .bc-row span:last-child { font-variant-numeric: tabular-nums; }
.bill-card .bc-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-weight: 700; color: var(--good); }

/* Cards and grids */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: 0 1px 0 rgba(13,35,35,.02);
}
.card h3 { margin-bottom: .35em; }
.card p:last-child { margin-bottom: 0; }
.card-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.card-link:hover { border-color: var(--line-dark); transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.card-num { font-family: var(--serif); font-size: 1.9rem; color: var(--accent); line-height: 1; margin-bottom: 10px; }
.card-arrow { color: var(--accent); font-weight: 700; margin-top: 12px; display: inline-block; }

.trustbar { display: flex; gap: 10px 26px; flex-wrap: wrap; padding: 16px 0 0; font-size: .85rem; color: var(--muted); }
.trustbar span::before { content: "•"; color: var(--accent); margin-right: 7px; }

/* Steps */
.steps { counter-reset: step; display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
.step { position: relative; padding-left: 0; }
.step .step-n {
  width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: #fff;
  display: grid; place-items: center; font-weight: 700; margin-bottom: 12px;
}
.step h3 { font-size: 1.1rem; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 26px 0; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; }
.stat-value { font-family: var(--serif); font-size: 1.45rem; font-weight: 700; margin-top: 4px; line-height: 1.15; }
.stat-note { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* Badges */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem;
  font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
.badge.good { background: #dff1e6; color: var(--good); }
.badge.mid { background: #fbeedd; color: #8a5220; }
.badge.muted { background: #eceeed; color: #55605e; }
.badge.warn { background: var(--accent-soft); color: var(--accent); }
.badge.high { background: #f7ded9; color: var(--danger); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--mint); font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--teal-dark); font-weight: 700; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfc; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-note { font-size: .8rem; color: var(--muted); padding: 10px 14px; border-top: 1px solid var(--line); }

/* Prose */
.prose { max-width: 720px; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { margin: 0 0 1em; }
.prose .sources { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .86rem; color: var(--muted); }
.prose .sources li { margin: .3em 0; }
.prose blockquote { margin: 1.4em 0; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--sand); font-family: var(--serif); font-size: 1.05rem; }

/* Callouts */
.callout { border: 1px solid var(--line); background: var(--mint); border-radius: 12px; padding: 18px 20px; margin: 22px 0; }
.callout.warn { background: #fdf1ea; border-color: #f0d3c4; }
.callout.dark { background: var(--ink); color: #eef5f2; border-color: var(--ink); }
.callout.dark a { color: #bfe3d6; }
.callout h3 { margin-top: 0; font-size: 1.05rem; }
.callout p:last-child { margin-bottom: 0; }
.disclaimer-box {
  border: 1px solid #ecd9c9; background: #fdf7f1; border-radius: 12px;
  padding: 16px 18px; font-size: .86rem; color: #5d4a3c; margin-top: 30px;
}

/* FAQ */
.faqs { border-top: 1px solid var(--line); }
.faq { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 34px 16px 0; position: relative;
  font-weight: 600; font-size: 1.02rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 1.2rem; color: var(--accent); font-weight: 400;
}
.faq[open] summary::after { content: "–"; }
.faq-body { padding: 0 34px 14px 0; color: var(--ink-soft); }

/* CTA band */
.band { background: var(--ink); color: #eef5f2; }
.band h2 { color: #fff; }
.band p { color: #b9cfc8; margin: 0; }
.band-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.band-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.band .btn { background: var(--accent); border-color: var(--accent); }
.band .btn:hover { background: #a7532e; }
.band .btn-ghost { background: transparent; border-color: #3c5a56; color: #d7e8e2; }
.band .btn-ghost:hover { background: #163333; }

/* Breadcrumbs */
.crumbs { font-size: .82rem; color: var(--muted); padding: 22px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--teal); }
.crumbs .sep { color: var(--line-dark); }

/* Page head */
.page-head { padding: 20px 0 30px; }
.page-head h1 { max-width: 22ch; }
.page-head .lede { max-width: 70ch; }

/* Forms / app */
.app-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px; align-items: start; padding: 10px 0 60px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: 0 1px 2px rgba(13,35,35,.04); }
.panel h2 { font-size: 1.3rem; margin-bottom: 4px; }
.panel .panel-sub { color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .82rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 5px; }
.field .hint { font-size: .76rem; color: var(--muted); margin-top: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line-dark); border-radius: 9px;
  font: inherit; font-size: .95rem; background: #fff; color: var(--ink);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 3px solid rgba(15,92,91,.18); border-color: var(--teal); outline-offset: 0;
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1.4fr .8fr .8fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.form-note { font-size: .78rem; color: var(--muted); margin-top: 12px; }

.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-row label {
  border: 1px solid var(--line-dark); border-radius: 999px; padding: 7px 12px;
  font-size: .84rem; font-weight: 500; cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.radio-row input { width: auto; margin: 0; }
.radio-row label:has(input:checked) { background: var(--mint); border-color: var(--teal); color: var(--teal-dark); font-weight: 700; }

.result-empty { color: var(--muted); font-size: .93rem; }
.result-head { display: flex; justify-content: space-between; gap: 14px; align-items: start; flex-wrap: wrap; }
.result-head h2 { margin-bottom: 2px; }
.result-pct { font-family: var(--serif); font-size: 2.4rem; line-height: 1; color: var(--teal-dark); }
.big-claim { font-family: var(--serif); font-size: 1.25rem; line-height: 1.35; margin: 6px 0 14px; }
.savings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.savings div { background: var(--mint); border-radius: 10px; padding: 12px; }
.savings .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--teal-dark); font-weight: 700; }
.savings .v { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; }
.flags { list-style: none; padding: 0; margin: 12px 0 0; }
.flags li { border-top: 1px solid var(--line); padding: 11px 0; }
.flags li:first-child { border-top: 0; }
.flags .flag-title { font-weight: 650; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.flags .flag-detail { font-size: .88rem; color: var(--ink-soft); margin-top: 3px; }
.timeline { margin: 12px 0 0; padding: 0; list-style: none; }
.timeline li { display: flex; gap: 10px; padding: 6px 0; font-size: .88rem; }
.timeline .t { min-width: 76px; font-weight: 700; color: var(--teal-dark); font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 18px 0 0; }
.tabs button {
  border: 0; background: none; padding: 10px 12px; font: inherit; font-size: .84rem;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--teal-dark); border-bottom-color: var(--accent); font-weight: 700; }
.doc-preview { position: relative; background: var(--sand); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-top: 14px; max-height: 520px; overflow: auto; }
.doc-preview .doc-body { background: #fff; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,.06); font-family: var(--serif); font-size: .84rem; line-height: 1.5; }
.doc-preview .doc-body h3 { font-family: var(--serif); font-size: 1rem; }
.doc-preview .doc-body .blk-li { padding-left: 14px; text-indent: -14px; margin: 3px 0; }
.doc-preview .doc-body .blk-kv { margin: 2px 0; }
.doc-preview .doc-body .blk-small { color: var(--muted); font-size: .72rem; }
.doc-preview .doc-body .blk-h { font-weight: 700; margin: 12px 0 4px; }
.watermark { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: 10px; }
.watermark span {
  position: absolute; font-size: .8rem; font-weight: 800; letter-spacing: .12em; color: rgba(194,101,58,.22);
  transform: rotate(-24deg); white-space: nowrap;
}
.locked-note { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 14px; }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* Hospital directory */
.filter-bar { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; margin: 18px 0; }
.dir-count { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 20px; }
.pill { border: 1px solid var(--line-dark); border-radius: 999px; padding: 4px 10px; font-size: .78rem; color: var(--ink-soft); text-decoration: none; }
.pill:hover { background: var(--mint); border-color: var(--teal); }

/* Footer */
.site-foot { background: var(--ink); color: #c9d9d4; padding: 52px 0 26px; margin-top: 0; }
.site-foot .brand { color: #fff; }
.site-foot .logo-mark { color: #8ec3b2; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.foot-grid h3 { color: #fff; font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 12px; }
.foot-grid a { display: block; color: #c9d9d4; text-decoration: none; font-size: .9rem; padding: 4px 0; }
.foot-grid a:hover { color: #fff; }
.foot-brand p { font-size: .88rem; color: #a9c0ba; max-width: 34ch; }
.foot-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid #264441; margin-top: 34px; padding-top: 18px; font-size: .78rem; color: #8fa8a2; }

/* Utility */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 26px; } .mt-4 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; }
.hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }
.hide { display: none !important; }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .bill-card { transform: none; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .steps { grid-template-columns: 1fr 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .site-nav { display: none; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .section { padding: 44px 0; }
  .grid-3, .grid-4, .grid-2, .steps, .row-2, .row-3, .foot-grid, .savings { grid-template-columns: 1fr; }
  .head-cta { margin-left: auto; }
  .filter-bar { grid-template-columns: 1fr; }
  h1 { font-size: 2.1rem; }
  .section-head { display: block; }
}
@media print {
  .site-head, .site-foot, .band, .hero-actions, .form-actions, .doc-actions, .tabs, .banner { display: none !important; }
  body { background: #fff; }
  .doc-preview { max-height: none; border: 0; padding: 0; background: #fff; }
  .doc-preview .doc-body { box-shadow: none; padding: 0; font-size: 11pt; }
  .watermark { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
  .card-link:hover, .btn:hover { transform: none; }
}
