/* ==========================================================================
   ClinPlacer legal documents — shared by the eight legal pages
   (terms, privacy, cookies, acceptable-use, refund-policy, security,
   data-processing, compliance), via includes/legal_layout.php.
   RULE: no hex codes here. Colour comes only from var(--cp-*) (includes/brand.php).
   ========================================================================== */

:root { --cp-footer-gap: 0; }
html { scroll-behavior: smooth; }

/* ---------- Hero extras ---------- */
.lgd-labels { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.lgd-label { display: inline-flex; align-items: center; padding: .4rem .95rem; border-radius: 999px; background: var(--cp-soft); border: 1px solid var(--cp-hairline); font-size: 13px; font-weight: 700; color: var(--cp-slate-700); }
.lgd-chips { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.75rem 0 0; padding: 0; list-style: none; }
.lgd-chips li { display: inline-flex; align-items: center; gap: .55rem; padding: .5rem 1rem; border-radius: 999px; background: var(--cp-soft); border: 1px solid var(--cp-hairline); font-size: 14px; font-weight: 700; color: var(--cp-navy); }
.lgd-chips i { color: var(--cp-teal-700); font-size: 13px; }
.lgd-updated { margin: 1.25rem 0 0; font-size: 14.5px; color: var(--cp-muted); }
.lgd-updated strong { color: var(--cp-navy); }

/* ---------- Layout: contents + document ---------- */
.lgd-main { background: var(--cp-soft); padding-block: clamp(1.75rem, 4vw, 3.5rem) clamp(3rem, 7vw, 5rem); }
.lgd-grid { display: grid; gap: 1.5rem; }
@media (min-width: 1024px) { .lgd-grid { grid-template-columns: 290px minmax(0, 1fr); gap: 3rem; align-items: start; } }
.lgd-content { min-width: 0; }

/* Table of contents: sticky list on desktop, collapsible on phones */
.lgd-side { display: none; }
@media (min-width: 1024px) {
    .lgd-side { display: block; position: sticky; top: calc(var(--cp-header-h) + 2rem); max-height: calc(100vh - var(--cp-header-h) - 4rem); overflow-y: auto; }
    .lgd-toc-m { display: none; }
}
.lgd-toc { background: var(--cp-white); border: 1px solid var(--cp-hairline); border-radius: 22px; padding: 1.1rem; }
.lgd-toc-h { margin: 0 0 .6rem .5rem; font-size: 14px; font-weight: 700; color: var(--cp-navy); }
.lgd-toc ol, .lgd-toc-m ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.lgd-toc a, .lgd-toc-m a { display: block; padding: .45rem .75rem; border-left: 2px solid var(--cp-hairline); font-size: 14px; line-height: 1.4; color: var(--cp-muted); text-decoration: none; transition: color .15s, border-color .15s, background .15s; }
.lgd-toc a:hover, .lgd-toc-m a:hover { color: var(--cp-navy); border-left-color: var(--cp-silver); }
.lgd-toc a.is-active { color: var(--cp-blue-700); font-weight: 700; border-left-color: var(--cp-teal); background: var(--cp-blue-50); }
.lgd-toc-m { margin-bottom: .25rem; background: var(--cp-white); border: 1px solid var(--cp-hairline); border-radius: 16px; }
.lgd-toc-m summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; padding: .95rem 1.1rem; font-weight: 700; font-size: 15px; color: var(--cp-navy); }
.lgd-toc-m summary::-webkit-details-marker { display: none; }
.lgd-toc-m summary i { color: var(--cp-blue-700); transition: transform .2s; }
.lgd-toc-m[open] summary i { transform: rotate(180deg); }
.lgd-toc-m ol { padding: 0 1rem 1rem; }

/* "At a glance" card */
.lgd-intro { margin: 1.25rem 0 1.5rem; padding: clamp(1.4rem, 3.5vw, 2rem); background: var(--cp-white); border: 1px solid var(--cp-hairline); border-radius: 24px; }
.lgd-intro .tag { display: inline-flex; align-items: center; padding: .35rem .9rem; border-radius: 999px; border: 1.5px solid var(--cp-teal); font-size: 13px; font-weight: 700; color: var(--cp-navy); }
.lgd-intro h2 { margin: 1rem 0 .6rem; font-size: clamp(1.4rem, 2.6vw, 1.8rem); line-height: 1.2; font-weight: 700; letter-spacing: -0.025em; color: var(--cp-navy); }
.lgd-intro p { margin: 0; font-size: 1.0625rem; line-height: 1.7; color: var(--cp-slate-700); }
.lgd-intro p strong { color: var(--cp-navy); }
.lgd-badges { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.lgd-badge { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem 1rem; border-radius: 999px; background: var(--cp-soft); border: 1px solid var(--cp-hairline); font-size: 13.5px; font-weight: 700; color: var(--cp-navy); }
.lgd-badge i { color: var(--cp-teal-700); font-size: 12px; }

/* The document itself */
.lgd-sheet { background: var(--cp-white); border: 1px solid var(--cp-hairline); border-radius: 26px; padding: clamp(1.4rem, 4vw, 2.75rem); box-shadow: var(--cp-shadow-sm); }
.lgd-sec { padding-block: 2rem; border-top: 1px solid var(--cp-hairline); scroll-margin-top: calc(var(--cp-header-h) + 1.5rem); }
.lgd-sec:first-child { border-top: 0; padding-top: 0; }
.lgd-sec:last-child { padding-bottom: 0; }
.lgd-sec > h2 { margin: 0 0 1rem; font-size: clamp(1.25rem, 2.3vw, 1.55rem); line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; color: var(--cp-navy); }
.lgd-sec > h2 a { color: inherit; text-decoration: none; }
.lgd-sec > h2 a:hover::after { content: " #"; color: var(--cp-teal-700); font-weight: 700; }
.lgd-body { font-size: 15.5px; line-height: 1.75; color: var(--cp-slate-700); overflow-wrap: break-word; }
.lgd-sec .lgd-body > * + * { margin-top: .25rem; }   /* same effective spacing as the old 'space-y-1' wrapper */
.lgd-body strong { color: var(--cp-navy); }
.lgd-body a { color: var(--cp-link); text-decoration: underline; text-underline-offset: 3px; }
.lgd-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }

