/* ==========================================================================
   CorpFit — shared legal-page stylesheet
   Used by: privacy.html  (terms.html migrates in its own task)
   Brand: orange #F3592C on white, dark neutral text, Inter / system stack.
   Mobile-first; the app opens these pages in the device browser.
   ========================================================================== */

:root {
    --orange: #F3592C;
    --orange-dark: #D94A20;
    --orange-soft: #FEF3EF;

    --ink: #1A1A1A;
    --text: #3F454D;
    --text-soft: #6B7280;

    --bg: #FFFFFF;
    --bg-subtle: #F9FAFB;
    --border: #E7E9EC;

    --amber: #B45309;
    --amber-bg: #FFFBEB;
    --amber-border: #F59E0B;

    --radius: 12px;
    --radius-sm: 8px;
    --maxw: 1120px;
    --header-offset: 84px; /* accent band + breathing room for anchor jumps */

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* slim orange accent band, fixed at the very top */
.accent-band {
    height: 5px;
    background: linear-gradient(90deg, var(--orange) 0%, var(--orange-dark) 100%);
    position: sticky;
    top: 0;
    z-index: 30;
}

/* ---------- Masthead ---------- */
.masthead {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.masthead-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 22px 24px 26px;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--orange);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 0;
    min-height: 40px;
}
.back-link:hover { text-decoration: underline; }

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: block;
    flex-shrink: 0;
}
.wordmark {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ink);
}
.wordmark .fit { color: var(--orange); }
.wordmark-sub {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.masthead h1 {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
    margin: 14px 0 0;
}
.masthead .lede {
    margin-top: 8px;
    color: var(--text-soft);
    font-size: 1rem;
    max-width: 60ch;
}

.date-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.chip {
    display: inline-flex;
    flex-direction: column;
    background: var(--orange-soft);
    border: 1px solid #F6D3C7;
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    line-height: 1.3;
}
.chip .chip-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--orange-dark);
}
.chip .chip-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink);
}
.operator-line {
    margin-top: 16px;
    font-size: 0.82rem;
    color: var(--text-soft);
}

/* ---------- Layout: sticky TOC + content ---------- */
.layout {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 32px 24px 0;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.toc {
    position: sticky;
    top: var(--header-offset);
    max-height: calc(100vh - var(--header-offset) - 24px);
    overflow-y: auto;
}
.toc-head {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-soft);
    padding: 0 0 12px;
    cursor: default;
}
.toc-head .toggle-icon { display: none; }
.toc-nav { display: block; }
.toc-nav a {
    display: block;
    color: var(--text);
    text-decoration: none;
    font-size: 0.88rem;
    padding: 7px 12px;
    border-left: 2px solid var(--border);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: color .15s, border-color .15s, background .15s;
}
.toc-nav a:hover { color: var(--ink); background: var(--bg-subtle); }
.toc-nav a.active {
    color: var(--orange-dark);
    font-weight: 600;
    border-left-color: var(--orange);
    background: var(--orange-soft);
}

/* ---------- Content ---------- */
.content { min-width: 0; max-width: 72ch; padding-bottom: 64px; }

.content .intro-text {
    font-size: 1.1rem;
    color: var(--ink);
    margin-bottom: 28px;
}

section { scroll-margin-top: var(--header-offset); }

.content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
    margin: 44px 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}
.content h2 .num { color: var(--orange); font-variant-numeric: tabular-nums; }
.content section:first-of-type h2 { margin-top: 0; }

.content h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    margin: 26px 0 10px;
}
.content p { margin-bottom: 14px; color: var(--text); }
.content ul, .content ol { margin: 12px 0 16px 22px; color: var(--text); }
.content li { margin-bottom: 9px; }
.content a { color: var(--orange-dark); font-weight: 500; }
.content strong { color: var(--ink); }

/* ---------- Summary table ---------- */
.summary-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 8px 0 32px;
}
.summary-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.summary-table caption {
    text-align: left;
    font-weight: 700;
    color: var(--ink);
    padding: 14px 16px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
}
.summary-table th, .summary-table td {
    text-align: left;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.summary-table thead th {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-soft);
    background: var(--bg-subtle);
}
.summary-table tbody tr:last-child td { border-bottom: none; }
.summary-table td:first-child { font-weight: 600; color: var(--ink); }

