/*
   Legal / policy landing pages (Terms, Privacy, Data Collection).
   Scoped under a `.legal` root so this document-style design never
   leaks into — or is overridden by — the shared navbar/footer.
*/

.legal {
    --lg-primary: #5867DF;
    --lg-primary-50: #EEF0FF;
    --lg-ink: #20184E;
    --lg-soft: #5B6478;
    --lg-line: #E6E8F0;
    --lg-bg: #FFFFFF;
    --lg-panel: #F6F7FB;

    background: var(--lg-bg);
    color: var(--lg-ink);
    font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.legal *,
.legal *::before,
.legal *::after { box-sizing: border-box; }

.legal a { color: var(--lg-primary); text-decoration: none; }
.legal a:hover { text-decoration: underline; }

.legal .lg-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Hero ---------- */
.legal-hero {
    position: relative;         /* neutralise the global `header{position:fixed}` if ever applied */
    background: linear-gradient(180deg, #F4F6FF 0%, #FFFFFF 100%);
    border-bottom: 1px solid var(--lg-line);
    padding: 104px 0 44px;      /* top clears the fixed navbar (72px seller / 59px buyer) + breathing room */
}
.legal-hero .eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--lg-primary);
    margin-bottom: 14px;
}
.legal-hero h1 {
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.12;
    font-weight: 700;
    color: var(--lg-ink);
    margin: 0 0 14px;
}
.legal-hero .lead {
    font-size: 17px;
    line-height: 1.6;
    color: var(--lg-soft);
    max-width: 640px;
    margin: 0 0 22px;
}
.legal-updated {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--lg-soft);
    background: #fff;
    border: 1px solid var(--lg-line);
    border-radius: 999px;
    padding: 7px 14px;
}
.legal-updated::before {
    content: "";
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #34C759;
}

/* ---------- Pills (reuses .pageTopLinks markup) ---------- */
.legal .pageTopLinks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 32px 0 0;
}
.legal .pageTopLinks a {
    padding: 11px 22px;
    border-radius: 999px;
    background: var(--lg-primary-50);
    color: var(--lg-primary);
    font-size: 15px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: .15s ease;
}
.legal .pageTopLinks a:hover {
    text-decoration: none;
    border-color: var(--lg-primary);
}
.legal .pageTopLinks a.active {
    background: var(--lg-primary);
    color: #fff;
}

/* ---------- FAQ accordion ---------- */
.legal-faq {
    max-width: 820px;
    margin: 0 auto;
    padding: 48px 0 32px;
}
.legal-qa {
    border: 1px solid var(--lg-line);
    border-radius: 14px;
    background: #fff;
    margin-bottom: 14px;
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.legal-qa.open {
    border-color: #cdd3ff;
    box-shadow: 0 14px 40px -28px rgba(88, 103, 223, .55);
}
.legal-qa-q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    text-align: left;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 20px 24px;
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: var(--lg-ink);
    line-height: 1.4;
}
.legal-qa-ic {
    flex-shrink: 0;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--lg-primary-50);
    color: var(--lg-primary);
    display: grid;
    place-items: center;
    font-size: 18px;
    line-height: 1;
    transition: transform .2s ease, background .15s ease;
}
.legal-qa.open .legal-qa-ic {
    transform: rotate(45deg);
    background: var(--lg-primary);
    color: #fff;
}
.legal-qa-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
}
.legal-qa-a-inner {
    padding: 0 24px 22px;
    font-size: 15.5px;
    line-height: 1.7;
    color: var(--lg-soft);
}
.legal-qa-a-inner p { margin: 0 0 12px; }
.legal-qa-a-inner p:last-child { margin-bottom: 0; }
.legal-qa-a-inner a { color: var(--lg-primary); }
.legal-qa-a-inner ul,
.legal-qa-a-inner ol { margin: 0 0 12px; padding-left: 20px; }

/* FAQ contact CTA */
.legal-faq-cta {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
    background: var(--lg-panel);
    border: 1px solid var(--lg-line);
    border-radius: 18px;
    padding: 36px 28px;
}
.legal-faq-cta h2 {
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-size: 22px;
    color: var(--lg-ink);
    margin: 0 0 10px;
}
.legal-faq-cta p { color: var(--lg-soft); margin: 0 0 20px; font-size: 15px; }
.legal-faq-cta .legal-btn {
    display: inline-block;
    background: var(--lg-primary);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    padding: 13px 28px;
    border-radius: 999px;
    transition: opacity .15s ease;
}
.legal-faq-cta .legal-btn:hover { opacity: .9; text-decoration: none; }

/* ---------- Body: sticky TOC + article ---------- */
.legal-body {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 56px;
    padding: 48px 0 80px;
    align-items: start;
}