/* ---- Classes used inside the legal text (ported from the old per-page styles) ---- */
.list-mark { flex-shrink: 0; width: 6px; height: 6px; margin-top: .6rem; border-radius: 999px; background: var(--cp-teal); }

.callout { display: flex; gap: .85rem; border-radius: 16px; padding: 1rem 1.15rem; font-size: 14.5px; line-height: 1.6; }
.callout-icon { width: 1.2rem; height: 1.2rem; flex-shrink: 0; margin-top: .1rem; }
.callout-icon svg { width: 100%; height: 100%; }
.callout-title { margin-bottom: .2rem; font-size: 14.5px; font-weight: 700; }
.callout-info { background: var(--cp-blue-50); border: 1px solid var(--cp-blue-200); color: var(--cp-slate-800); }
.callout-info .callout-title { color: var(--cp-blue-700); } .callout-info .callout-icon { color: var(--cp-blue-700); }
.callout-warning { background: var(--cp-slate-100); border: 1px solid var(--cp-slate-300); border-left: 4px solid var(--cp-navy); color: var(--cp-slate-800); }
.callout-warning .callout-title { color: var(--cp-navy); } .callout-warning .callout-icon { color: var(--cp-navy); }
.callout-compliance { background: var(--cp-teal-50); border: 1px solid var(--cp-teal-200); color: var(--cp-slate-800); }
.callout-compliance .callout-title { color: var(--cp-teal-700); } .callout-compliance .callout-icon { color: var(--cp-teal-700); }

.contact-card { padding: 1rem; background: var(--cp-soft); border: 1px solid var(--cp-hairline); border-radius: 16px; text-align: center; }
.contact-card-label { margin-bottom: .35rem; font-size: 12.5px; font-weight: 700; color: var(--cp-slate-500); }
.contact-card-value { font-size: 15px; font-weight: 700; color: var(--cp-blue-700); text-decoration: none; overflow-wrap: anywhere; }
.contact-card-value:hover { text-decoration: underline; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--cp-hairline); border-radius: 16px; }
.legal-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; }
.legal-table thead th { padding: .8rem 1rem; text-align: left; background: var(--cp-soft); color: var(--cp-slate-600); font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--cp-hairline); }
.legal-table tbody td { padding: .8rem 1rem; color: var(--cp-slate-700); border-bottom: 1px solid var(--cp-hairline); vertical-align: top; }
.legal-table tbody tr:last-child td { border-bottom: 0; }
.legal-table code { padding: .12rem .45rem; background: var(--cp-slate-100); color: var(--cp-navy); border-radius: 6px; font-size: .85em; }

.security-item { padding: .75rem .95rem; background: var(--cp-soft); border: 1px solid var(--cp-hairline); border-left: 3px solid var(--cp-teal); border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--cp-slate-700); }

.timeline { display: grid; gap: 1rem; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .timeline { grid-template-columns: 1fr; } }
.timeline-step { position: relative; padding: 1.15rem; background: var(--cp-soft); border: 1px solid var(--cp-hairline); border-radius: 16px; }
.timeline-dot { display: flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; margin-bottom: .65rem; border-radius: 999px; background: var(--cp-blue); color: var(--cp-white); font-size: .85rem; font-weight: 700; }
.timeline-title { margin-bottom: .3rem; font-size: 15px; font-weight: 700; color: var(--cp-navy); }
.timeline-desc { font-size: 14px; line-height: 1.55; color: var(--cp-slate-600); }

/* ---------- Print: just the document ---------- */
@media print {
    #site-header, .cp-skip, .lgd-side, .lgd-toc-m, .cp-cta-block, .cp-footer, .lgd-chips, .cp-hero::before, .cp-hero::after { display: none !important; }
    .lgd-main, .cp-hero { background: none; padding-block: 0; }
    .lgd-sheet, .lgd-intro { border: 0; box-shadow: none; padding: 0; }
    .lgd-sec { break-inside: avoid-page; }
    .lgd-body a::after { content: " (" attr(href) ")"; font-size: .85em; color: var(--cp-slate-500); }
}
