/* ============================================================
   MFLUENCE — LEGAL / POLICY PAGES (shared stylesheet)
   Used by: terms.html, privacy.html, cookies.html, security.html
   Design tokens, nav, and footer are lifted verbatim from
   index2.html so the legal pages match the marketing site.
   Everything under "LONG-FORM READING" is new and specific to
   these documents. No build step — link this file + Google Fonts.
   ============================================================ */

/* ---------- Design tokens (mirrors index2.html) ---------- */
:root{
  /* Brand rose scale (primary = #d8557e) */
  --rose-50:#fdf2f6;  --rose-100:#fce4ec; --rose-200:#f7c5d8;
  --rose-300:#f09fbb; --rose-400:#e57a9c; --rose-500:#d8557e;
  --rose-600:#c53f6b; --rose-700:#a83158; --rose-800:#87284a;

  /* Plum ink (dark bands, footer) */
  --ink:#221426; --ink-2:#2f1a33; --ink-3:#451f3d;

  /* Warm neutrals */
  --n-0:#ffffff; --n-25:#faf7f9; --n-50:#f5f1f4; --n-100:#ece6eb;
  --n-200:#ddd5dc; --n-300:#c4bac2; --n-500:#8a7f89; --n-700:#544a53;
  --n-900:#241d23;

  /* Semantic */
  --text:#241d23; --text-muted:#6f6470; --text-subtle:#8a7f89;
  --bg:#ffffff; --bg-soft:#faf7f9; --border:#eae3e9;

  /* Gradients */
  --grad-primary:linear-gradient(135deg,#e0688c 0%,#d8557e 45%,#b83f6b 100%);
  --grad-ink:linear-gradient(160deg,#2a1830 0%,#3d1c39 55%,#5a2447 100%);
  --grad-soft:linear-gradient(180deg,#fdf2f6 0%,#ffffff 100%);

  /* Shadows (rose-tinted, soft) */
  --shadow-sm:0 1px 2px rgba(36,20,34,.06),0 1px 3px rgba(36,20,34,.05);
  --shadow-md:0 8px 24px -8px rgba(72,28,58,.18);
  --shadow-lg:0 24px 50px -14px rgba(72,28,58,.28);
  --shadow-primary:0 14px 30px -10px rgba(216,85,126,.5);

  /* Radius */
  --r-xs:8px; --r-sm:12px; --r-md:16px; --r-lg:24px; --r-pill:999px;

  /* Layout */
  --container:1200px;
  --section-pad:clamp(4rem,8vw,7rem);

  --font-display:"Space Grotesk",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --font-body:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}

/* ---------- Reset & base ---------- */
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0; font-family:var(--font-body); color:var(--text);
  background:var(--bg); line-height:1.6; -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
h1,h2,h3,h4{font-family:var(--font-display); line-height:1.15; letter-spacing:-.02em; margin:0; color:var(--text)}
p{margin:0}
a{color:inherit; text-decoration:none}
img,svg{display:block; max-width:100%}
ul{margin:0; padding:0; list-style:none}
button{font-family:inherit; cursor:pointer}

/* Accessibility: visible focus + skip link + reduced motion */
:focus-visible{outline:3px solid var(--rose-400); outline-offset:2px; border-radius:4px}
.skip-link{
  position:absolute; left:12px; top:-60px; z-index:200;
  background:var(--rose-500); color:#fff; padding:.6rem 1rem; border-radius:var(--r-sm);
  transition:top .2s ease;
}
.skip-link:focus{top:12px}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation:none !important; transition:none !important}
}

/* ---------- Layout helpers ---------- */
.container{width:100%; max-width:var(--container); margin:0 auto; padding:0 clamp(20px,4vw,32px)}
[id]{scroll-margin-top:90px}

/* ---------- Buttons (subset used on legal pages) ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:.55rem;
  font-family:var(--font-display); font-weight:600; font-size:.98rem;
  padding:.8rem 1.4rem; border-radius:var(--r-pill); border:1.5px solid transparent;
  transition:transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
  white-space:nowrap;
}
.btn svg{width:18px; height:18px}
.btn--primary{background:var(--grad-primary); color:#fff; box-shadow:var(--shadow-primary)}
.btn--primary:hover{transform:translateY(-2px); box-shadow:0 18px 36px -10px rgba(216,85,126,.6)}
.btn--secondary{background:#fff; color:var(--text); border-color:var(--border); box-shadow:var(--shadow-sm)}
.btn--secondary:hover{transform:translateY(-2px); border-color:var(--rose-300); color:var(--rose-700)}
.btn--ghost{background:transparent; color:var(--text)}
.btn--ghost:hover{color:var(--rose-600)}

/* ---------- Badge / eyebrow (mirrors index2.html) ---------- */
.badge{
  display:inline-flex; align-items:center; gap:.4rem; font-size:.82rem; font-weight:600;
  padding:.35rem .75rem; border-radius:var(--r-pill);
  background:var(--rose-50); color:var(--rose-700); border:1px solid var(--rose-200);
}
.eyebrow{
  display:inline-flex; align-items:center; gap:.5rem; font-family:var(--font-display);
  font-size:.8rem; font-weight:600; letter-spacing:.08em; text-transform:uppercase;
  color:var(--rose-600); margin-bottom:1rem;
}

/* ============================================================
   SECTION: Sticky nav (slim variant of the marketing nav)
   ============================================================ */
.nav{
  position:sticky; top:0; z-index:100; background:rgba(255,255,255,.85);
  backdrop-filter:saturate(180%) blur(12px); -webkit-backdrop-filter:saturate(180%) blur(12px);
  border-bottom:1px solid var(--border);
}
.nav__inner{display:flex; align-items:center; justify-content:space-between; height:72px; gap:1.5rem}
.brand{display:inline-flex; align-items:center; gap:.6rem}
.brand-logo{height:34px; width:auto; display:block}
.nav__links{display:flex; align-items:center; gap:.35rem}
.nav__links a{padding:.5rem .85rem; border-radius:var(--r-sm); font-weight:500; color:var(--text-muted); font-size:.95rem; transition:color .15s, background .15s}
.nav__links a:hover{color:var(--text); background:var(--n-50)}
.nav__links a[aria-current="page"]{color:var(--rose-700); background:var(--rose-50)}
.nav__actions{display:flex; align-items:center; gap:.75rem}
@media (max-width:820px){
  .nav__links{display:none}
}

/* ============================================================
   SECTION: Legal document header band
   ============================================================ */
.legal-hero{
  background:var(--grad-soft); border-bottom:1px solid var(--border);
  padding:clamp(2.5rem,6vw,4rem) 0 clamp(2rem,4vw,3rem);
}
.legal-hero h1{font-size:clamp(2rem,4.5vw,3rem)}
.legal-hero__intro{margin-top:1rem; max-width:64ch; color:var(--text-muted); font-size:clamp(1rem,1.6vw,1.12rem)}
.legal-updated{
  display:inline-flex; flex-wrap:wrap; align-items:center; gap:.5rem .9rem; margin-top:1.5rem;
  font-size:.88rem; color:var(--text-subtle);
}
.legal-updated .dot{width:4px; height:4px; border-radius:50%; background:var(--n-300)}
.legal-updated strong{color:var(--text); font-weight:600}

/* ============================================================
   SECTION: Two-column layout (sticky TOC + prose)
   ============================================================ */
.legal-layout{
  display:grid; grid-template-columns:260px minmax(0,1fr); gap:clamp(2rem,5vw,4rem);
  padding:clamp(2.5rem,5vw,3.5rem) 0 clamp(3.5rem,7vw,5rem);
}
@media (max-width:900px){
  .legal-layout{grid-template-columns:1fr; gap:1.5rem}
}

/* ---------- Table of contents ---------- */
.legal-toc{position:sticky; top:96px; align-self:start; max-height:calc(100vh - 120px); overflow:auto}
.legal-toc h2{
  font-family:var(--font-display); font-size:.78rem; text-transform:uppercase; letter-spacing:.08em;
  color:var(--text-subtle); margin-bottom:.9rem;
}
.legal-toc ol{margin:0; padding:0; list-style:none; counter-reset:toc; display:flex; flex-direction:column; gap:.15rem}
.legal-toc li{counter-increment:toc}
.legal-toc a{
  display:flex; gap:.6rem; padding:.4rem .6rem; border-radius:var(--r-sm); font-size:.9rem;
  color:var(--text-muted); border-left:2px solid transparent; transition:color .15s, background .15s, border-color .15s;
}
.legal-toc a::before{content:counter(toc) "."; color:var(--rose-500); font-weight:600; font-variant-numeric:tabular-nums}
.legal-toc a:hover{color:var(--text); background:var(--n-50)}
.legal-toc a[aria-current="true"]{color:var(--rose-700); background:var(--rose-50); border-left-color:var(--rose-500)}
/* On narrow screens, collapse the TOC into a disclosure */
.legal-toc--collapsible{border:1px solid var(--border); border-radius:var(--r-md); background:#fff; box-shadow:var(--shadow-sm); position:static; max-height:none}
.legal-toc--collapsible summary{
  display:flex; align-items:center; gap:.6rem; padding:1rem 1.15rem; cursor:pointer;
  font-family:var(--font-display); font-weight:600; list-style:none;
}
.legal-toc--collapsible summary::-webkit-details-marker{display:none}
.legal-toc--collapsible summary .chev{width:20px; height:20px; margin-left:auto; color:var(--text-subtle); transition:transform .2s}
.legal-toc--collapsible[open] summary .chev{transform:rotate(180deg)}
.legal-toc--collapsible .legal-toc__body{padding:0 1.15rem 1rem}
@media (min-width:901px){
  .legal-toc--collapsible{display:none}
}
@media (max-width:900px){
  .legal-toc--desktop{display:none}
}

/* ============================================================
   SECTION: Long-form prose
   ============================================================ */
.legal-prose{max-width:74ch; counter-reset:sec}
.legal-prose > section{padding-top:1.5rem; margin-top:1.5rem; border-top:1px solid var(--border)}
.legal-prose > section:first-of-type{padding-top:0; margin-top:0; border-top:0}
.legal-prose h2{
  counter-increment:sec; font-size:clamp(1.35rem,2.6vw,1.7rem); margin-bottom:.9rem;
  display:flex; gap:.6rem; align-items:baseline; scroll-margin-top:90px;
}
.legal-prose h2::before{content:counter(sec) "."; color:var(--rose-500); font-weight:700}
.legal-prose h3{font-size:1.1rem; margin:1.6rem 0 .5rem; color:var(--text)}
.legal-prose p{margin:0 0 1rem; color:var(--text-muted)}
.legal-prose p:last-child{margin-bottom:0}
.legal-prose strong{color:var(--text); font-weight:600}
.legal-prose a{color:var(--rose-700); font-weight:500; text-decoration:underline; text-underline-offset:2px; text-decoration-color:var(--rose-200)}
.legal-prose a:hover{text-decoration-color:var(--rose-500)}
.legal-prose ul,.legal-prose ol{margin:0 0 1rem; padding-left:1.4rem; color:var(--text-muted)}
.legal-prose ul{list-style:disc}
.legal-prose ol{list-style:decimal}
.legal-prose li{margin-bottom:.5rem}
.legal-prose li::marker{color:var(--rose-500)}

/* Definition list for shared defined terms */
.legal-defs{
  border:1px solid var(--border); border-radius:var(--r-md); overflow:hidden;
  background:#fff; box-shadow:var(--shadow-sm); margin:0 0 1rem;
}
.legal-defs dl{margin:0; display:grid; grid-template-columns:minmax(120px,180px) 1fr}
.legal-defs dt{
  font-family:var(--font-display); font-weight:600; color:var(--text);
  padding:.85rem 1.1rem; border-top:1px solid var(--border); background:var(--bg-soft);
}
.legal-defs dd{margin:0; padding:.85rem 1.1rem; border-top:1px solid var(--border); color:var(--text-muted); font-size:.96rem}
.legal-defs dt:first-of-type,.legal-defs dd:first-of-type{border-top:0}
@media (max-width:560px){
  .legal-defs dl{grid-template-columns:1fr}
  .legal-defs dd{padding-top:0}
  .legal-defs dt{border-top:1px solid var(--border)}
  .legal-defs dt + dd{border-top:0}
}

/* Generic data table (e.g. cookie inventory) */
.legal-table{width:100%; border-collapse:collapse; margin:0 0 1rem; font-size:.92rem}
.legal-table caption{text-align:left; color:var(--text-subtle); font-size:.85rem; margin-bottom:.6rem}
.legal-table th,.legal-table td{text-align:left; padding:.7rem .85rem; border:1px solid var(--border); vertical-align:top}
.legal-table thead th{background:var(--bg-soft); font-family:var(--font-display); font-size:.85rem; color:var(--text)}
.legal-table td{color:var(--text-muted)}

/* ---------- TODO / CONFIRM markers (impossible to miss) ---------- */
/* Wrap any unconfirmed fact in <span class="todo">[CONFIRM: ...]</span>
   so it renders highlighted AND is easy to grep before launch. */
.todo{
  background:#fff4d6; color:#7a5a00; border:1px dashed #e0b64a; border-radius:6px;
  padding:.05em .4em; font-size:.9em; font-weight:600; white-space:normal;
}
.legal-callout{
  display:flex; gap:.85rem; align-items:flex-start; margin:0 0 1.25rem;
  padding:1rem 1.15rem; border-radius:var(--r-md);
  background:#fff7e6; border:1px solid #f0d494; color:#6b5518;
}
.legal-callout svg{width:20px; height:20px; flex-shrink:0; margin-top:2px; color:#c88a00}
.legal-callout p{margin:0; color:#6b5518; font-size:.92rem}

/* ============================================================
   SECTION: "See also" cross-links between the four documents
   ============================================================ */
.legal-seealso{margin-top:2.5rem; padding-top:1.75rem; border-top:1px solid var(--border)}
.legal-seealso h2{font-size:1.1rem; margin-bottom:1rem}
.legal-seealso__grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:.85rem}
.legal-seealso a{
  display:block; padding:1rem 1.1rem; border:1px solid var(--border); border-radius:var(--r-md);
  background:#fff; box-shadow:var(--shadow-sm); transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.legal-seealso a:hover{transform:translateY(-3px); box-shadow:var(--shadow-md); border-color:var(--rose-200)}
.legal-seealso a[aria-current="page"]{border-color:var(--rose-300); background:var(--rose-50); pointer-events:none}
.legal-seealso .t{font-family:var(--font-display); font-weight:600; color:var(--text); display:block}
.legal-seealso .d{font-size:.85rem; color:var(--text-muted); margin-top:.2rem; display:block}

/* Back-to-home link at the very bottom */
.legal-backhome{
  display:inline-flex; align-items:center; gap:.5rem; margin-top:2rem;
  font-family:var(--font-display); font-weight:600; color:var(--rose-700);
}
.legal-backhome svg{width:18px; height:18px}

/* ============================================================
   SECTION: Footer (mirrors index2.html)
   ============================================================ */
.footer{background:var(--ink); color:rgba(255,255,255,.75); padding:clamp(3rem,6vw,4.5rem) 0 2rem}
.footer__top{display:grid; grid-template-columns:1.5fr repeat(3,1fr); gap:2.5rem; padding-bottom:3rem; border-bottom:1px solid rgba(255,255,255,.1)}
.footer .brand{color:#fff}
.brand-logo--light{height:46px}
.footer__tag{margin-top:1rem; max-width:30ch; font-size:.95rem; color:rgba(255,255,255,.6)}
.footer__col h4{font-family:var(--font-display); font-size:.82rem; text-transform:uppercase; letter-spacing:.08em; color:#fff; margin-bottom:1rem}
.footer__col a{display:block; padding:.35rem 0; color:rgba(255,255,255,.65); font-size:.95rem; transition:color .15s}
.footer__col a:hover{color:#fff}
.footer__bottom{display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:1rem; padding-top:1.75rem; font-size:.88rem; color:rgba(255,255,255,.55)}
.footer__legal{display:flex; flex-wrap:wrap; gap:1.25rem}
.footer__legal a:hover{color:#fff}
.footer__legal a[aria-current="page"]{color:#fff}
@media (max-width:820px){.footer__top{grid-template-columns:1fr 1fr}}
@media (max-width:520px){.footer__top{grid-template-columns:1fr}}