.legal-toc {
    position: sticky;
    top: 96px;
    font-size: 14px;
}
.legal-toc .toc-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--lg-soft);
    margin-bottom: 14px;
}
.legal-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.legal-toc li { margin: 0; }
.legal-toc a {
    display: block;
    padding: 7px 0 7px 16px;
    border-left: 2px solid var(--lg-line);
    color: var(--lg-soft);
    line-height: 1.4;
    transition: .15s ease;
}
.legal-toc a:hover {
    text-decoration: none;
    color: var(--lg-ink);
    border-left-color: var(--lg-primary);
}

.legal-article { min-width: 0; }
.legal-intro {
    font-size: 17px;
    line-height: 1.7;
    color: var(--lg-soft);
    margin: 0 0 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--lg-line);
}

.legal-sec { scroll-margin-top: 96px; padding: 24px 0; }
.legal-sec + .legal-sec { border-top: 1px solid var(--lg-line); }
.legal-sec h2 {
    font-family: "Space Grotesk", "Inter", sans-serif;
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
    color: var(--lg-ink);
    margin: 0 0 16px;
}
.legal-sec h2 .num {
    font-size: 14px;
    font-weight: 600;
    color: var(--lg-primary);
}
.legal-sec p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--lg-soft);
    margin: 0 0 14px;
}
.legal-sec p:last-child { margin-bottom: 0; }
.legal-sec ul {
    margin: 0 0 14px;
    padding-left: 20px;
    color: var(--lg-soft);
    line-height: 1.7;
}
.legal-sec li { margin-bottom: 6px; }

/* ---------- Rich-text body (admin-managed DB content) ---------- */
.legal-richtext { font-size: 16px; line-height: 1.7; color: var(--lg-soft); }
.legal-richtext > :first-child { margin-top: 0; }
.legal-richtext > :last-child { margin-bottom: 0; }
.legal-richtext h1,
.legal-richtext h2,
.legal-richtext h3,
.legal-richtext h4 {
    font-family: "Space Grotesk", "Inter", sans-serif;
    color: var(--lg-ink);
    font-weight: 700;
    line-height: 1.25;
}
.legal-richtext h1 { font-size: 26px; margin: 0 0 18px; }
.legal-richtext h2 { font-size: 22px; margin: 38px 0 14px; scroll-margin-top: 96px; }
.legal-richtext h3 { font-size: 18px; margin: 28px 0 12px; scroll-margin-top: 96px; }
.legal-richtext h4 { font-size: 16px; margin: 22px 0 10px; }
.legal-richtext p { margin: 0 0 14px; }
.legal-richtext ul,
.legal-richtext ol { margin: 0 0 14px; padding-left: 22px; }
.legal-richtext li { margin-bottom: 6px; }
.legal-richtext a { color: var(--lg-primary); }
.legal-richtext strong,
.legal-richtext b { color: var(--lg-ink); font-weight: 600; }
.legal-richtext blockquote {
    margin: 0 0 16px;
    padding: 12px 18px;
    border-left: 3px solid var(--lg-primary);
    background: var(--lg-panel);
    border-radius: 0 10px 10px 0;
}
.legal-richtext hr { border: 0; border-top: 1px solid var(--lg-line); margin: 28px 0; }
.legal-richtext table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 15px; }
.legal-richtext th,
.legal-richtext td { border: 1px solid var(--lg-line); padding: 10px 12px; text-align: left; }
.legal-richtext th { background: var(--lg-panel); color: var(--lg-ink); font-weight: 600; }
.legal-richtext img { max-width: 100%; height: auto; border-radius: 10px; }

/* When the article has no headings, drop the TOC column */
.legal-body.no-toc { grid-template-columns: 1fr; }
.legal-body.no-toc .legal-toc { display: none; }

/* Empty-state */
.legal-empty {
    border: 1px dashed var(--lg-line);
    border-radius: 16px;
    padding: 40px 28px;
    text-align: center;
    color: var(--lg-soft);
    background: var(--lg-panel);
}

/* Contact card */
.legal-contact {
    background: var(--lg-panel);
    border: 1px solid var(--lg-line);
    border-radius: 16px;
    padding: 24px 28px;
    margin-top: 8px;
}
.legal-contact .org { font-weight: 600; color: var(--lg-ink); margin-bottom: 6px; }
.legal-contact .row { font-size: 15px; color: var(--lg-soft); margin: 4px 0; }
.legal-contact .row b { color: var(--lg-ink); font-weight: 500; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .legal-body { grid-template-columns: 1fr; gap: 24px; }
    .legal-toc {
        position: static;
        border: 1px solid var(--lg-line);
        border-radius: 14px;
        padding: 18px 20px;
        background: var(--lg-panel);
    }
    .legal-toc a { padding-left: 0; border-left: 0; }
    .legal-toc a:hover { border-left: 0; }
}

