/* ══════════════════════════════════════════════════════════════════
   legal-pages.css
   Shared styles for the legal / policy page family — Terms of Service,
   Privacy Policy, Refund Policy, Risk Disclosure, Legal & Compliance,
   Cookie Policy, and Security, NDA & Intellectual Property.

   Loaded IN ADDITION TO new-design.css (which must be linked first) on
   these templates only. This is a sibling of product-pages.css (catalog
   templates) and service-pages.css (/services/* templates) — the same
   architecture, one stylesheet per page family.

   Reuses :root variables, base typography, .container, .btn, .eyebrow,
   and the sitewide header/topbar/footer chrome from new-design.css —
   do not redefine any of those here.

   Every legal page's wrapper carries class="legal-page"; the layout is
   a sticky table-of-contents sidebar plus numbered content sections.
   ══════════════════════════════════════════════════════════════════ */

/* ── Sticky-sidebar prerequisite ──────────────────────────────────────
   new-design.css sets `body { overflow-x: hidden }` sitewide. `hidden`
   turns <body> into a scroll container, and a scroll container that never
   actually scrolls silently disables position:sticky for every descendant —
   so the table-of-contents column would just scroll away with the page.

   `overflow-x: clip` clips the same overflow WITHOUT establishing a scroll
   container, so sticky keeps working. It is scoped with :has() so this only
   affects legal templates and nothing else on the site — the shared
   new-design.css stays exactly as the developer maintains it.

   Browsers without :has() (or without `clip`) simply fall back to the
   inherited `hidden`: the sidebar then scrolls with the page instead of
   sticking, which is a graceful degradation, not a broken layout.
   ─────────────────────────────────────────────────────────────────────── */
body:has(.legal-page){overflow-x:clip}

/* Breadcrumb — matches the service-page breadcrumb convention
   (slash separator, mono 12.5px) so the site reads consistently. */
.legal-page .legal-breadcrumb{padding-top:18px;font-family:var(--font-mono);font-size:12.5px;color:var(--text-dim)}
.legal-page .legal-breadcrumb a{color:var(--text-dim)}
.legal-page .legal-breadcrumb a:hover{color:var(--blue-bright)}
.legal-page .legal-breadcrumb span{margin:0 7px;color:var(--text-mute)}
.legal-page .legal-breadcrumb strong{color:var(--text-2);font-weight:600}

/* Page hero */
.legal-hero{padding:clamp(34px,4.5vw,56px) 0 clamp(30px,4vw,44px);position:relative;overflow:hidden}
.legal-hero::after{content:'';position:absolute;inset:0;pointer-events:none;background-image:linear-gradient(rgba(255,255,255,.018) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.018) 1px,transparent 1px);background-size:54px 54px;-webkit-mask-image:radial-gradient(ellipse 70% 60% at 50% 30%,#000,transparent 75%);mask-image:radial-gradient(ellipse 70% 60% at 50% 30%,#000,transparent 75%)}
.legal-hero .container{position:relative;z-index:1}
.legal-hero .eyebrow{display:inline-block;margin-bottom:14px}
.legal-hero-meta{display:flex;align-items:center;gap:20px;flex-wrap:wrap;margin-top:16px}
.legal-meta-item{display:flex;align-items:center;gap:7px;font-family:var(--font-mono);font-size:11.5px;color:var(--text-dim)}
.legal-meta-item svg{width:13px;height:13px;stroke:var(--text-dim);fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}

/* Layout: sticky sidebar + content */
.legal-layout{padding:clamp(30px,4vw,48px) 0 clamp(56px,8vw,96px)}
.legal-layout .container{display:grid;grid-template-columns:260px minmax(0,1fr);gap:52px;align-items:start}

/* Sidebar */
.legal-sidebar{position:sticky;top:86px}
.legal-sidebar-card{background:linear-gradient(180deg,rgba(255,255,255,.025),rgba(255,255,255,.005)),var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);overflow:hidden;box-shadow:0 1px 0 rgba(255,255,255,.04) inset,0 16px 36px rgba(0,0,0,.22)}
.legal-sidebar-head{padding:14px 18px;font-family:var(--font-mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--text-dim);border-bottom:1px solid var(--border);font-weight:500}
.legal-toc{padding:8px 0}
.legal-toc a{display:flex;align-items:center;gap:9px;padding:8px 18px;font-size:13px;color:var(--text-2);transition:color .15s,background .15s,border-color .15s;border-left:2px solid transparent;line-height:1.35}
.legal-toc a:hover{color:var(--text);background:rgba(255,255,255,.03);border-left-color:var(--blue)}
.legal-toc a.active{color:var(--blue-bright);border-left-color:var(--blue-bright);background:rgba(112,180,255,.06)}
.legal-toc a.sub{padding-left:30px;font-size:12px;color:var(--text-dim)}
.legal-toc a.sub .legal-toc-num{min-width:0}
.legal-toc a.sub::before{content:'';width:5px;height:1px;background:var(--text-mute);flex:0 0 auto;margin-top:9px;margin-right:-2px}
.legal-toc a.sub:hover{color:var(--text-2)}
.legal-toc-num{font-family:var(--font-mono);font-size:10px;color:var(--text-mute);min-width:18px;flex:0 0 auto;padding-top:2px}
.legal-toc a.active .legal-toc-num{color:var(--blue-bright)}

