/* Shared layout for the standalone legal pages (Privacy Policy, Terms of Use).
   Loaded only by views/legal/*.php — kept out of app.css since no other
   authenticated page needs it. */

.legal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e6ee;
    background: #fff;
}

.legal-topbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #16202e;
    font-weight: 700;
}

.legal-topbar .brand img {
    height: 32px;
    width: auto;
}

.legal-topbar .actions a {
    margin-left: 16px;
    font-size: 14px;
    text-decoration: none;
    color: #5b6b82;
}

.legal-topbar .actions a.primary {
    color: #0d6efd;
    font-weight: 600;
}

.legal-shell {
    display: flex;
    max-width: 1180px;
    margin: 0 auto;
    align-items: flex-start;
}

.legal-toc {
    width: 260px;
    flex: 0 0 260px;
    position: sticky;
    top: 24px;
    padding: 32px 16px 40px 24px;
    font-size: 14px;
}

.legal-toc a {
    display: block;
    padding: 6px 10px;
    border-radius: 8px;
    color: #5b6b82;
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-bottom: 2px;
}

.legal-toc a:hover {
    background: #eef1f8;
    color: #16202e;
}

.legal-toc a.active {
    color: #0d6efd;
    background: #e8f1ff;
    border-left-color: #0d6efd;
    font-weight: 600;
}

.legal-content {
    flex: 1;
    min-width: 0;
    padding: 40px 40px 100px;
    max-width: 820px;
}

.legal-content h1 {
    font-size: 2.1rem;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.legal-content .subtitle {
    color: #5b6b82;
    margin-bottom: 30px;
}

.legal-content .updated-badge {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e8f1ff;
    color: #0d6efd;
    margin-bottom: 24px;
}

.legal-content section {
    margin-top: 40px;
    scroll-margin-top: 20px;
}

.legal-content h2 {
    font-size: 1.35rem;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e6ee;
}

.legal-content h3 {
    font-size: 1.05rem;
    margin: 22px 0 8px;
}

.legal-content p,
.legal-content li {
    color: #33404f;
    line-height: 1.7;
}

.legal-content ul,
.legal-content ol {
    padding-left: 1.4em;
}

.legal-content li {
    margin: 6px 0;
}

.legal-callout {
    background: #f5f7fb;
    border: 1px solid #e2e6ee;
    border-left: 3px solid #0d6efd;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 18px 0;
    font-size: 14.5px;
}

.legal-callout strong {
    display: block;
    margin-bottom: 4px;
    color: #0d6efd;
}

.legal-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
    font-size: 14px;
}

.legal-content th,
.legal-content td {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid #e2e6ee;
    vertical-align: top;
}

.legal-content th {
    color: #5b6b82;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.legal-footer {
    max-width: 820px;
    margin: 60px auto 0;
    padding: 24px 40px 60px;
    color: #5b6b82;
    font-size: 13px;
    border-top: 1px solid #e2e6ee;
}

.legal-toc-toggle {
    display: none;
}

@media (max-width: 980px) {
    .legal-toc {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 40;
        background: #fff;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 20px 0 40px rgba(0, 0, 0, .15);
        overflow-y: auto;
        width: 260px;
    }

    .legal-toc.open {
        transform: translateX(0);
    }

    .legal-toc-toggle {
        display: flex;
        position: fixed;
        top: 76px;
        left: 16px;
        z-index: 41;
        width: 42px;
        height: 42px;
        border-radius: 10px;
        background: #fff;
        border: 1px solid #e2e6ee;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 4px 14px rgba(16, 24, 40, .12);
    }

    .legal-content {
        padding: 40px 22px 100px;
    }
}

/* ── Cookie policy additions ────────────────────────────────────────────
   Used by views/legal/cookies.php. The cookie tables name real identifiers,
   which need to read as literals rather than prose, and the policy carries an
   inline control that opens the consent panel — a real action rather than a
   navigation, so it is styled as a button instead of a link. */

.legal-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .88em;
    background: #f1f4f9;
    border: 1px solid #e2e6ee;
    border-radius: 5px;
    padding: 1px 5px;
    /* Cookie names run long and must not force the table wider than the page. */
    overflow-wrap: anywhere;
}

.legal-inline-button {
    display: inline-block;
    background: #0d6efd;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    padding: 10px 18px;
    transition: background-color .15s ease;
}

.legal-inline-button:hover {
    background: #0b5ed7;
    color: #fff;
}

.legal-inline-button:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}
