/* ==========================================================================
   Kaissen Legal Center
   Scoped under .legal-page so nothing here leaks into the rest of the site,
   and so the site's global element rules (span, a, h1-h6, input) are
   neutralised only where we need them to be.
   ========================================================================== */

.legal-page {
    /* Brand ------------------------------------------------------------- */
    --lg-teal: #146973;
    --lg-teal-dark: #0e4a51;
    --lg-teal-tint: #e8f2f3;

    /* #ff661b scores 2.93:1 on white, below WCAG AA. It stays decorative;
       --lg-accent-text is the darkened family member used for any text or
       button surface (4.79:1 on white). */
    --lg-accent: #ff661b;
    --lg-accent-text: #c24e00;
    --lg-accent-tint: #fff1e9;

    /* Neutrals ---------------------------------------------------------- */
    --lg-ink: #1f2933;
    --lg-body: #3d4a52;
    --lg-muted: #5a6b73;
    --lg-border: #dde5e8;
    --lg-border-soft: #eef2f4;
    --lg-surface: #ffffff;
    --lg-bg: #f6f8f9;

    /* Metrics ----------------------------------------------------------- */
    --lg-header-h: 135px;
    --lg-anchor-offset: 155px;
    --lg-radius: 10px;
    --lg-radius-sm: 6px;
    --lg-shadow: 0 1px 2px rgba(31, 41, 51, .05), 0 8px 24px rgba(31, 41, 51, .06);
    --lg-shadow-lift: 0 2px 4px rgba(31, 41, 51, .06), 0 16px 40px rgba(31, 41, 51, .10);
    --lg-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --lg-font-display: 'futura_bk_btbook', var(--lg-font);

    background: var(--lg-bg);
    color: var(--lg-body);
    font-family: var(--lg-font);
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* --- Neutralise inherited global rules ----------------------------------
   estilos.css sets `span { font-size: 48px; color: #ff661b }` and turns
   `span a` into a large orange pill button. Both would wreck this layout. */
.legal-page span {
    font-size: inherit;
    color: inherit;
}

.legal-page span a {
    font-family: inherit;
    color: inherit;
    background-color: transparent;
    padding: 0;
    border: 0;
    border-radius: 0;
}

.legal-page h1,
.legal-page h2,
.legal-page h3,
.legal-page h4 {
    font-family: var(--lg-font-display);
    color: var(--lg-ink);
}

.legal-page p {
    margin: 0 0 1.15em;
}

.legal-page input {
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    padding: 0;
}

html {
    scroll-behavior: auto;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* --- Accessibility primitives ------------------------------------------
   main.css sets `outline: none` on every :focus. Restore a visible ring. */
.legal-page a:focus-visible,
.legal-page button:focus-visible,
.legal-page input:focus-visible,
.legal-page summary:focus-visible,
.legal-page [tabindex]:focus-visible {
    outline: 3px solid var(--lg-teal);
    outline-offset: 2px;
    border-radius: 3px;
}

.lg-skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1200;
    background: var(--lg-teal);
    color: #fff;
    padding: 14px 22px;
    border-radius: 0 0 var(--lg-radius-sm) 0;
    font-weight: 600;
    text-decoration: none;
}

.lg-skip:focus {
    left: 0;
    color: #fff;
}

.lg-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Page shell --------------------------------------------------------- */
.lg-main {
    padding-top: calc(var(--lg-header-h) + 8px);
    padding-bottom: 80px;
}

.lg-wrap {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Breadcrumb --------------------------------------------------------- */
.lg-breadcrumb {
    padding: 22px 0 6px;
}

.lg-breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    font-size: 14px;
    color: var(--lg-muted);
}

.lg-breadcrumb li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lg-breadcrumb li + li::before {
    content: "/";
    color: #b3c0c5;
}

.lg-breadcrumb a {
    color: var(--lg-muted);
    text-decoration: none;
    transition: color .2s;
}

.lg-breadcrumb a:hover {
    color: var(--lg-teal);
    text-decoration: underline;
}

.lg-breadcrumb [aria-current="page"] {
    color: var(--lg-ink);
    font-weight: 600;
}

/* --- Hero (index) ------------------------------------------------------- */
.lg-hero {
    padding: 26px 0 44px;
    max-width: 760px;
}

.lg-hero h1 {
    font-size: clamp(34px, 5vw, 50px);
    line-height: 1.15;
    margin: 0 0 18px;
    letter-spacing: -.01em;
}

.lg-hero .lg-rule {
    width: 80px;
    height: 6px;
    background: var(--lg-accent);
    border-radius: 3px;
    margin-bottom: 22px;
}

.lg-hero p {
    font-size: 19px;
    color: var(--lg-muted);
    margin: 0;
}

/* --- Card grid ---------------------------------------------------------- */
.lg-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.lg-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--lg-surface);
    border: 1px solid var(--lg-border);
    border-radius: var(--lg-radius);
    padding: 30px 28px 26px;
    box-shadow: var(--lg-shadow);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.lg-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--lg-shadow-lift);
    border-color: #c9d8db;
}

