/* ==========================================================================
   TakeCare website (takecarehealth.org): shared design system
   Every page loads this file and site.js. Page-specific tweaks live in a
   small <style> block on that page.
   ========================================================================== */

:root {
    --brand: #5656e0;
    --brand-600: #4b4bd4;
    --brand-700: #3f3fc0;
    --brand-900: #24246b;
    --brand-50: #f3f3fe;
    --brand-100: #e6e6fc;
    --ink: #15151c;
    --body: #464658;
    --muted: #6d6d82;
    --line: #e5e5ef;
    --bg: #ffffff;
    --bg-soft: #f7f7fb;
    --green: #15803d;
    --green-50: #ecfdf3;
    --amber: #b45309;
    --amber-50: #fff6e5;
    --red: #c53030;
    --red-50: #fdeeee;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow-sm: 0 1px 2px rgb(21 21 28 / .05);
    --shadow: 0 1px 2px rgb(21 21 28 / .04), 0 18px 40px -16px rgb(36 36 107 / .22);
    --shadow-lg: 0 30px 80px -24px rgb(36 36 107 / .35);
    --wrap: 1180px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--body); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg, video { max-width: 100%; display: block; }
img { height: auto; }
a { color: var(--brand); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
:focus-visible { outline: 3px solid rgb(86 86 224 / .45); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 780px; }
.section { padding: 104px 0; scroll-margin-top: 72px; }
.section-sm { padding: 72px 0; }
.section-soft { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-dark { background: var(--brand-900); color: #d6d6f5; }
.section-dark h2, .section-dark h3 { color: #fff; }
.center { text-align: center; }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.section-dark .eyebrow { color: #b8b8ff; }
.section-head { max-width: 740px; margin: 0 auto 56px; text-align: center; }
.section-head h2 { font-size: clamp(30px, 3.8vw, 46px); font-weight: 800; margin-top: 12px; }
.section-head p { margin-top: 16px; font-size: 18.5px; }
.lede { font-size: clamp(17px, 1.9vw, 20px); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 50px; padding: 0 24px; border-radius: 12px; font: 600 15.5px/1 var(--font); text-decoration: none; border: 0; cursor: pointer; transition: background .15s, box-shadow .15s, color .15s, transform .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px -8px rgb(86 86 224 / .65); }
.btn-primary:hover { background: var(--brand-700); }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { border-color: #c8c8da; }
.btn-light { background: #fff; color: var(--brand-900); }
.btn-light:hover { background: var(--brand-50); }
.btn-ghost-light { color: #fff; border: 1px solid rgb(255 255 255 / .45); background: transparent; }
.btn-ghost-light:hover { background: rgb(255 255 255 / .1); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }

/* App store badges (official-style, drawn in CSS + SVG) */
.store-badges { display: flex; flex-wrap: wrap; gap: 12px; }
.store-badge { display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 18px 0 14px; border-radius: 12px; background: #0b0b10; color: #fff; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.store-badge:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -12px rgb(0 0 0 / .6); }
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge span { display: flex; flex-direction: column; line-height: 1.1; }
.store-badge small { font-size: 10.5px; opacity: .8; letter-spacing: .02em; }
.store-badge strong { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 60; background: rgb(255 255 255 / .88); backdrop-filter: saturate(1.5) blur(12px); -webkit-backdrop-filter: saturate(1.5) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px -18px rgb(21 21 28 / .4); }
.site-header .wrap { display: flex; align-items: center; gap: 28px; height: 70px; }
.brand-logo { display: flex; align-items: center; flex: none; }
.brand-logo img { height: 28px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.site-nav a { padding: 8px 12px; border-radius: 8px; color: var(--body); text-decoration: none; font-size: 14.5px; font-weight: 500; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); background: var(--bg-soft); }
.header-cta { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; align-items: center; justify-content: center; }
.menu-toggle svg { width: 22px; height: 22px; color: var(--ink); }
@media (max-width: 1080px) {
    .menu-toggle { display: inline-flex; }
    .header-cta { display: none; }
    .site-nav { position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 2px; margin: 0; padding: 12px 16px 20px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 20px 40px -24px rgb(21 21 28 / .35); display: none; }
    .site-nav.open { display: flex; }
    .site-nav a { padding: 12px 14px; font-size: 16px; }
    .site-nav .nav-mobile-cta { display: flex; margin-top: 10px; }
}
.nav-mobile-cta { display: none; }

/* ---------- Footer ---------- */
.site-footer { background: #0f0f1a; color: #b9b9cc; padding: 72px 0 32px; }
.site-footer a { color: #b9b9cc; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); gap: 40px; }
.footer-brand p { margin-top: 16px; font-size: 14.5px; max-width: 300px; }
.footer-brand img { height: 26px; width: auto; filter: brightness(0) invert(1); }
.footer-brand .store-badges { margin-top: 22px; }
.footer-brand .store-badge { background: #1d1d2c; height: 48px; }
.footer-col h4 { color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.footer-col ul { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; font-size: 14.5px; }
.footer-bottom { margin-top: 56px; padding-top: 24px; border-top: 1px solid rgb(255 255 255 / .1); display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; font-size: 13.5px; }
.footer-bottom p { max-width: 720px; color: #8c8ca5; }
@media (max-width: 960px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Phone mockups ---------- */
.phone { position: relative; width: 100%; max-width: 300px; aspect-ratio: 1344 / 2992; padding: 9px; border-radius: 44px; background: #0d0d14; box-shadow: var(--shadow-lg), inset 0 0 0 2px #2a2a38; margin: 0 auto; }
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 36px; background: #fff; }
.phone::before { content: ''; position: absolute; top: 20px; left: 50%; width: 11px; height: 11px; margin-left: -5px; border-radius: 50%; background: #0d0d14; z-index: 2; box-shadow: 0 0 0 2px #1d1d29; }
.phone-sm { max-width: 230px; border-radius: 36px; padding: 7px; }
.phone-sm img { border-radius: 30px; }
.phone-pair { display: flex; justify-content: center; align-items: flex-end; gap: 0; }
.phone-pair .phone { margin: 0; }
.phone-pair .phone + .phone { margin-left: -60px; transform: translateY(40px); }

/* Generic card */
.card { padding: 28px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.card h3 { font-size: 18px; font-weight: 700; }
.card p { margin-top: 8px; font-size: 15px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.icon-tile { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.icon-tile svg { width: 22px; height: 22px; }

/* Check list */
.checks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.checks li { display: flex; gap: 12px; font-size: 15.5px; }
.checks li::before { content: ''; flex: none; width: 21px; height: 21px; margin-top: 2px; border-radius: 50%; background: var(--brand-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235656e0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 10.5l2.5 2.5L14 7.5'/%3E%3C/svg%3E") center/16px no-repeat; }
.checks b, .checks strong { color: var(--ink); font-weight: 600; }

/* Pill / tag */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--brand-50); color: var(--brand-900); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding: 72px 0 56px; background: radial-gradient(900px 380px at 80% -20%, #e4e4ff 0%, transparent 60%), linear-gradient(180deg, #fbfbff, #fff); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(34px, 4.6vw, 54px); font-weight: 800; margin-top: 12px; }
.page-hero p { margin-top: 16px; font-size: 18.5px; max-width: 680px; }
.page-hero.center p { margin-left: auto; margin-right: auto; }
.breadcrumbs { font-size: 13.5px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--ink); }

/* ---------- Prose (blog posts, legal pages) ---------- */
.prose { font-size: 17px; line-height: 1.75; color: var(--body); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 28px; font-weight: 800; margin-top: 2em; }
.prose h3 { font-size: 21px; font-weight: 700; margin-top: 1.7em; }
.prose h4 { font-size: 17px; font-weight: 700; margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose strong { color: var(--ink); }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--brand); color: var(--ink); font-style: italic; }
.prose img { border-radius: var(--radius); margin: 1.6em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--ink); background: var(--bg-soft); }
.callout { padding: 18px 22px; border-radius: var(--radius-sm); background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--ink); font-size: 15.5px; }
.callout-warn { background: var(--amber-50); border-color: #fde3b8; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; height: 48px; padding: 0 14px; border: 1px solid #d3d3e2; border-radius: 10px; font: 400 16px var(--font); color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
.field textarea { height: auto; min-height: 140px; padding: 12px 14px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgb(86 86 224 / .15); }
.field .hint { margin-top: 6px; font-size: 13px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.segmented { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--line); }
.segmented button, .segmented label { border: 0; background: none; padding: 9px 16px; border-radius: 9px; font: 600 14px var(--font); color: var(--body); cursor: pointer; }
.segmented .active, .segmented input:checked + span { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Calculators ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.calc-panel { padding: 30px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-sm); }
.calc-result { padding: 30px; border-radius: var(--radius); background: linear-gradient(160deg, var(--brand-50), #fff); border: 1px solid var(--brand-100); }
.calc-result .big { font-size: 56px; font-weight: 800; color: var(--brand-900); letter-spacing: -0.03em; line-height: 1; }
@media (max-width: 860px) { .calc { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 22px 0; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; font-size: 18px; font-weight: 600; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex: none; font-size: 26px; line-height: .9; color: var(--brand); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > *:not(summary) { margin-top: 12px; font-size: 16px; }

/* ---------- Pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; max-width: 920px; margin: 0 auto; }
.plan { position: relative; padding: 36px; border-radius: 22px; border: 1px solid var(--line); background: #fff; }
.plan-featured { border: 2px solid var(--brand); box-shadow: var(--shadow); }
.plan-badge { position: absolute; top: -14px; left: 36px; background: var(--brand); color: #fff; font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 999px; }
.plan h3 { font-size: 22px; font-weight: 800; }
.plan .price { margin-top: 14px; font-size: 52px; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; line-height: 1; }
.plan .price small { font-size: 17px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan .btn { margin-top: 28px; width: 100%; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }

/* ---------- Final CTA ---------- */
.cta-band { border-radius: 28px; padding: 72px 40px; text-align: center; color: #fff; background: radial-gradient(800px 320px at 15% 0%, rgb(255 255 255 / .2), transparent 60%), linear-gradient(135deg, #5a5ae6, #3b3bb8); overflow: hidden; }
.cta-band h2 { color: #fff; font-size: clamp(30px, 3.8vw, 46px); font-weight: 800; }
.cta-band p { margin-top: 14px; font-size: 19px; color: #e4e4ff; }
.cta-band .store-badges { justify-content: center; margin-top: 32px; }
.cta-band .store-badge { background: #fff; color: #0b0b10; }

/* Reveal on scroll (site.js adds .in) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .reveal { opacity: 1; transform: none; transition: none; } }
