:root {
    /* ===== Prajeeva brand tokens, matching public/css/global.css ===== */
    --primary: #1B2A4A;
    /* --font-secondary-color */
    --secondary: #E3993D;
    /* --font-primary-color */
    --body-gray: #4B5563;
    /* --font-global-color */
    --dark: #0F1C33;
    --dark-2: #2D3E5C;
    --grad-end: #E3993D;
    --white: #ffffff;
    --cream: #F8F3EC;
    /* .cream-bg */
    --line: #E7E1D3;
    --radius-lg: 28px;
    --radius-md: 20px;
}

.legal-page * {
    box-sizing: border-box;
}

.legal-page {
    background: var(--cream);
    color: var(--primary);
}

.legal-page h1,
.legal-page h2,
.legal-page h3 {
    font-family: "Urbanist", sans-serif;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.legal-page p {
    font-family: "Urbanist", sans-serif;
    color: var(--body-gray);
}

.legal-page a {
    color: inherit;
}

/* ---------- HERO ---------- */
.legal-hero {
    position: relative;
    background:
        linear-gradient(90deg, rgba(27, 42, 74, 0) 0%, rgba(227, 153, 61, 0.16) 100%),
        linear-gradient(160deg, var(--dark) 0%, var(--primary) 60%, #2b3b5e 100%);
    padding: 88px 48px 120px;
    color: #fff;
    overflow: hidden;
}

.legal-hero::before {
    content: "";
    position: absolute;
    right: -120px;
    top: -160px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(227, 153, 61, .3), transparent 70%);
}

.legal-hero-inner {
    position: relative;
    max-width: 980px;
    margin: 0 auto;
}

.legal-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 22px;
}

.legal-eyebrow::before {
    content: "";
    width: 26px;
    height: 1px;
    background: var(--secondary);
    display: inline-block;
}

.legal-crumb {
    font-size: 13px;
    font-weight: 400;
    color: #b9c6e6;
    margin-bottom: 18px;
}

.legal-crumb a {
    text-decoration: none;
    color: #b9c6e6;
}

.legal-crumb a:hover {
    color: #fff;
}

.legal-crumb b {
    color: #fff;
    font-weight: 600;
}

.legal-hero h1 {
    font-size: clamp(32px, 4.4vw, 50px);
    line-height: 1.12;
    margin: 0 0 20px;
    font-weight: 700;
    letter-spacing: -0.6px;
    max-width: 820px;
}

.legal-hero h1 span {
    color: var(--secondary);
}

.legal-hero p.sub {
    font-size: 17px;
    font-weight: 400;
    line-height: 1.7;
    color: #d8dfec;
    max-width: 640px;
    margin: 0 0 30px;
}

.legal-hero-meta {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 400;
    color: #a9b3cc;
}

.legal-hero-meta strong {
    color: #fff;
    font-weight: 600;
}

.legal-scallop {
    position: relative;
    height: 64px;
    margin-top: -64px;
}

.legal-scallop svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* ---------- LAYOUT ---------- */
.legal-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 48px 100px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 56px;
    align-items: start;
}

/* ---------- CONTENT (LEFT) ---------- */
.legal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 8px 56px 40px;
    box-shadow: 0 30px 60px -40px rgba(15, 28, 51, .25);
    border: 1px solid var(--line);
    margin-top: -40px;
}

section.legal-clause {
    padding: 44px 0;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: 32px;
}

section.legal-clause:last-child {
    border-bottom: none;
}

.legal-clause-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 16px;
}

.legal-clause-num {
    font-family: "Urbanist", sans-serif;
    font-weight: 700;
    font-size: 13px;
    color: var(--secondary);
    background: linear-gradient(135deg, #FBF1E3, #FAE7CC);
    border-radius: 8px;
    padding: 5px 9px;
    line-height: 1;
}

.legal-clause h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin: 0;
    color: var(--primary);
}

.legal-clause p {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.85;
    letter-spacing: -0.03px;
    color: var(--body-gray);
    margin: 0 0 16px;
}

.legal-clause p b {
    color: var(--primary);
    font-weight: 600;
}

.legal-clause ul {
    margin: 0 0 16px;
    padding-left: 0;
    list-style: none;
}

.legal-clause ul li {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.75;
    color: var(--body-gray);
    padding-left: 24px;
    position: relative;
    margin-bottom: 10px;
}

.legal-clause ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--secondary);
    transform: rotate(45deg);
}

.legal-clause ul li b {
    color: var(--primary);
    font-weight: 600;
}

.legal-callout {
    background: linear-gradient(180deg, var(--primary) 0%, #2b3b5e 100%);
    color: #eef2f9;
    border-radius: var(--radius-md);
    padding: 20px 24px;
    font-size: 14.5px;
    font-weight: 400;
    line-height: 1.7;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-top: 6px;
}

.legal-callout .dot {
    min-width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary);
    margin-top: 7px;
}

.legal-callout b {
    color: #fff;
    font-weight: 600;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 6px 0 18px;
    font-size: 14.5px;
}

.legal-table th {
    text-align: left;
    color: var(--primary);
    font-family: "Urbanist", sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 10px 14px;
    background: #F3EEE3;
}

.legal-table th:first-child {
    border-radius: 8px 0 0 8px;
}

.legal-table th:last-child {
    border-radius: 0 8px 8px 0;
}

