/* CarePrice product site. Colors follow docs/design/tokens.json. */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --bg-sunken: #edf0f4;
  --raised: #ffffff;
  --text: #1a2230;
  --muted: #4a5566;
  --border: #d3d9e1;
  --border-strong: #6b7686;
  --primary: #1d5a96;
  --primary-hover: #174a7c;
  --primary-soft: #e3ecf7;
  --primary-text: #ffffff;
  --accent: #1f7a46;
  --warn: #a86200;
  --link: #1d5c9e;
  --focus: #1d5fb8;
  --code-bg: #10161f;
  --code-text: #e6ebf2;
  --code-comment: #8b97a8;
  --code-key: #8dbdf4;
  --code-string: #8fd4a8;
  --code-num: #f0c27a;
  --code-kw: #d3a6e8;
  --inverse-bg: #12345a;
  --inverse-text: #ffffff;
  --shadow: 0 1px 2px rgba(16, 22, 31, 0.06), 0 8px 24px rgba(16, 22, 31, 0.08);
  --radius: 14px;
  --radius-sm: 8px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10161f;
    --bg-alt: #151c27;
    --bg-sunken: #0b1017;
    --raised: #1b2431;
    --text: #e6ebf2;
    --muted: #a8b3c2;
    --border: #2c3747;
    --border-strong: #7f8b9c;
    --primary: #4d8fd6;
    --primary-hover: #6aa3e0;
    --primary-soft: #1c2c42;
    --primary-text: #0b1017;
    --accent: #5cc48a;
    --warn: #e0a64a;
    --link: #8dbdf4;
    --focus: #8dbdf4;
    --code-bg: #0b1017;
    --inverse-bg: #173a63;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.5rem); font-weight: 750; }
h2 { font-size: clamp(1.75rem, 3vw, 2.4rem); font-weight: 720; }
h3 { font-size: 1.125rem; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: var(--link); }
code { font-family: var(--mono); font-size: 0.875em; }
p code, li code { background: var(--bg-sunken); padding: 0.1em 0.35em; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--primary-text); padding: 8px 14px; border-radius: var(--radius-sm); z-index: 100; }
.skip:focus { left: 8px; }