.legal-sidebar-related{margin-top:14px;background:linear-gradient(180deg,rgba(255,255,255,.025),rgba(255,255,255,.005)),var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);overflow:hidden;box-shadow:0 1px 0 rgba(255,255,255,.04) inset}
.legal-sidebar-related a{display:block;padding:9px 18px;font-size:13px;color:var(--text-2);border-bottom:1px solid var(--border);transition:color .15s}
.legal-sidebar-related a:last-child{border-bottom:none}
.legal-sidebar-related a:hover{color:var(--text)}
.legal-sidebar-related a[aria-current="page"]{color:var(--blue-bright);font-weight:600}

/* Content sections */
.legal-section{margin-bottom:40px;scroll-margin-top:96px}
.legal-section-head{display:flex;align-items:center;gap:14px;margin-bottom:18px;padding-bottom:14px;border-bottom:1px solid var(--border)}
.legal-num{display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:linear-gradient(180deg,rgba(112,180,255,.20),rgba(112,180,255,.06));border:1px solid rgba(112,180,255,.32);font-family:var(--font-mono);font-size:14px;font-weight:700;color:var(--blue-bright);line-height:1;flex:0 0 auto}
.legal-section-head h2{font-size:21px;font-weight:700;color:var(--text);letter-spacing:-.015em;line-height:1.25}
.legal-body{font-size:14px;color:var(--text-2);line-height:1.75}
.legal-body p{margin-bottom:12px;color:var(--text-2)}
.legal-body p:last-child{margin-bottom:0}
.legal-body a{color:var(--blue-bright);transition:color .15s}
.legal-body a:hover{color:var(--text)}
.legal-body strong{color:var(--text);font-weight:600}

/* Sub-headings inside a section */
.legal-sub{margin-top:26px;scroll-margin-top:96px}
.legal-sub h3{font-size:15.5px;font-weight:700;color:var(--text);margin-bottom:11px;display:flex;align-items:center;gap:10px;letter-spacing:-.01em;line-height:1.3}
.legal-sub h3::before{content:'';width:4px;height:17px;background:var(--blue-bright);border-radius:2px;display:inline-block;flex:0 0 auto}

/* Lists */
.legal-list{list-style:none;margin:10px 0;padding:0;display:flex;flex-direction:column;gap:6px}
.legal-list li{display:flex;align-items:flex-start;gap:10px;font-size:13.5px;color:var(--text-2);line-height:1.6}
.legal-list li::before{content:'';width:5px;height:5px;background:var(--blue-bright);border-radius:50%;margin-top:7px;flex:0 0 auto;opacity:.7}
.legal-list.check li::before{background:var(--green);opacity:1}
.legal-list.cross li::before{background:var(--red);border-radius:2px;transform:rotate(45deg)}

/* Key–value rows (data controller details, supervisory authority, etc.) */
.legal-defs{display:grid;gap:1px;margin:14px 0;border:1px solid var(--border);border-radius:var(--r-md);overflow:hidden;background:var(--border)}
.legal-defs>div{display:grid;grid-template-columns:180px minmax(0,1fr);gap:14px;padding:11px 16px;background:var(--surface);font-size:13.5px;line-height:1.6;align-items:start}
.legal-defs dt,.legal-defs .legal-defs-key{font-family:var(--font-mono);font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--text-dim);padding-top:2px;line-height:1.45}
.legal-defs dd,.legal-defs .legal-defs-val{margin:0;color:var(--text-2)}
.legal-defs a{color:var(--blue-bright)}
@media(max-width:600px){.legal-defs>div{grid-template-columns:1fr;gap:4px}}

/* Third-party embed slot (e.g. the Cookiebot cookie declaration table).
   Styled as an obvious placeholder so an un-replaced slot is caught in review
   rather than shipped silently. */