/* ============================================================
   "How it works" (seller) — reuses the .legal shell + tokens
   ============================================================ */

/* Hero CTA buttons */
.how-cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.how-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    padding: 14px 28px;
    border-radius: 999px;
    transition: opacity .15s ease, border-color .15s ease, color .15s ease, background .15s ease;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: "Inter", system-ui, sans-serif;
}
.legal .how-btn-primary { background: var(--lg-primary); color: #fff; }
.legal .how-btn-primary:hover { opacity: .92; text-decoration: none; color: #fff; }
.legal .how-btn-ghost { background: #fff; color: var(--lg-ink); border-color: var(--lg-line); }
.legal .how-btn-ghost:hover { border-color: var(--lg-primary); color: var(--lg-primary); text-decoration: none; }

/* Section + heading */
.how-section { padding: 68px 0 24px; }
.how-section-head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.how-section-head .eyebrow {
    display: inline-block;
    font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--lg-primary); margin-bottom: 14px;
}
.how-section-head h2 {
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-size: clamp(26px, 3.4vw, 36px);
    line-height: 1.15; font-weight: 700; color: var(--lg-ink); margin: 0 0 12px;
}
.how-section-head p { color: var(--lg-soft); font-size: 17px; line-height: 1.6; margin: 0; }

/* Tabs */
.how-tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 48px; }
.how-tab {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 12px 24px;
    border-radius: 999px;
    border: 1px solid var(--lg-line);
    background: #fff;
    color: var(--lg-soft);
    font-weight: 600; font-size: 15px;
    font-family: "Inter", system-ui, sans-serif;
    cursor: pointer;
    transition: .15s ease;
}
.how-tab .tab-n {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--lg-primary-50); color: var(--lg-primary);
    display: grid; place-items: center; font-size: 12px; font-weight: 700;
    transition: .15s ease;
}
.how-tab:hover { border-color: #cdd3ff; color: var(--lg-ink); }
.how-tab.active { background: var(--lg-primary); border-color: var(--lg-primary); color: #fff; }
.how-tab.active .tab-n { background: rgba(255,255,255,.25); color: #fff; }

/* Step panels */
.how-panel { display: none; }
.how-panel.active { display: block; animation: howFade .3s ease; }
@keyframes howFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.how-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1080px;
    margin: 0 auto;
}
.how-step {
    position: relative;
    background: #fff;
    border: 1px solid var(--lg-line);
    border-radius: 18px;
    padding: 32px 26px;
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.how-step:hover {
    border-color: #cdd3ff;
    box-shadow: 0 22px 50px -34px rgba(88,103,223,.6);
    transform: translateY(-3px);
}
.how-step-num {
    width: 50px; height: 50px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--lg-primary), #8b97f0);
    color: #fff;
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-weight: 700; font-size: 22px;
    display: grid; place-items: center;
    margin-bottom: 22px;
    box-shadow: 0 14px 26px -12px rgba(88,103,223,.7);
}
.how-step h3 {
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-size: 18px; line-height: 1.3; font-weight: 700; color: var(--lg-ink);
    margin: 0 0 10px;
}
.how-step p { color: var(--lg-soft); font-size: 14.5px; line-height: 1.65; margin: 0; }

/* connector arrow between steps (desktop only) */
.how-step:not(:last-child)::after {
    content: "→";
    position: absolute;
    right: -19px; top: 44px;
    transform: translateY(-50%);
    color: #c2c8e6;
    font-size: 18px;
    z-index: 1;
}

.how-panel-cta { text-align: center; margin-top: 44px; }

/* Final CTA band */
.how-final {
    background: linear-gradient(135deg, #20184E 0%, #3a2f7a 100%);
    border-radius: 24px;
    padding: 60px 40px;
    text-align: center;
    color: #fff;
    margin: 40px 0 80px;
    overflow: hidden;
    position: relative;
}
.how-final h2 {
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-size: clamp(26px, 3.4vw, 34px);
    line-height: 1.15; color: #fff; margin: 0 0 14px;
}
.how-final p { color: #C9CDEC; font-size: 17px; line-height: 1.6; max-width: 560px; margin: 0 auto 28px; }
.how-final .how-btn-primary { background: #fff; color: var(--lg-primary); }
.how-final .how-btn-primary:hover { background: #fff; color: var(--lg-primary); opacity: .9; }

/* Responsive */
@media (max-width: 860px) {
    .how-steps { grid-template-columns: 1fr; max-width: 520px; }
    .how-step:not(:last-child)::after { display: none; }
}
