/**
 * FLEX — Legal document page (Terms of Service & Privacy Policy).
 */

html.legal-page-root,
html.legal-page-root body {
    margin: 0;
    min-height: 100%;
    background: #0a0806;
    color: #e8dcc0;
}

.legal-page-shell {
    min-height: var(--ra-layout-vh, 100dvh);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.legal-page-header {
    flex: 0 0 auto;
    padding: max(18px, env(safe-area-inset-top)) 20px 14px;
    border-bottom: 1px solid rgba(184, 144, 48, 0.35);
    background:
        linear-gradient(180deg, rgba(255, 215, 0, 0.06) 0%, transparent 28%),
        linear-gradient(165deg, rgba(34, 28, 20, 0.98) 0%, rgba(10, 8, 6, 0.99) 100%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.legal-page-header-inner {
    max-width: 920px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.legal-page-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffd978;
    text-decoration: none;
    font-family: var(--font-title);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.legal-page-brand-link:hover {
    color: #fff0b8;
}

.legal-page-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border: 1px solid rgba(184, 144, 48, 0.45);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.35);
    color: #f1e0ac;
    font-family: var(--font-title);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease;
}

.legal-page-back-btn:hover {
    border-color: rgba(255, 215, 0, 0.62);
    background: rgba(48, 40, 24, 0.85);
}

.legal-page-main {
    flex: 1 1 auto;
    padding: 28px 20px max(32px, env(safe-area-inset-bottom));
}

.legal-page-article {
    max-width: 920px;
    margin: 0 auto;
    padding: 28px 28px 36px;
    border: 1px solid rgba(184, 144, 48, 0.32);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 215, 0, 0.05) 0%, transparent 18%),
        linear-gradient(165deg, rgba(28, 22, 16, 0.97) 0%, rgba(12, 10, 8, 0.99) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 215, 0, 0.1),
        0 12px 32px rgba(0, 0, 0, 0.42);
}

.legal-page-title {
    margin: 0 0 8px;
    font-family: var(--font-title);
    font-size: clamp(1.35rem, 3.2vw, 1.85rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffd978;
    line-height: 1.25;
}

.legal-page-updated {
    margin: 0 0 22px;
    font-size: 0.88rem;
    color: rgba(220, 208, 176, 0.72);
}

.legal-document-root {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    color: #e8dcc0;
}

.legal-document-root h1,
.legal-document-root h2,
.legal-document-root h3,
.legal-document-root h4 {
    font-family: var(--font-title);
    color: #f1e0ac;
    letter-spacing: 0.04em;
    line-height: 1.3;
    margin: 1.6em 0 0.55em;
}

.legal-document-root h1 {
    font-size: 1.35rem;
}

.legal-document-root h2 {
    font-size: 1.15rem;
    color: #ffd978;
}

.legal-document-root h3 {
    font-size: 1rem;
}

.legal-document-root p {
    margin: 0 0 1em;
}

.legal-document-root ul {
    margin: 0 0 1.1em 1.2em;
    padding: 0;
}

.legal-document-root li {
    margin: 0.35em 0;
}

.legal-document-root blockquote {
    margin: 0 0 1.1em;
    padding: 12px 14px;
    border-left: 3px solid rgba(184, 144, 48, 0.55);
    background: rgba(0, 0, 0, 0.28);
    border-radius: 0 4px 4px 0;
}

.legal-document-root a {
    color: #ffd978;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-document-root a:hover {
    color: #fff0b8;
}

.legal-document-loading,
.legal-document-error {
    margin: 0;
    color: rgba(220, 208, 176, 0.85);
}

.legal-page-footer {
    max-width: 920px;
    margin: 18px auto 0;
    font-size: 0.82rem;
    color: rgba(200, 188, 160, 0.7);
    text-align: center;
}

@media (max-width: 720px) {
    .legal-page-main {
        padding: 18px 12px max(24px, env(safe-area-inset-bottom));
    }

    .legal-page-article {
        padding: 20px 16px 26px;
        border-radius: 6px;
    }

    .legal-document-root {
        font-size: 0.95rem;
    }
}