.lg-card:focus-within {
    border-color: var(--lg-teal);
}

.lg-card__icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: var(--lg-radius-sm);
    background: var(--lg-teal-tint);
    color: var(--lg-teal);
    margin-bottom: 18px;
}

.lg-card__icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.lg-card h2 {
    font-size: 21px;
    line-height: 1.3;
    margin: 0 0 10px;
}

/* The whole card is one link and one tab stop: the <a> covers the card,
   the "Read document" row is a visual affordance, not a second control. */
.lg-card h2 a {
    color: var(--lg-ink);
    text-decoration: none;
}

.lg-card h2 a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--lg-radius);
}

.lg-card h2 a:hover {
    color: var(--lg-teal);
}

.lg-card p {
    font-size: 15.5px;
    color: var(--lg-muted);
    margin: 0 0 20px;
    flex: 1 1 auto;
}

.lg-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    color: var(--lg-accent-text);
}

.lg-card__cta svg {
    width: 14px;
    height: 14px;
    transition: transform .25s ease;
}

.lg-card:hover .lg-card__cta svg {
    transform: translateX(4px);
}

/* --- Index: contact strip ----------------------------------------------- */
.lg-note {
    margin-top: 44px;
    background: var(--lg-surface);
    border: 1px solid var(--lg-border);
    border-left: 4px solid var(--lg-accent);
    border-radius: var(--lg-radius);
    padding: 24px 28px;
}

.lg-note h2 {
    font-size: 19px;
    margin: 0 0 8px;
}

.lg-note p {
    margin: 0;
    font-size: 15.5px;
    color: var(--lg-muted);
}

.lg-note a {
    color: var(--lg-teal);
    font-weight: 600;
}

/* --- Document header ---------------------------------------------------- */
.lg-dochead {
    padding: 10px 0 26px;
    border-bottom: 1px solid var(--lg-border);
    margin-bottom: 34px;
}

.lg-dochead h1 {
    font-size: clamp(30px, 4.4vw, 44px);
    line-height: 1.18;
    margin: 0 0 14px;
    letter-spacing: -.01em;
    max-width: 30ch;
}

.lg-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    font-size: 14.5px;
    color: var(--lg-muted);
    margin-bottom: 24px;
}

.lg-meta__badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--lg-teal-tint);
    color: var(--lg-teal-dark);
    border-radius: 100px;
    padding: 5px 14px;
    font-weight: 600;
    font-size: 13.5px;
}

.lg-meta__badge svg {
    width: 14px;
    height: 14px;
}

/* --- Toolbar ------------------------------------------------------------ */
.lg-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.lg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: var(--lg-radius-sm);
    border: 1px solid var(--lg-border);
    background: var(--lg-surface);
    color: var(--lg-ink);
    font-family: var(--lg-font);
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}

.lg-btn svg {
    width: 16px;
    height: 16px;
    flex: none;
}

.lg-btn:hover {
    background: var(--lg-teal-tint);
    border-color: #bcd4d7;
    color: var(--lg-teal-dark);
}

.lg-btn--primary {
    background: var(--lg-accent-text);
    border-color: var(--lg-accent-text);
    color: #fff;
}

.lg-btn--primary:hover {
    background: #a94200;
    border-color: #a94200;
    color: #fff;
}

/* --- In-document search ------------------------------------------------- */
.lg-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--lg-surface);
    border: 1px solid var(--lg-border);
    border-radius: var(--lg-radius-sm);
    padding: 0 10px 0 14px;
    min-height: 44px;
    flex: 1 1 280px;
    max-width: 420px;
    transition: border-color .2s, box-shadow .2s;
}

.lg-search:focus-within {
    border-color: var(--lg-teal);
    box-shadow: 0 0 0 3px rgba(20, 105, 115, .12);
}

.lg-search > svg {
    width: 17px;
    height: 17px;
    color: var(--lg-muted);
    flex: none;
}

.lg-search input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    font-family: var(--lg-font);
    font-size: 15px;
    color: var(--lg-ink);
    padding: 10px 0;
}

.lg-search input:focus {
    outline: none;
}

.lg-search input::placeholder {
    color: #93a3aa;
}