.legal-embed-slot{margin:16px 0;padding:22px;border:1px dashed rgba(112,180,255,.35);border-radius:var(--r-md);background:rgba(112,180,255,.04);font-size:13px;color:var(--text-dim);line-height:1.65}
.legal-embed-slot strong{color:var(--blue-bright)}
.legal-embed-slot p+p{margin-top:8px}
.legal-embed-slot code{font-family:var(--font-mono);font-size:12px;color:var(--text-2);background:rgba(255,255,255,.05);padding:1px 5px;border-radius:4px}
/* Cookiebot injects its own table markup here; keep it readable on the dark theme. */
#CookieDeclaration{font-size:13px;color:var(--text-2);line-height:1.7;overflow-x:auto}
#CookieDeclaration a{color:var(--blue-bright)}

/* Regulatory notices (ESMA, CFTC and similar statutory warnings) */
.legal-authority{display:flex;align-items:center;gap:9px;margin:0 0 12px;padding:8px 12px;border:1px solid rgba(251,191,36,.22);background:rgba(251,191,36,.05);border-radius:999px;font-family:var(--font-mono);font-size:10.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--amber);width:fit-content;max-width:100%}
.legal-authority svg{width:13px;height:13px;stroke:var(--amber);fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
@media(max-width:600px){.legal-authority{white-space:normal;border-radius:var(--r-sm);text-align:left}}

/* Callout boxes */
.legal-info-box{background:rgba(112,180,255,.07);border:1px solid rgba(112,180,255,.20);border-left:3px solid var(--blue-bright);border-radius:0 var(--r-sm) var(--r-sm) 0;padding:14px 16px;margin:16px 0;font-size:13px;color:var(--text-2);line-height:1.65}
.legal-warn-box{background:rgba(251,191,36,.07);border:1px solid rgba(251,191,36,.22);border-left:3px solid var(--amber);border-radius:0 var(--r-sm) var(--r-sm) 0;padding:14px 16px;margin:16px 0;font-size:13px;color:var(--text-2);line-height:1.65}
.legal-info-box strong,.legal-warn-box strong{color:var(--text)}
.legal-info-box p,.legal-warn-box p{margin:0}

/* Contact block */
.legal-contact-box{background:linear-gradient(180deg,rgba(255,255,255,.025),rgba(255,255,255,.005)),var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);padding:24px;display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin-top:8px;box-shadow:0 1px 0 rgba(255,255,255,.04) inset}
.legal-contact-icon{width:44px;height:44px;border-radius:50%;background:linear-gradient(180deg,rgba(112,180,255,.26),rgba(112,180,255,.08));border:1px solid rgba(112,180,255,.36);display:grid;place-items:center;flex:0 0 auto}
.legal-contact-icon svg{width:18px;height:18px;stroke:var(--blue-bright);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.legal-contact-info{flex:1 1 260px;min-width:0}
.legal-contact-info p{font-size:12.5px;color:var(--text-dim);margin-bottom:5px;line-height:1.6}
.legal-contact-info a.legal-contact-mail{color:var(--blue-bright);font-weight:600;font-size:14px;transition:color .15s}
.legal-contact-info a.legal-contact-mail:hover{color:var(--text)}
.legal-contact-box .btn{flex:0 0 auto;margin-left:auto}
@media(max-width:600px){.legal-contact-box .btn{margin-left:0;width:100%;justify-content:center}}

/* Mobile table of contents (shown where the sidebar is hidden) */
.legal-toc-mobile{display:none;margin-bottom:26px;border:1px solid var(--border);border-radius:var(--r-lg);background:linear-gradient(180deg,rgba(255,255,255,.025),rgba(255,255,255,.005)),var(--surface);overflow:hidden}
.legal-toc-mobile>summary{padding:14px 18px;font-family:var(--font-mono);font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:var(--text-dim);cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:10px}
.legal-toc-mobile>summary::-webkit-details-marker{display:none}
.legal-toc-mobile>summary::after{content:'+';font-size:16px;color:var(--blue-bright);line-height:1}
.legal-toc-mobile[open]>summary::after{content:'−'}
.legal-toc-mobile .legal-toc{border-top:1px solid var(--border);max-height:none}

@media(max-width:1040px){
  .legal-layout .container{grid-template-columns:220px minmax(0,1fr);gap:36px}
}
@media(max-width:860px){
  .legal-layout .container{grid-template-columns:1fr}
  .legal-sidebar{display:none}
  .legal-toc-mobile{display:block}
  .legal-section-head{gap:11px}
  .legal-num{font-size:22px;min-width:32px}
}
@media(max-width:600px){
  .legal-contact-box{padding:18px}
  .legal-hero-meta{gap:12px}
}
@media(prefers-reduced-motion:reduce){
  .legal-toc a,.legal-body a,.legal-sidebar-related a{transition:none}
}
