/* Find Private Care design system — mobile-first, accessible, calm.
   Goals: usable by a nervous 80-year-old on a small phone AND a 20-year-old
   in a hurry. Large tap targets (min 48px), high contrast (WCAG AA+),
   a built-in text-size control, and motion that respects prefers-reduced-motion. */

:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --ink: #11242e;
  --ink-soft: #41555f;
  --muted: #5a6770;       /* darkened to clear WCAG AA (>=4.5:1) on white + light fills */
  --line: #dfe6ea;
  --brand: #0a6b6b;          /* calm teal — trust, healthcare, not corporate-cold */
  --brand-ink: #054f4f;
  --brand-soft: #e6f3f2;
  --accent: #b8860b;         /* warm gold for the "partner"/highlight, used sparingly */
  --good: #1c7c45;
  --warn: #8a5a00;
  --bad: #b23b3b;
  --focus: #1763d6;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17,36,46,.06), 0 6px 20px rgba(17,36,46,.06);
  --maxw: 1080px;
  --fs: 1rem;                /* scaled by [data-textsize] */
  --space: clamp(16px, 4vw, 28px);
}
html[data-textsize="large"]  { --fs: 1.15rem; }
html[data-textsize="xlarge"] { --fs: 1.32rem; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--fs);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; color: var(--ink); margin: 0 0 .4em; }
h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.3rem, 3.5vw, 1.7rem); }
a { color: var(--brand-ink); }
p { margin: 0 0 1em; color: var(--ink-soft); }
img, svg { max-width: 100%; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--space); }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 14px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--brand-ink); text-decoration: none; font-size: 1.25rem; letter-spacing: -.02em; }
.brand .mark { width: 30px; height: 30px; flex: 0 0 auto; }
.header-spacer { flex: 1; }
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a { color: var(--ink-soft); text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.nav-links a:hover { background: var(--brand-soft); color: var(--brand-ink); }
.text-size-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer;
  min-height: 44px; min-width: 44px; padding: 6px 10px; font-weight: 700; color: var(--ink-soft);
}
@media (max-width: 720px) { .nav-links .hide-sm { display: none; } }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  font-size: 1rem; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .06s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-ghost { background: #fff; color: var(--brand-ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-block { width: 100%; }

/* ── Hero / search ──────────────────────────────────────── */
.hero { padding: clamp(28px, 7vw, 64px) 0 clamp(20px, 5vw, 40px); }
.hero .lede { font-size: clamp(1.05rem, 2.6vw, 1.25rem); max-width: 44ch; color: var(--ink-soft); }
.searchcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: clamp(16px, 4vw, 24px); margin-top: 22px;
}
.search-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .search-grid { grid-template-columns: 2fr 1fr auto; align-items: end; } }
.field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.field label { font-weight: 700; font-size: .92rem; color: var(--ink); }
.field input {
  min-height: 54px; padding: 12px 14px; font-size: 1.05rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; color: var(--ink); width: 100%;
}
.field input:focus { border-color: var(--brand); }
.suggest {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  list-style: none; margin: 0; padding: 4px; max-height: 280px; overflow: auto;
}
.suggest li { padding: 0; }
.suggest button {
  width: 100%; text-align: left; border: 0; background: none; padding: 12px; border-radius: 8px;
  cursor: pointer; font-size: 1rem; display: flex; gap: 10px; align-items: center; min-height: 48px;
}
.suggest button:hover, .suggest button[aria-selected="true"] { background: var(--brand-soft); }
.suggest .kind { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px;
  font-size: .92rem; cursor: pointer; color: var(--ink-soft); min-height: 40px; text-decoration: none; display: inline-flex; align-items: center;
}
.chip:hover { border-color: var(--brand); color: var(--brand-ink); }