.lg-search__count {
    font-size: 13px;
    color: var(--lg-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.lg-search__nav {
    display: flex;
    gap: 2px;
}

.lg-search__nav button {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--lg-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}

.lg-search__nav button:hover:not(:disabled) {
    background: var(--lg-teal-tint);
    color: var(--lg-teal-dark);
}

.lg-search__nav button:disabled {
    opacity: .35;
    cursor: default;
}

.lg-search__nav svg {
    width: 14px;
    height: 14px;
}

.legal-page mark {
    background: #ffe9a8;
    color: inherit;
    padding: 1px 0;
    border-radius: 2px;
}

.legal-page mark.is-current {
    background: var(--lg-accent);
    color: #fff;
}

/* --- Document layout ---------------------------------------------------- */
.lg-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 34px;
    align-items: start;
}

@media (min-width: 992px) {
    .lg-layout {
        grid-template-columns: 268px minmax(0, 1fr);
        gap: 56px;
    }
}

/* --- Table of contents -------------------------------------------------- */
.lg-toc {
    background: var(--lg-surface);
    border: 1px solid var(--lg-border);
    border-radius: var(--lg-radius);
    overflow: hidden;
}

@media (min-width: 992px) {
    .lg-toc {
        position: sticky;
        top: var(--lg-anchor-offset);
        max-height: calc(100vh - var(--lg-anchor-offset) - 30px);
        display: flex;
        flex-direction: column;
    }
}

.lg-toc > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 15px 18px;
    font-family: var(--lg-font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lg-ink);
    cursor: pointer;
    list-style: none;
    min-height: 48px;
}

.lg-toc > summary::-webkit-details-marker {
    display: none;
}

.lg-toc > summary svg {
    width: 15px;
    height: 15px;
    color: var(--lg-muted);
    transition: transform .25s ease;
    flex: none;
}

.lg-toc[open] > summary svg {
    transform: rotate(180deg);
}

@media (min-width: 992px) {
    /* On desktop the panel is always open; hide the disclosure arrow. */
    .lg-toc > summary {
        cursor: default;
        border-bottom: 1px solid var(--lg-border-soft);
    }

    .lg-toc > summary svg {
        display: none;
    }
}

.lg-toc__body {
    overflow-y: auto;
    padding: 8px 8px 14px;
}

.lg-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lg-toc a {
    display: block;
    padding: 7px 12px;
    border-left: 2px solid transparent;
    font-size: 14.5px;
    line-height: 1.45;
    color: var(--lg-muted);
    text-decoration: none;
    border-radius: 0 4px 4px 0;
    transition: color .18s, background .18s, border-color .18s;
}

.lg-toc a:hover {
    color: var(--lg-teal-dark);
    background: var(--lg-teal-tint);
}

.lg-toc a[aria-current="true"] {
    color: var(--lg-teal-dark);
    background: var(--lg-teal-tint);
    border-left-color: var(--lg-accent);
    font-weight: 600;
}

.lg-toc .lg-toc__sub a {
    padding-left: 26px;
    font-size: 13.5px;
}

/* --- Article prose ------------------------------------------------------ */
.lg-article {
    background: var(--lg-surface);
    border: 1px solid var(--lg-border);
    border-radius: var(--lg-radius);
    padding: 44px 48px 48px;
    box-shadow: var(--lg-shadow);
    max-width: 74ch;
}

@media (max-width: 575px) {
    .lg-article {
        padding: 28px 22px 32px;
    }
}

.lg-article > *:first-child {
    margin-top: 0;
}

.lg-article h2 {
    font-size: 25px;
    line-height: 1.3;
    margin: 2.2em 0 .7em;
    padding-top: .3em;
    scroll-margin-top: var(--lg-anchor-offset);
}

.lg-article h2:first-of-type {
    margin-top: 0;
}

.lg-article h3 {
    font-size: 19.5px;
    line-height: 1.35;
    color: var(--lg-teal-dark);
    margin: 1.9em 0 .6em;
    scroll-margin-top: var(--lg-anchor-offset);
}

.lg-article h2:focus,
.lg-article h3:focus {
    outline: none;
}

.lg-article h2:focus-visible,
.lg-article h3:focus-visible {
    outline: 3px solid var(--lg-teal);
    outline-offset: 4px;
}

.lg-article p {
    margin: 0 0 1.15em;
}

.lg-article ul,
.lg-article ol {
    margin: 0 0 1.3em;
    padding-left: 1.35em;
}

.lg-article li {
    margin-bottom: .45em;
}

.lg-article ul li::marker {
    color: var(--lg-accent);
}

