/* Shared styles for the LifBol public site (landing + legal pages).
   Self-contained on purpose: no CDN fonts or frameworks, so the pages
   render identically offline, on a slow connection, and inside the
   in-app WebView that Settings links to. */

:root {
    --bg: #ffffff;
    --surface: #f5f7f9;
    --border: #e2e6ea;
    --text: #14181c;
    --muted: #5b6570;
    --accent: #3f8f1f;
    --accent-soft: rgba(63, 143, 31, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1113;
        --surface: #171a1d;
        --border: #262b30;
        --text: #f1f3f5;
        --muted: #9aa4ae;
        --accent: #8ee34f;
        --accent-soft: rgba(142, 227, 79, 0.12);
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    -webkit-text-size-adjust: 100%;
}

.wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 20px 80px;
}

/* Header / nav */

header.site {
    border-bottom: 1px solid var(--border);
    margin-bottom: 36px;
    padding-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.brand {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}

nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    margin-left: 18px;
}

nav a:hover, nav a:focus { color: var(--accent); }

/* Typography */

h1 {
    font-size: 34px;
    line-height: 1.2;
    letter-spacing: -0.025em;
    margin: 0 0 8px;
}

h2 {
    font-size: 21px;
    letter-spacing: -0.015em;
    margin: 40px 0 10px;
    padding-top: 6px;
}

h3 {
    font-size: 17px;
    margin: 26px 0 6px;
}

p, li { color: var(--text); }

a { color: var(--accent); }

.updated {
    color: var(--muted);
    font-size: 14.5px;
    margin: 0 0 28px;
}

.lede {
    font-size: 18.5px;
    color: var(--muted);
    margin-bottom: 28px;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 40px 0;
}

/* Callout — used for the medical disclaimer and the "we don't sell your
   data" summary, the two things a reader should not be able to miss. */

.callout {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 10px;
    padding: 16px 18px;
    margin: 24px 0;
}

.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* Tables scroll rather than forcing the page to — long HealthKit rows
   would otherwise break the layout on a phone. */

.table-scroll {
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid var(--border);
    border-radius: 10px;
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 15.5px;
}

th, td {
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--surface);
    font-weight: 700;
}

tr:last-child td { border-bottom: 0; }

/* Landing page bits */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 32px 0;
}

.card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    text-decoration: none;
    color: var(--text);
}

.card:hover { border-color: var(--accent); }

.card strong { display: block; font-size: 16.5px; margin-bottom: 4px; }
.card span { color: var(--muted); font-size: 14.5px; }

footer.site {
    border-top: 1px solid var(--border);
    margin-top: 56px;
    padding-top: 20px;
    color: var(--muted);
    font-size: 14.5px;
}

code {
    background: var(--accent-soft);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ============================================================
   Home page only — legal pages stay on the narrower 720px .wrap
   above so long paragraphs don't stretch into hard-to-read lines.
   ============================================================ */

body.home .wrap { max-width: 900px; }

.hero {
    text-align: center;
    padding: 28px 0 12px;
}

.hero-icon-glow {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 22px;
}

.hero-icon-glow::before {
    content: "";
    position: absolute;
    inset: -28px;
    background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
    z-index: 0;
}

.hero-icon-glow img {
    position: relative;
    z-index: 1;
    width: 96px;
    height: 96px;
    border-radius: 22px;
    display: block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.hero h1 {
    font-size: 42px;
    max-width: 640px;
    margin: 0 auto 14px;
}

.hero .lede {
    max-width: 560px;
    margin: 0 auto 30px;
}

.badge-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.badge {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 13px;
}

/* CTAs */

.cta-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15.5px;
    font-weight: 700;
    text-decoration: none;
    padding: 13px 22px;
    border-radius: 12px;
    border: 1px solid transparent;
}

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

.btn-primary:hover { opacity: 0.92; }

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover { border-color: var(--accent); }

.cta-note {
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
    margin: 10px 0 0;
}

/* Section headers centered on the home page, unlike legal-page h2s */

.section-head {
    text-align: center;
    margin: 64px 0 8px;
}

.section-head h2 { margin: 0 0 8px; }

.section-head p {
    color: var(--muted);
    font-size: 15.5px;
    max-width: 480px;
    margin: 0 auto;
}

/* Feature grid */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin: 28px 0;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
}

.feature-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.feature-icon svg {
    width: 19px;
    height: 19px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.feature-card strong {
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
}

.feature-card p {
    color: var(--muted);
    font-size: 14.5px;
    margin: 0;
}

/* How it works — 3 numbered steps */

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 28px 0;
    counter-reset: step;
}

.step { text-align: center; }

.step-num {
    counter-increment: step;
    width: 34px;
    height: 34px;
    line-height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: #0d1a05;
    font-weight: 800;
    font-size: 15px;
    margin: 0 auto 12px;
}

.step-num::before { content: counter(step); }

.step strong { display: block; font-size: 15.5px; margin-bottom: 4px; }
.step p { color: var(--muted); font-size: 14px; margin: 0; }

/* FAQ — native <details>, no JS needed */

.faq { margin: 28px 0; }

.faq details {
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.faq summary {
    font-weight: 700;
    font-size: 15.5px;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
    content: "+";
    color: var(--accent);
    font-size: 20px;
    font-weight: 400;
    margin-left: 12px;
}

.faq details[open] summary::after { content: "\2212"; }

.faq p {
    color: var(--muted);
    font-size: 14.5px;
    margin: 10px 0 0;
}