.eyebrow { color: var(--primary); font-weight: 650; font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.75em; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  padding: 0.75em 1.25em; border-radius: 10px; font-weight: 600; font-size: 0.975rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 0.5em 0.95em; font-size: 0.9rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { color: var(--text); border-color: var(--border); background: var(--raised); }
.btn-ghost:hover { border-color: var(--border-strong); }
.btn-light { background: #ffffff; color: #12345a; }
.btn-light:hover { background: #e3ecf7; }
.btn-outline-light { color: #ffffff; border-color: rgba(255, 255, 255, 0.5); }
.btn-outline-light:hover { border-color: #ffffff; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
}
.top-inner { display: flex; align-items: center; gap: 32px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 720; font-size: 1.125rem; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.brand-mark svg { width: 28px; height: 28px; display: block; }
.brand-mark rect { fill: var(--primary); }
.brand-mark path { fill: none; stroke: var(--primary-text); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark circle { fill: var(--primary-text); }
.nav { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.9375rem; font-weight: 520; padding: 6px 10px; border-radius: 6px; }
.nav a:hover { color: var(--text); background: var(--bg-sunken); }
.top .btn { margin-left: auto; }
@media (max-width: 860px) { .top nav { display: none; } }

/* Hero */
.hero {
  padding: 88px 0 72px;
  background:
    radial-gradient(900px 420px at 85% 0%, var(--primary-soft), transparent 70%),
    var(--bg);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; }
.lede { font-size: 1.1875rem; color: var(--muted); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 24px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: 0.9375rem; }
.hero-points li::before { content: "✓"; color: var(--accent); font-weight: 700; margin-right: 6px; }
@media (max-width: 960px) {
  .hero { padding: 56px 0 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}

.hero-card {
  margin: 0; background: var(--raised); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow); padding: 24px;
}
.hc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.hc-kicker { font-size: 0.8125rem; color: var(--muted); margin: 0 0 2px; }
.hc-title { font-weight: 650; margin: 0; }
.chip { white-space: nowrap; font-size: 0.78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.hc-list { list-style: none; margin: 0; padding: 0; }
.hc-list li { padding: 16px 0; border-bottom: 1px solid var(--border); }
.hc-list li:last-child { border-bottom: 0; padding-bottom: 4px; }
.hc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hc-row strong { display: block; font-weight: 600; }
.hc-row span { font-size: 0.8125rem; color: var(--muted); }
.hc-amt { font-size: 1.375rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.hc-amt small { font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.hc-cash { color: var(--muted); }
.bar { height: 6px; background: var(--bg-sunken); border-radius: 99px; margin: 10px 0 8px; overflow: hidden; }
.bar span { display: block; height: 100%; width: var(--w); background: var(--primary); border-radius: 99px; }
.bar-muted span { background: var(--border-strong); opacity: 0.55; }
.hc-meta { font-size: 0.78rem; color: var(--muted); margin: 0; display: flex; align-items: center; gap: 6px; }
.hc-meta + .hc-meta { margin-top: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-high { background: var(--accent); }
.dot-low { background: var(--warn); }
.hero-card figcaption { font-size: 0.75rem; color: var(--muted); margin-top: 12px; text-align: right; }

/* Facts */
.facts { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.facts-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.facts-grid > div { padding: 28px 24px; border-left: 1px solid var(--border); }
.facts-grid > div:first-child { border-left: 0; padding-left: 0; }
.facts-grid p { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.facts-grid .fact { color: var(--text); font-size: 2rem; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fact span { font-size: 1.125rem; font-weight: 600; margin-left: 2px; color: var(--muted); }
@media (max-width: 760px) {
  .facts-grid { grid-template-columns: 1fr 1fr; }
  .facts-grid > div { padding: 20px 16px; border-left: 0; }
  .facts-grid > div:first-child { padding-left: 16px; }
  .facts-grid > div:nth-child(odd) { border-right: 1px solid var(--border); }
  .facts-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}

/* Sections */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head p:not(.eyebrow) { color: var(--muted); font-size: 1.0625rem; }
@media (max-width: 760px) { .section { padding: 64px 0; } .section-head { margin-bottom: 32px; } }

/* Capability cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; transition: border-color 0.15s, box-shadow 0.15s; }
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card p { color: var(--muted); font-size: 0.9625rem; flex: 1; }
.card > code { color: var(--primary); font-size: 0.8rem; margin-top: 4px; }
.card-icon { width: 44px; height: 44px; border-radius: 11px; background: var(--primary-soft); display: grid; place-items: center; margin-bottom: 18px; }
.card-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--primary); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 960px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .cards { grid-template-columns: 1fr; } }

/* Tabs (solutions) */
.tablist { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-sunken); border-radius: 12px; margin-bottom: 28px; max-width: 100%; overflow-x: auto; }
.tablist [role="tab"] { appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 0.9375rem; padding: 9px 18px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.tablist [role="tab"]:hover { color: var(--text); }
.tablist [role="tab"][aria-selected="true"] { background: var(--raised); color: var(--text); box-shadow: 0 1px 3px rgba(16, 22, 31, 0.12); }
.panel { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; background: var(--raised); border: 1px solid var(--border); border-radius: 18px; padding: 40px; }
.panel[hidden] { display: none; }
.panel-copy > p { color: var(--muted); font-size: 1.0625rem; }
.panel h3 { font-size: 1.5rem; }
.panel-side { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; align-self: start; }
.side-label { font-size: 0.78rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.endpoints { list-style: none; margin: 0; padding: 0; }
.endpoints li { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-top: 1px solid var(--border); }
.endpoints code { color: var(--primary); font-weight: 600; font-size: 0.85rem; background: none; padding: 0; }
.endpoints span { font-size: 0.875rem; color: var(--muted); }
@media (max-width: 860px) { .panel { grid-template-columns: 1fr; padding: 24px; } }

.checks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px; }
.checks li { position: relative; padding-left: 30px; color: var(--muted); }
.checks li strong { color: var(--text); font-weight: 620; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 0.2em; width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.5 2.5L14 7.5' fill='none' stroke='%231d5a96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.checks-compact { gap: 10px; margin-bottom: 28px; }

/* Developers */
.dev-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 56px; align-items: center; }
.dev-grid > div > p:not(.eyebrow) { color: var(--muted); font-size: 1.0625rem; }
@media (max-width: 960px) { .dev-grid { grid-template-columns: 1fr; gap: 36px; } }

.code { background: var(--code-bg); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid #222c3a; min-width: 0; }
.code-tabs { display: flex; align-items: center; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid #222c3a; }
.code-tabs [role="tab"] { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; color: #8b97a8; font: 600 0.85rem var(--font); padding: 8px 14px 10px; cursor: pointer; }
.code-tabs [role="tab"]:hover { color: #e6ebf2; }
.code-tabs [role="tab"][aria-selected="true"] { color: #ffffff; border-bottom-color: #8dbdf4; }
.copy { margin-left: auto; margin-bottom: 6px; appearance: none; background: #1b2431; border: 1px solid #2c3747; color: #c4cdd9; border-radius: 6px; font: 600 0.78rem var(--font); padding: 4px 10px; cursor: pointer; }
.copy:hover { color: #ffffff; border-color: #4b5869; }
.code pre { margin: 0; padding: 22px 24px; overflow-x: auto; color: var(--code-text); font: 0.8125rem/1.7 var(--mono); }
.code pre[hidden] { display: none; }
.code pre code { font-size: inherit; }
.code .c { color: var(--code-comment); }
.code .k { color: var(--code-key); }
.code .s { color: var(--code-string); }
.code .n { color: var(--code-num); }
.code .kw { color: var(--code-kw); }

/* Calculator */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.calc-grid > div > p:not(.eyebrow) { color: var(--muted); font-size: 1.0625rem; }
.formula code { display: inline-block; background: var(--raised); border: 1px solid var(--border); padding: 10px 14px; border-radius: 10px; font-size: 0.82rem; color: var(--text); white-space: normal; }
.calc { background: var(--raised); border: 1px solid var(--border); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.field label { display: flex; justify-content: space-between; font-size: 0.875rem; font-weight: 600; margin-bottom: 6px; }
.field output { color: var(--primary); font-variant-numeric: tabular-nums; }
.money { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); padding: 0 12px; }
.money:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.money span { color: var(--muted); }
.money input { border: 0; background: transparent; color: var(--text); font: 600 1rem var(--font); padding: 10px 6px; width: 100%; outline: none; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--primary); margin-top: 12px; }
.result { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 20px; }
.split { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--bg-sunken); margin-bottom: 16px; }
.split span { transition: width 0.25s ease; }
#split-patient { background: var(--primary); }
#split-plan { background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .split span { transition: none; } }
.result-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.result-label { font-size: 0.875rem; color: var(--muted); margin: 0 0 2px; display: flex; align-items: center; gap: 8px; }
.result-amt { font-size: 1.875rem; font-weight: 750; letter-spacing: -0.02em; margin: 0; font-variant-numeric: tabular-nums; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.swatch-patient { background: var(--primary); }
.swatch-plan { background: var(--accent); }
.note { grid-column: 1 / -1; font-size: 0.8125rem; color: var(--muted); margin: 0; }
@media (max-width: 960px) { .calc-grid { grid-template-columns: 1fr; gap: 32px; } }
@media (max-width: 480px) { .calc { grid-template-columns: 1fr; padding: 20px; } }

/* Pipeline */
.pipeline { list-style: none; padding: 0; margin: 0 0 56px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; counter-reset: none; }
.pipeline li { position: relative; padding: 0 20px 0 0; }
.pipeline li::after { content: ""; position: absolute; top: 18px; left: 44px; right: 8px; height: 2px; background: var(--border); }
.pipeline li:last-child::after { display: none; }
.step { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: var(--primary-text); font-weight: 700; font-size: 0.9rem; margin-bottom: 14px; position: relative; z-index: 1; }
.pipeline h3 { font-size: 1rem; margin-bottom: 4px; }
.pipeline p { font-size: 0.875rem; color: var(--muted); }
@media (max-width: 960px) {
  .pipeline { grid-template-columns: repeat(3, 1fr); row-gap: 28px; }
  .pipeline li:nth-child(3)::after { display: none; }
}
@media (max-width: 560px) {
  .pipeline { grid-template-columns: 1fr; row-gap: 0; }
  .pipeline li { display: grid; grid-template-columns: 36px 1fr; column-gap: 16px; padding: 0 0 20px; }
  .pipeline li::after { display: block !important; top: 40px; bottom: 4px; left: 17px; right: auto; width: 2px; height: auto; }
  .pipeline li:last-child::after { display: none !important; }
  .step { grid-row: span 2; margin: 0; }
}

.trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.trust > div { border-top: 3px solid var(--primary); padding-top: 18px; }
.trust p { color: var(--muted); font-size: 0.9375rem; }
.trust em { font-style: normal; font-weight: 600; color: var(--text); }
@media (max-width: 960px) { .trust { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 560px) { .trust { grid-template-columns: 1fr; } }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; align-items: stretch; }
.plan { position: relative; background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; }
.plan-featured { border: 2px solid var(--primary); box-shadow: var(--shadow); }
.plan-flag { position: absolute; top: -12px; left: 24px; background: var(--primary); color: var(--primary-text); font-size: 0.75rem; font-weight: 650; padding: 3px 10px; border-radius: 99px; margin: 0; }
.price { font-size: 2.25rem; font-weight: 750; letter-spacing: -0.02em; margin: 4px 0 18px; font-variant-numeric: tabular-nums; }
.price span { font-size: 0.95rem; font-weight: 500; color: var(--muted); margin-left: 2px; }
.price small { font-size: 0.875rem; font-weight: 500; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; display: grid; gap: 10px; align-content: start; }
.plan li { font-size: 0.9375rem; color: var(--muted); padding-left: 22px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
@media (max-width: 1020px) { .plans { grid-template-columns: 1fr 1fr; row-gap: 28px; } }
@media (max-width: 560px) { .plans { grid-template-columns: 1fr; } }

/* CTA */
.cta { background: var(--inverse-bg); color: var(--inverse-text); padding: 80px 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.cta h2 { color: #ffffff; }
.cta p { color: #c9d7e8; font-size: 1.0625rem; max-width: 34em; margin: 0; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; flex-shrink: 0; }
.cta :focus-visible { outline-color: #ffffff; }
@media (max-width: 860px) { .cta-inner { flex-direction: column; align-items: flex-start; } }

/* Footer */
.foot { padding: 40px 0; border-top: 1px solid var(--border); }
.foot-inner { display: flex; gap: 40px; align-items: flex-start; justify-content: space-between; }
.brand-foot { margin: 0; }
.foot-note { color: var(--muted); font-size: 0.8125rem; max-width: 52em; margin: 0; }
@media (max-width: 760px) { .foot-inner { flex-direction: column; gap: 16px; } }