.lg-article ol li::marker {
    color: var(--lg-teal);
    font-weight: 600;
}

.lg-article strong {
    color: var(--lg-ink);
    font-weight: 600;
}

.lg-article a {
    color: var(--lg-teal);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.lg-article a:hover {
    color: var(--lg-accent-text);
}

.lg-article hr {
    border: 0;
    border-top: 1px solid var(--lg-border-soft);
    margin: 2.4em 0;
}

/* Definition-style list used by "Definitions" sections. */
.lg-deflist {
    margin: 0 0 1.4em;
    padding: 0;
}

.lg-deflist dt {
    font-weight: 600;
    color: var(--lg-ink);
    margin-top: .9em;
}

.lg-deflist dd {
    margin: 0;
    color: var(--lg-body);
}

/* Callout for the closing consent/transparency declarations. */
.lg-callout {
    background: var(--lg-accent-tint);
    border: 1px solid #f6d5c1;
    border-radius: var(--lg-radius);
    padding: 26px 28px 10px;
    margin: 2.4em 0 1.4em;
}

.lg-callout h2 {
    margin-top: 0;
    font-size: 21px;
}

.lg-callout > *:last-child {
    margin-bottom: 1.15em;
}

/* --- Document footer / back to top -------------------------------------- */
.lg-docfoot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 28px;
    padding-top: 22px;
}

.lg-docfoot p {
    margin: 0;
    font-size: 14px;
    color: var(--lg-muted);
}

.lg-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid var(--lg-border);
    border-radius: 50%;
    background: var(--lg-surface);
    color: var(--lg-teal-dark);
    box-shadow: var(--lg-shadow-lift);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .25s, transform .25s, visibility .25s, background .2s;
    z-index: 900;
}

.lg-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lg-top:hover {
    background: var(--lg-teal);
    border-color: var(--lg-teal);
    color: #fff;
}

.lg-top svg {
    width: 18px;
    height: 18px;
}

/* --- Share -------------------------------------------------------------- */
.lg-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 34px;
    padding-top: 26px;
    border-top: 1px solid var(--lg-border);
}

.lg-share__label {
    font-size: 14px;
    font-weight: 600;
    color: var(--lg-ink);
    margin-right: 4px;
}

.lg-share__btn {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--lg-border);
    border-radius: var(--lg-radius-sm);
    background: var(--lg-surface);
    color: var(--lg-muted);
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, color .2s, border-color .2s, transform .2s;
}

.lg-share__btn:hover {
    transform: translateY(-2px);
    border-color: var(--lg-teal);
    background: var(--lg-teal);
    color: #fff;
}

.lg-share__btn svg {
    width: 18px;
    height: 18px;
}

.lg-share__status {
    font-size: 13.5px;
    color: var(--lg-teal-dark);
    font-weight: 600;
}

/* --- Entrance animation -------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
    .lg-reveal {
        animation: lg-rise .5s ease both;
    }

    .lg-cards .lg-card:nth-child(1) { animation-delay: .04s; }
    .lg-cards .lg-card:nth-child(2) { animation-delay: .10s; }
    .lg-cards .lg-card:nth-child(3) { animation-delay: .16s; }
    .lg-cards .lg-card:nth-child(4) { animation-delay: .22s; }
    .lg-cards .lg-card:nth-child(5) { animation-delay: .28s; }
}

@keyframes lg-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .legal-page *,
    .legal-page *::before,
    .legal-page *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* --- Small screens ------------------------------------------------------- */
@media (max-width: 991px) {
    .legal-page {
        font-size: 16.5px;
    }

    .lg-main {
        padding-top: calc(var(--lg-header-h) - 20px);
    }
}

@media (max-width: 575px) {
    .lg-wrap {
        padding: 0 16px;
    }

    .lg-toolbar {
        gap: 10px;
    }

    .lg-search {
        flex: 1 1 100%;
        max-width: none;
    }

    .lg-top {
        right: 14px;
        bottom: 14px;
    }
}

/* --- Print-only blocks ---------------------------------------------------
   Rendered by legal-print.css; never shown on screen. */
.lg-printhead,
.lg-printfoot {
    display: none;
}

/* --- Quoted wording (short consent text) --------------------------------- */
.lg-article blockquote {
    margin: 1.6em 0;
    padding: 18px 22px;
    background: var(--lg-teal-tint);
    border-left: 4px solid var(--lg-teal);
    border-radius: 0 var(--lg-radius-sm) var(--lg-radius-sm) 0;
    color: var(--lg-ink);
    font-style: italic;
}

.lg-article blockquote > *:last-child {
    margin-bottom: 0;
}