/* ---------- Callouts ---------- */
.callout {
    border: 1px solid var(--border);
    border-left: 4px solid var(--orange);
    background: var(--orange-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 16px 18px;
    margin: 20px 0;
}
.callout .callout-title {
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
}
.callout p:last-child { margin-bottom: 0; }

.callout.medical {
    background: var(--amber-bg);
    border-color: #FCE9C0;
    border-left-color: var(--amber-border);
}
.callout.medical .callout-title { color: var(--amber); }

/* ---------- FAQ accordion ---------- */
.faq-intro { color: var(--text); margin: 4px 0 8px; }

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    margin-bottom: 12px;
    overflow: hidden;
}
.faq-q {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
    min-height: 56px;
}
.faq-q:hover { background: var(--bg-subtle); }
.faq-icon {
    color: var(--orange);
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: transform .2s;
}
.faq-item[data-open="true"] .faq-icon { transform: rotate(180deg); }
.faq-item[data-open="true"] .faq-q { background: var(--orange-soft); }
.faq-a {
    display: none;
    padding: 4px 18px 18px;
    color: var(--text);
}
.faq-item[data-open="true"] .faq-a { display: block; }
.faq-a p { margin-bottom: 10px; }
.faq-a p:last-child { margin-bottom: 0; }
.faq-a ul, .faq-a ol { margin: 8px 0 8px 20px; }
.faq-a li { margin-bottom: 6px; }
.faq-a a { color: var(--orange-dark); font-weight: 500; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--ink);
    color: #9AA1AC;
    margin-top: 40px;
    padding: 36px 24px;
    text-align: center;
}
.site-footer nav { margin-bottom: 14px; }
.site-footer a {
    color: #C7CCD3;
    text-decoration: none;
    margin: 0 14px;
    font-size: 0.9rem;
    display: inline-block;
    padding: 6px 0;
    min-height: 36px;
}
.site-footer a:hover { color: #fff; }
.site-footer .legal-line { font-size: 0.8rem; line-height: 1.6; }
.site-footer .legal-line a { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
        gap: 0;
        padding-top: 20px;
    }
    .masthead h1 { font-size: 1.7rem; }

    .toc {
        position: static;
        max-height: none;
        overflow: visible;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--bg-subtle);
        margin-bottom: 28px;
    }
    .toc-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        cursor: pointer;
        min-height: 48px;
    }
    .toc-head .toggle-icon {
        display: inline-block;
        transition: transform .2s;
        font-size: 1rem;
        color: var(--text-soft);
    }
    .toc[data-open="false"] .toc-head .toggle-icon { transform: rotate(-90deg); }
    .toc-nav {
        padding: 4px 10px 12px;
        border-top: 1px solid var(--border);
    }
    .toc[data-open="false"] .toc-nav { display: none; }
    .toc-nav a { border-left-width: 2px; }

    .content { max-width: none; }
    .summary-table { font-size: 0.84rem; }
    .summary-table th, .summary-table td { padding: 10px 12px; }
}

@media (max-width: 560px) {
    .masthead-inner { padding: 18px 18px 22px; }
    .layout { padding-left: 18px; padding-right: 18px; }
    .masthead h1 { font-size: 1.5rem; }
    .chip { flex: 1 1 calc(50% - 5px); }

    /* stack the summary table into labelled rows */
    .summary-table thead { display: none; }
    .summary-table, .summary-table tbody, .summary-table tr, .summary-table td { display: block; width: 100%; }
    .summary-table caption { display: block; width: 100%; }
    .summary-table tr {
        border-bottom: 1px solid var(--border);
        padding: 6px 0;
    }
    .summary-table tbody tr:last-child { border-bottom: none; }
    .summary-table td { border: none; padding: 4px 16px; }
    .summary-table td:first-child { padding-top: 12px; }
    .summary-table td:not(:first-child)::before {
        content: attr(data-label);
        display: block;
        font-size: 0.64rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--text-soft);
        margin-bottom: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