.legal-table td {
    padding: 12px 14px;
    font-weight: 400;
    color: var(--body-gray);
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

/* contact card at bottom of content */
.legal-contact-card {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 26px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.legal-contact-card h3 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
}

.legal-contact-card p {
    margin: 0;
    font-size: 14.5px;
    font-weight: 400;
    color: var(--body-gray);
}

.legal-contact-btn {
    background: var(--secondary);
    border: 1px solid #e3993d55;
    color: #FFFFFF;
    padding: 0 28px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: .28px;
    white-space: nowrap;
    font-family: "Urbanist", sans-serif;
    position: relative;
    overflow: hidden;
    z-index: 1;
    cursor: pointer;
}

.legal-contact-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--dark);
    transform: translateX(-100%);
    transition: transform .4s ease;
    z-index: -1;
}

.legal-contact-btn:hover::before {
    transform: translateX(0);
}

/* ---------- TOC (RIGHT) ---------- */
.legal-toc-outer {
    position: sticky;
    top: 28px;
    margin-top: -40px;
    max-height: calc(100vh - 56px);
}

.legal-toc-card {
    background: linear-gradient(180deg, var(--dark) 0%, var(--primary) 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 24px 24px;
    color: #fff;
    padding: 30px 26px 22px;
    box-shadow: 0 30px 60px -30px rgba(15, 28, 51, .5);
    position: relative;
    overflow: hidden;
    max-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
}

.legal-toc-card::after {
    content: "";
    position: absolute;
    right: -60px;
    bottom: -80px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(227, 153, 61, .22), transparent 70%);
}

.legal-toc-title {
    font-family: "Urbanist", sans-serif;
    font-size: 12px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 18px;
}

.legal-toc-list {
    list-style: none;
    margin: 0;
    padding: 0 4px 0 0;
    position: relative;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .35) transparent;
}

.legal-toc-list::-webkit-scrollbar {
    width: 6px;
}

.legal-toc-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .3);
    border-radius: 6px;
}

.legal-toc-list li {
    margin-bottom: 2px;
}

.legal-toc-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #b9c6e6;
    font-size: 14px;
    font-weight: 400;
    padding: 10px 12px;
    border-radius: 10px;
    transition: background .18s ease, color .18s ease;
}

.legal-toc-list a .n {
    font-family: "Urbanist", sans-serif;
    font-weight: 700;
    font-size: 11px;
    color: #8394c2;
    min-width: 18px;
}

.legal-toc-list a:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.legal-toc-list a.active {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-weight: 500;
    box-shadow: inset 3px 0 0 var(--secondary);
}

.legal-toc-list a.active .n {
    color: var(--secondary);
}

.legal-toc-foot {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .14);
    font-size: 12px;
    font-weight: 400;
    color: #93a0c4;
    line-height: 1.6;
}

.legal-toc-foot a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
}

.legal-toc-progress {
    height: 3px;
    width: 100%;
    background: rgba(255, 255, 255, .12);
    border-radius: 3px;
    margin-top: 16px;
    overflow: hidden;
}

.legal-toc-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width .12s linear;
}

.legal-pagefoot {
    text-align: center;
    padding: 36px 24px 50px;
    color: var(--body-gray);
    font-size: 12.5px;
    font-weight: 400;
}

/* ---------- MOBILE TOC TOGGLE ---------- */
.legal-toc-mobile-toggle {
    display: none;
}

@media (max-width:980px) {
    .legal-wrap {
        grid-template-columns: 1fr;
        padding: 0 20px 70px;
    }

    .legal-content {
        padding: 8px 22px 30px;
        margin-top: -30px;
    }

    .legal-hero {
        padding: 64px 20px 96px;
    }

    .legal-toc-outer {
        position: relative;
        top: 0;
        order: -1;
        margin-top: -30px;
        margin-bottom: 8px;
    }

    .legal-toc-card {
        padding: 20px 20px 16px;
    }

    .legal-toc-list {
        max-height: 0;
        overflow: hidden;
        transition: max-height .25s ease;
    }

    .legal-toc-list.open {
        max-height: 900px;
    }

    .legal-toc-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        background: none;
        border: none;
        color: #fff;
        font-family: "Urbanist", sans-serif;
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 1.5px;
        text-transform: uppercase;
        cursor: pointer;
        padding: 0;
        margin-bottom: 14px;
    }

    .legal-toc-mobile-toggle svg {
        transition: transform .2s ease;
    }

    .legal-toc-mobile-toggle.open svg {
        transform: rotate(180deg);
    }
}

/* ---------- CENTER DIRECTORY ---------- */
.legal-center-wrap {
    max-width: 1180px;
    margin: -60px auto 100px;
    padding: 0 48px;
    position: relative;
}

.legal-category {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    margin-bottom: 28px;
    box-shadow: 0 30px 60px -45px rgba(15, 28, 51, .25);
}

.legal-category h2 {
    font-size: 22px;
    color: var(--primary);
    margin: 0 0 6px;
}

.legal-category .legal-category-desc {
    font-size: 14.5px;
    color: var(--body-gray);
    margin: 0 0 22px;
}

.legal-page-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

@media (max-width: 700px) {
    .legal-page-grid {
        grid-template-columns: 1fr;
    }

    .legal-center-wrap {
        padding: 0 20px;
    }

    .legal-category {
        padding: 26px 22px;
    }
}

.legal-page-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-decoration: none;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 18px;
    color: var(--primary);
    font-size: 15px;
    font-weight: 500;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.legal-page-link:hover {
    background: #FBF1E3;
    border-color: var(--secondary);
    transform: translateX(2px);
}

.legal-page-link .legal-page-link-arrow {
    color: var(--secondary);
    font-size: 18px;
    line-height: 1;
}

.legal-center-empty {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    color: var(--body-gray);
}