/* ── Safety + info banners ──────────────────────────────── */
.banner { border-radius: var(--radius-sm); padding: 12px 16px; font-size: .95rem; margin: 16px 0; border: 1px solid; }
.banner-safety { background: #fff6f6; border-color: #f3cccc; color: #7a2727; }
.banner-info { background: var(--brand-soft); border-color: #bfe0de; color: var(--brand-ink); }
.banner strong { font-weight: 800; }

/* ── Trust strip ────────────────────────────────────────── */
.trust { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 28px 0; }
@media (min-width: 720px) { .trust { grid-template-columns: repeat(3, 1fr); } }
.trust .item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.trust .item h3 { font-size: 1.05rem; margin-bottom: 4px; }
.trust .item p { margin: 0; font-size: .95rem; }

/* ── Results layout ─────────────────────────────────────── */
.results-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; justify-content: space-between; margin: 18px 0 8px; }
.results-head .count { color: var(--muted); }
.layout { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .layout { grid-template-columns: 260px 1fr; align-items: start; } }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: sticky; top: 80px; }
.filters h2 { font-size: 1.05rem; }
.filter-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; }
.filter-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--brand); }
.filter-row label { font-size: .95rem; color: var(--ink-soft); }
.filters select { width: 100%; min-height: 46px; border-radius: 8px; border: 1px solid var(--line); padding: 8px; font-size: 1rem; }
.filters-toggle { display: none; }
@media (max-width: 899px) {
  .filters { position: static; }
  details.filters-d summary { cursor: pointer; font-weight: 700; min-height: 48px; display: flex; align-items: center; }
}

/* ── Provider card ──────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px;
}
.card.sponsored { border-color: #e6d6a8; background: linear-gradient(0deg,#fffdf7,#fff); }
.card.partner { border-color: #bfe0de; }
.card-top { display: flex; gap: 14px; align-items: flex-start; }
.score-ring { flex: 0 0 auto; width: 64px; height: 64px; position: relative; }
.score-ring .num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; color: var(--brand-ink); }
.card h3 { font-size: 1.2rem; margin: 0; }
.card .meta { color: var(--muted); font-size: .92rem; margin: 2px 0 0; }
.card .summary { margin: 10px 0; font-size: .96rem; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.badge {
  font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 4px 10px; border: 1px solid;
  display: inline-flex; align-items: center; gap: 5px;
}
.badge-good { background: #ecf7f0; border-color: #b9e2c7; color: var(--good); }
.badge-info { background: var(--brand-soft); border-color: #bfe0de; color: var(--brand-ink); }
.badge-warn { background: #fdf6e7; border-color: #ecd9a6; color: var(--warn); }
.badge-muted { background: #f1f4f6; border-color: var(--line); color: var(--muted); }
.badge-partner { background: #fbf3df; border-color: #e6d093; color: #8a6400; }
.badge-sponsored { background: #f6efda; border-color: #e0cd96; color: #7c6310; }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.why { font-size: .85rem; color: var(--muted); background: none; border: 0; cursor: pointer; text-decoration: underline; padding: 6px 0; min-height: 40px; }
.why-panel { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; font-size: .9rem; }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 46px; gap: 8px; align-items: center; }
.bar { height: 8px; background: #eef2f4; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

/* ── Generic content pages ──────────────────────────────── */
.prose { max-width: 70ch; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: .3em 0; color: var(--ink-soft); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px,4vw,24px); margin: 16px 0; box-shadow: var(--shadow); }
.kv { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .kv { grid-template-columns: repeat(2,1fr); } }
.kv .k { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kv .v { font-weight: 700; font-size: 1.05rem; }
.review-badge { display: inline-flex; gap: 8px; align-items: center; background: #ecf7f0; border: 1px solid #b9e2c7; color: var(--good); padding: 8px 14px; border-radius: 999px; font-weight: 700; }
.draft-badge { display: inline-flex; gap: 8px; align-items: center; background: #fdf6e7; border: 1px solid #ecd9a6; color: var(--warn); padding: 8px 14px; border-radius: 999px; font-weight: 700; }

/* pricing tiers */
.tiers { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .tiers { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 1000px) { .tiers { grid-template-columns: repeat(4,1fr); } }
.tier { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; }
.tier.featured { border: 2px solid var(--brand); }
.tier .price { font-size: 1.8rem; font-weight: 800; color: var(--ink); }
.tier .price small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.tier ul { list-style: none; padding: 0; margin: 12px 0; flex: 1; }
.tier li { padding: 7px 0 7px 26px; position: relative; font-size: .95rem; color: var(--ink-soft); }
.tier li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 800; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 28px 0; color: var(--muted); font-size: .9rem; background: #fff; }
.site-footer .cols { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .site-footer .cols { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer a { color: var(--ink-soft); text-decoration: none; display: block; padding: 5px 0; }
.site-footer a:hover { color: var(--brand-ink); }

.loading, .empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
