/* FitFind support, terms and privacy pages. Same look as the app and the landing page. */

:root {
    --paper: #ffffff;
    --paper-2: #f2f2f7;
    --fill: #e5e5ea;
    --ink: #000000;
    --text: #000000;
    --muted: #6e6e73;
    --faint: #aeaeb2;
    --line: rgba(0, 0, 0, 0.1);
    --blue: #0a84ff;
    --blue-soft: #e3f0ff;
    --em: #8e8e93;

    --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
    --rounded: ui-rounded, "SF Pro Rounded", "Nunito", var(--sans);

    --gutter: clamp(16px, 4vw, 56px);
    --bar: 64px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
    background: var(--paper);
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--bar) + 24px);
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
    color: var(--text);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 8px; }

/* ─── Bar ─── */
.bar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    height: var(--bar);
    /* Logo and button line up with the page content */
    padding: 0 max(var(--gutter), (100% - 1120px) / 2 + var(--gutter));
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(1.4) blur(18px);
    -webkit-backdrop-filter: saturate(1.4) blur(18px);
    border-bottom: 1px solid var(--line);
}

.bar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.bar-brand img { border-radius: 9px; }

.bar-links { display: flex; gap: 4px; }

.bar-links a {
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s, background-color 0.2s;
}

.bar-links a:hover { color: var(--text); }
.bar-links a[aria-current="page"] { color: var(--text); background: var(--paper-2); }

.bar-cta {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: transform 0.2s var(--ease);
}

.bar-cta:hover { transform: translateY(-1px); }

/* ─── Head ─── */
.legal {
    max-width: 1120px;
    margin: 0 auto;
    padding: clamp(56px, 8vw, 104px) var(--gutter) clamp(72px, 10vw, 128px);
}

.legal-head { max-width: 780px; margin-bottom: clamp(48px, 7vw, 80px); }

.tag {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

h1, h2 { font-family: var(--rounded); }

h1 {
    margin-top: 16px;
    font-size: clamp(44px, 6.4vw, 84px);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

h1 em { font-style: normal; color: var(--em); }

.lede { max-width: 36em; margin-top: 24px; font-size: 19px; color: var(--muted); }

.short {
    display: flex;
    gap: 14px;
    margin-top: 32px;
    padding: 18px 20px;
    border-radius: 20px;
    background: var(--paper-2);
    color: var(--muted);
    font-size: 16px;
}

.short strong { color: var(--text); font-weight: 600; }
.short a { color: var(--blue); }

.short-ico {
    flex: none;
    width: 28px;
    height: 28px;
    margin-top: 1px;
    border-radius: 8px;
    background:
        linear-gradient(#fff, #fff) 6px 6px / 5px 2px, linear-gradient(#fff, #fff) 6px 6px / 2px 5px,
        linear-gradient(#fff, #fff) 17px 6px / 5px 2px, linear-gradient(#fff, #fff) 20px 6px / 2px 5px,
        linear-gradient(#fff, #fff) 6px 20px / 5px 2px, linear-gradient(#fff, #fff) 6px 17px / 2px 5px,
        linear-gradient(#fff, #fff) 17px 20px / 5px 2px, linear-gradient(#fff, #fff) 20px 17px / 2px 5px,
        var(--ink);
    background-repeat: no-repeat;
}

/* ─── Body: table of contents + text ─── */
.legal-body {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: clamp(32px, 6vw, 88px);
    align-items: start;
}

.toc { position: sticky; top: calc(var(--bar) + 32px); }

.toc summary {
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    list-style: none;
    pointer-events: none;
}

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

.toc ol { list-style: none; display: grid; gap: 2px; }

.toc a {
    display: flex;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.35;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s, background-color 0.2s;
}

.toc a:hover { color: var(--text); }
.toc a span { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--faint); padding-top: 1px; }
.toc a.is-active { color: var(--text); background: var(--paper-2); }
.toc a.is-active span { color: var(--blue); }

.prose { max-width: 700px; }

.prose section {
    padding-bottom: 40px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--line);
}

.prose section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

.prose h2 {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 16px;
    font-size: clamp(24px, 2.6vw, 30px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.prose h2 .num {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    color: var(--blue);
}

.prose p, .prose li { color: var(--muted); }
.prose p + p, .prose ul + p, .prose p + ul { margin-top: 14px; }
.prose strong { color: var(--text); font-weight: 600; }

.prose ul { list-style: none; display: grid; gap: 10px; }
.prose li { position: relative; padding-left: 22px; }

.prose li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 0.72em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--faint);
}

.prose a, .faq a {
    color: var(--blue);
    text-decoration: underline;
    text-decoration-color: rgba(10, 132, 255, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s;
}

.prose a:hover, .faq a:hover { text-decoration-color: var(--blue); }

/* ─── Support ─── */
.mail {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-top: 36px;
    padding: 14px 24px 14px 16px;
    border-radius: 18px;
    background: var(--ink);
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.mail:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.5); }

.mail svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.mail small { display: block; font-size: 12px; font-weight: 500; opacity: 0.65; }

.reply { margin-top: 16px; font-size: 15px; color: var(--muted); }

.faq { max-width: 780px; }

.faq h2 {
    margin-bottom: 20px;
    font-size: clamp(28px, 3.4vw, 40px);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.faq details {
    margin-bottom: 10px;
    border-radius: 18px;
    background: var(--paper-2);
    transition: background-color 0.2s;
}

.faq summary {
    position: relative;
    padding: 18px 56px 18px 22px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

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

.faq summary::before,
.faq summary::after {
    content: "";
    position: absolute;
    right: 22px;
    top: 50%;
    width: 14px;
    height: 2px;
    border-radius: 2px;
    background: var(--muted);
    transition: transform 0.3s var(--ease);
}

.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0deg); }

.faq details p { padding: 0 22px 20px; color: var(--muted); }
.faq details p + p { margin-top: -8px; }
.faq strong { color: var(--text); font-weight: 600; }

/* ─── Footer ─── */
.foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 24px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px var(--gutter) 40px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

.foot a { text-decoration: none; }
.foot a:hover { color: var(--text); }
.foot p a { color: var(--text); }
.foot nav { display: flex; gap: 22px; }

/* ─── Mobile ─── */
@media (max-width: 900px) {
    .bar { grid-template-columns: auto 1fr auto; }
    .bar-links { justify-content: center; }
    .bar-links a { padding: 6px 10px; font-size: 14px; }

    .legal-body { grid-template-columns: 1fr; gap: 28px; }

    .toc {
        position: sticky;
        top: calc(var(--bar) + 8px);
        z-index: 5;
    }

    .toc details {
        border-radius: 16px;
        background: rgba(242, 242, 247, 0.92);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .toc summary {
        margin: 0;
        padding: 14px 18px;
        pointer-events: auto;
        cursor: pointer;
    }

    .toc ol { padding: 0 8px 10px; max-height: 60svh; overflow: auto; }
}

@media (max-width: 560px) {
    .bar-brand span { display: none; }
    .bar { gap: 6px; }
    .bar-links a { padding: 6px 8px; }
    .bar-cta { padding: 0 12px; font-size: 13px; }
    .foot { flex-direction: column; align-items: flex-start; }
}
