:root {
    --legal-primary: #9477eb;
    --legal-primary-dark: #7356ce;
    --legal-primary-soft: #f4f0ff;
    --legal-text: #242424;
    --legal-muted: #6d6d6d;
    --legal-border: #ebe7f6;
    --legal-surface: #ffffff;
    --legal-background: #faf9fd;
}

* {
    box-sizing: border-box;
}

.legal-page-body {
    min-height: 100vh;
    margin: 0;
    background: var(--legal-background);
    color: var(--legal-text);
    font-family: "Almarai", sans-serif;
    line-height: 1.85;
}

.legal-site-header {
    position: sticky;
    z-index: 20;
    top: 0;
    height: auto;
    border-bottom: 1px solid rgba(235, 231, 246, .9);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 30px rgba(52, 40, 92, .05);
    backdrop-filter: blur(14px);
}

.legal-brand {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    color: var(--legal-text);
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
}

.legal-brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.legal-home-link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: .55rem 1.15rem;
    border: 1px solid var(--legal-border);
    border-radius: 999px;
    color: var(--legal-primary-dark);
    font-weight: 700;
    text-decoration: none;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.legal-home-link:hover,
.legal-home-link:focus-visible {
    border-color: var(--legal-primary);
    background: var(--legal-primary);
    color: #fff;
}

.legal-hero {
    overflow: hidden;
    border-bottom: 1px solid var(--legal-border);
    background:
        radial-gradient(circle at 12% 18%, rgba(148, 119, 235, .2), transparent 30%),
        linear-gradient(135deg, #fff 0%, #f4f0ff 100%);
}

.legal-hero-content {
    max-width: 820px;
    padding: 4.5rem 0 5rem;
}

.legal-eyebrow {
    display: inline-block;
    margin-bottom: 1rem;
    padding: .4rem .9rem;
    border-radius: 999px;
    background: rgba(148, 119, 235, .13);
    color: var(--legal-primary-dark);
    font-size: .8rem;
    font-weight: 700;
}

.legal-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.35;
}

.legal-hero p {
    margin: 1rem 0 0;
    color: var(--legal-muted);
}

.legal-main-section {
    padding-top: 3rem;
    padding-bottom: 5rem;
}

.legal-page-switcher {
    display: inline-flex;
    gap: .35rem;
    margin-bottom: 1.25rem;
    padding: .35rem;
    border: 1px solid var(--legal-border);
    border-radius: 14px;
    background: var(--legal-surface);
}

.legal-page-switcher a {
    padding: .6rem 1rem;
    border-radius: 10px;
    color: var(--legal-muted);
    font-weight: 700;
    text-decoration: none;
}

.legal-page-switcher a.active,
.legal-page-switcher a:hover,
.legal-page-switcher a:focus-visible {
    background: var(--legal-primary-soft);
    color: var(--legal-primary-dark);
}

.legal-content-card {
    min-height: 360px;
    padding: clamp(1.5rem, 4vw, 3.5rem);
    border: 1px solid var(--legal-border);
    border-radius: 24px;
    background: var(--legal-surface);
    box-shadow: 0 18px 60px rgba(52, 40, 92, .08);
    overflow-wrap: anywhere;
}

.legal-content-card h2,
.legal-content-card h3,
.legal-content-card h4,
.legal-content-card h5 {
    margin: 2rem 0 .8rem;
    color: var(--legal-text);
    font-weight: 700;
    line-height: 1.55;
}

.legal-content-card h2:first-child,
.legal-content-card h3:first-child,
.legal-content-card p:first-child {
    margin-top: 0;
}

.legal-content-card p,
.legal-content-card li {
    color: #444;
    font-size: 1rem;
}

.legal-content-card ul,
.legal-content-card ol {
    padding-inline-start: 1.5rem;
}

.legal-content-card a {
    color: var(--legal-primary-dark);
    text-underline-offset: 3px;
}

.legal-content-card blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-inline-start: 4px solid var(--legal-primary);
    border-radius: 8px;
    background: var(--legal-primary-soft);
}

.legal-content-card table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
}

.legal-content-card th,
.legal-content-card td {
    padding: .8rem;
    border: 1px solid var(--legal-border);
    text-align: start;
}

.legal-content-card th {
    background: var(--legal-primary-soft);
}

.legal-empty-state {
    display: flex;
    min-height: 280px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.legal-empty-state > span {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 1rem;
    place-items: center;
    border-radius: 50%;
    background: var(--legal-primary-soft);
    color: var(--legal-primary-dark);
    font-family: serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.legal-empty-state h2 {
    margin: 0 0 .5rem;
}

.legal-empty-state p {
    margin: 0;
    color: var(--legal-muted);
}

.legal-site-footer {
    border-top: 1px solid var(--legal-border);
    background: #fff;
    color: var(--legal-muted);
}

.legal-site-footer a {
    color: var(--legal-text);
    text-decoration: none;
}

.legal-site-footer a:hover,
.legal-site-footer a:focus-visible {
    color: var(--legal-primary-dark);
}

@media (max-width: 575.98px) {
    .legal-brand span {
        display: none;
    }

    .legal-hero-content {
        padding: 3rem 0 3.5rem;
    }

    .legal-main-section {
        padding-top: 2rem;
        padding-bottom: 3rem;
    }

    .legal-page-switcher {
        display: flex;
        width: 100%;
    }

    .legal-page-switcher a {
        flex: 1;
        text-align: center;
    }

    .legal-content-card {
        border-radius: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
