/* =====================================================================
   Legal documents and the cookie consent gate.

   Its own file rather than another block on app.css (5,600+ lines), matching how this codebase
   already splits marketing.css / portal.css / auth.css / help.css by area. All of them load on
   every page via assets/app.js, so the gate is styled wherever it is included.

   `.cookie-gate` was checked against bootstrap.min.css for collisions before being named —
   Bootstrap owns .modal and .toast, which is why that check is a habit here and not an assumption.
   ===================================================================== */

.legal { background: var(--bs-body-bg); color: var(--bs-body-color); padding: 3rem 1.25rem 5rem; }
.legal__wrap { max-width: 46rem; margin: 0 auto; }
.legal__back { margin-bottom: 2rem; font-size: 0.9rem; }
.legal__head { border-bottom: 1px solid var(--bs-border-color); padding-bottom: 1.25rem; margin-bottom: 2rem; }
.legal__title { font-size: 2rem; margin: 0 0 0.5rem; }
.legal__meta { margin: 0; color: var(--bs-muted); font-size: 0.9rem; }

/* Long-form prose: generous measure and spacing, because these are read under stress. */
.legal__body { line-height: 1.7; }
.legal__body h2 { font-size: 1.3rem; margin: 2.5rem 0 0.75rem; }
.legal__body h3 { font-size: 1.05rem; margin: 1.75rem 0 0.5rem; }
.legal__body p, .legal__body li { margin: 0 0 0.85rem; }
.legal__body ul, .legal__body ol { padding-left: 1.5rem; }
.legal__body table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.92rem; }
.legal__body th, .legal__body td { border: 1px solid var(--bs-border-color); padding: 0.5rem 0.65rem; text-align: left; vertical-align: top; }

/* A wide sub-processor table must scroll inside itself, never scroll the page sideways. */
.legal__body .legal-table-scroll { overflow-x: auto; }

.legal__placeholder { background: #fff3cd; color: #664d03; padding: 0.15rem 0.4rem; border-radius: 3px; font-weight: 600; }

.legal__foot { border-top: 1px solid var(--bs-border-color); margin-top: 3rem; padding-top: 1.5rem; font-size: 0.9rem; }
.legal__index { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 1rem; }
.legal__entity { color: var(--bs-muted); margin: 0; }

/* ---- The consent gate ---- */

.cookie-gate { position: fixed; inset-inline: 0; bottom: 0; z-index: 1080; background: var(--bs-body-bg); border-top: 1px solid var(--bs-border-color); box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18); }
.cookie-gate[hidden] { display: none; }
.cookie-gate__inner { max-width: 68rem; margin: 0 auto; padding: 1.25rem; display: grid; gap: 1rem; }
.cookie-gate__title { font-size: 1.05rem; margin: 0 0 0.35rem; }
.cookie-gate__text { margin: 0; font-size: 0.92rem; line-height: 1.55; }

.cookie-gate__choices { display: grid; gap: 0.75rem; border-top: 1px solid var(--bs-border-color); padding-top: 1rem; }
.cookie-gate__choice { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.9rem; }
.cookie-gate__choice em { display: block; font-style: normal; color: var(--bs-muted); font-size: 0.85rem; }

.cookie-gate__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

/* Reject and Accept share one class ON PURPOSE. Consent is not freely given if refusing is harder
   than agreeing, and a de-emphasised reject button is how that usually fails. Style them apart and
   the gate stops being compliant — this is a legal constraint wearing a CSS costume. */
.cookie-gate__btn { font: inherit; cursor: pointer; border-radius: 6px; padding: 0.55rem 1.1rem; border: 1px solid var(--bs-border-color); }
.cookie-gate__btn--choice { background: var(--bs-ink, #14161a); color: #fff; border-color: transparent; font-weight: 600; min-width: 10rem; }
.cookie-gate__btn--quiet { background: transparent; color: var(--bs-body-color); }
.cookie-gate__btn:focus-visible { outline: 2px solid #02b3fe; outline-offset: 2px; }

@media (min-width: 48rem) {
    .cookie-gate__inner { grid-template-columns: 1fr auto; align-items: center; }
    .cookie-gate__choices { grid-column: 1 / -1; }
    .cookie-gate__actions { justify-content: flex-end; }
}

/* Footer legal rows on the marketing site and the customer portal. */
.mk-footer__legal, .pt-footer__legal { display: flex; flex-wrap: wrap; gap: 0.9rem; font-size: 0.85rem; }
.js-cookie-settings { cursor: pointer; }
