/* ==========================================================================
   PETCIX ACADEMY — LEGAL POLICIES DESIGN SYSTEM & STYLESHEET
   ==========================================================================
   Located at: static/css/legal.css
   Used by: templates/privacy_policy.html, terms_conditions.html, refund_policy.html
   Aesthetic: Vibrant, modern, Gen Z premium design matching PetCix Academy palette.
   Responsive: 100% Screen-Size Independent (Mobile, Foldables, Tablet, Laptop, 4K)
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. ROOT & RESETS FOR LEGAL PAGES
   -------------------------------------------------------------------------- */
.legal-page-body,
.legal-hero {
    overflow-x: clip;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* --------------------------------------------------------------------------
   1. HERO & HEADER SECTION
   -------------------------------------------------------------------------- */
.legal-hero {
    position: relative;
    padding-top: clamp(4.75rem, 8vw, 6.75rem);
    padding-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
    background: radial-gradient(120% 80% at 50% 0%, rgba(206, 78, 222, 0.16) 0%, rgba(109, 61, 210, 0.08) 50%, rgba(250, 233, 249, 0) 100%);
    overflow: hidden;
}

.legal-hero::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -100px;
    width: clamp(220px, 32vw, 440px);
    height: clamp(220px, 32vw, 440px);
    background: radial-gradient(circle, rgba(206, 78, 222, 0.18) 0%, rgba(109, 61, 210, 0.05) 60%, transparent 80%);
    border-radius: 50%;
    filter: blur(50px);
    pointer-events: none;
    z-index: 0;
}

.legal-hero::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -80px;
    width: clamp(200px, 28vw, 360px);
    height: clamp(200px, 28vw, 360px);
    background: radial-gradient(circle, rgba(45, 197, 244, 0.14) 0%, rgba(75, 108, 255, 0.04) 60%, transparent 80%);
    border-radius: 50%;
    filter: blur(50px);
    pointer-events: none;
    z-index: 0;
}

.legal-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
    padding: 0 0.5rem;
}

/* Breadcrumbs */
.legal-breadcrumbs {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem 0.55rem;
    padding: 5px 14px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(206, 78, 222, 0.2);
    border-radius: var(--radius-full);
    font-size: clamp(0.72rem, 1.2vw, 0.8rem);
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 0.85rem;
    max-width: 100%;
}

.legal-breadcrumbs a {
    color: var(--color-purple);
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.legal-breadcrumbs a:hover {
    color: var(--color-primary-magenta);
}

.legal-breadcrumbs .sep {
    opacity: 0.4;
    font-size: 0.65rem;
}

.legal-breadcrumbs .active {
    color: var(--color-primary-magenta);
    font-weight: 700;
}

/* Badge */
.legal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: linear-gradient(135deg, rgba(206, 78, 222, 0.15) 0%, rgba(109, 61, 210, 0.12) 100%);
    border: 1px solid rgba(206, 78, 222, 0.3);
    border-radius: var(--radius-full);
    font-size: clamp(0.72rem, 1.1vw, 0.8rem);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--color-purple);
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(206, 78, 222, 0.1);
}

.legal-badge i {
    color: var(--color-primary-magenta);
}

.legal-title {
    font-size: clamp(1.85rem, 4.5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.18;
    color: var(--color-text-main);
    letter-spacing: -0.025em;
    margin-bottom: 0.65rem;
}

.legal-lead {
    font-size: clamp(0.88rem, 1.3vw, 1.05rem);
    line-height: 1.6;
    color: var(--color-text-muted);
    max-width: 680px;
    margin: 0 auto 1.35rem;
}

/* Meta Pills Row */
.legal-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.45rem 0.65rem;
    margin-bottom: 1.5rem;
}

.legal-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    background: #ffffff;
    border: 1px solid rgba(49, 27, 23, 0.08);
    border-radius: var(--radius-full);
    font-size: clamp(0.72rem, 1.1vw, 0.8rem);
    font-weight: 600;
    color: var(--color-text-main);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.legal-meta-item i {
    color: var(--color-primary-magenta);
    font-size: 0.9em;
}

.legal-meta-item.updated {
    border-color: rgba(34, 197, 94, 0.4);
    background: #f0fdf4;
    color: #15803d;
}

.legal-meta-item.updated i {
    color: #16a34a;
}

/* --------------------------------------------------------------------------
   2. POLICY HUB TABS (Responsive Horizontal Segmented Control)
   -------------------------------------------------------------------------- */
.legal-tabs-wrapper {
    margin: 0 auto;
    max-width: 820px;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 6px 4px;
    display: flex;
    justify-content: center;
}

.legal-tabs-wrapper::-webkit-scrollbar {
    display: none;
}

@media (max-width: 640px) {
    .legal-tabs-wrapper {
        justify-content: flex-start;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

.legal-tabs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: min-content;
    gap: 0.45rem;
    padding: 5px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(206, 78, 222, 0.22);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    flex-direction: row !important;
}

.legal-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    border-radius: var(--radius-full);
    font-size: clamp(0.78rem, 1.2vw, 0.86rem);
    font-weight: 700;
    text-decoration: none;
    color: var(--color-text-muted);
    transition: all 0.2s var(--ease-premium);
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}

.legal-tab i {
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

.legal-tab:hover {
    color: var(--color-purple);
    background: rgba(206, 78, 222, 0.08);
}

.legal-tab.active {
    background: linear-gradient(135deg, var(--color-primary-magenta) 0%, var(--color-purple) 100%);
    color: #ffffff;
    box-shadow: var(--shadow-glow-magenta);
}

.legal-tab-status {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    margin-left: 2px;
}

.legal-tab.active .legal-tab-status {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.legal-tab:not(.active) .legal-tab-status.coming-next {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.legal-tab:not(.active) .legal-tab-status.live {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* --------------------------------------------------------------------------
   3. QUICK ACTIONS & TOOLS BAR
   -------------------------------------------------------------------------- */
.legal-actions-bar {
    margin-top: 1.15rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-legal-tool {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    background: #ffffff;
    border: 1px solid rgba(49, 27, 23, 0.12);
    border-radius: var(--radius-full);
    font-size: clamp(0.72rem, 1.1vw, 0.78rem);
    font-weight: 600;
    color: var(--color-text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    min-height: 36px;
}

.btn-legal-tool:hover {
    background: rgba(206, 78, 222, 0.08);
    border-color: var(--color-primary-magenta);
    color: var(--color-purple);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-legal-tool i {
    color: var(--color-primary-magenta);
}

/* Toast feedback */
.legal-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    left: auto;
    z-index: 9999;
    background: #111827;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    max-width: 90vw;
}

.legal-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.legal-toast i {
    color: #22c55e;
}

/* --------------------------------------------------------------------------
   4. TWO-COLUMN LAYOUT & SIDEBAR (Desktop)
   -------------------------------------------------------------------------- */
.legal-page-body {
    padding: clamp(1.75rem, 4vw, 3.25rem) 0 clamp(3rem, 6vw, 4.5rem);
    background-color: var(--bg-canvas);
}

.legal-layout {
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: clamp(1.5rem, 3vw, 2.5rem);
    align-items: start;
}

/* Desktop Sticky Sidebar (>= 1024px) */
.legal-sidebar {
    position: sticky;
    top: 92px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.legal-toc-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(206, 78, 222, 0.16);
    padding: 1.35rem 1.15rem;
    box-shadow: var(--shadow-md);
}

.legal-toc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--color-text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(49, 27, 23, 0.08);
}

.legal-toc-header i {
    color: var(--color-primary-magenta);
}

.legal-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: calc(100vh - 360px);
    overflow-y: auto;
    padding-right: 4px;
}

.legal-toc-list::-webkit-scrollbar {
    width: 4px;
}
.legal-toc-list::-webkit-scrollbar-thumb {
    background: rgba(206, 78, 222, 0.2);
    border-radius: 4px;
}

.legal-toc-item a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    font-size: 0.81rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1.35;
}

.legal-toc-item a .toc-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 4px;
    border-radius: 6px;
    background: rgba(49, 27, 23, 0.05);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-text-muted);
    transition: all 0.2s ease;
}

.legal-toc-item a:hover {
    background: rgba(206, 78, 222, 0.08);
    color: var(--color-purple);
    transform: translateX(2px);
}

.legal-toc-item a:hover .toc-num {
    background: rgba(206, 78, 222, 0.18);
    color: var(--color-primary-magenta);
}

.legal-toc-item.active a {
    background: linear-gradient(135deg, rgba(206, 78, 222, 0.14) 0%, rgba(109, 61, 210, 0.1) 100%);
    color: var(--color-purple);
    font-weight: 700;
    border-left: 3px solid var(--color-primary-magenta);
}

.legal-toc-item.active a .toc-num {
    background: var(--color-primary-magenta);
    color: #ffffff;
}

/* Sidebar Help Card (Desktop) */
.legal-help-card {
    background: linear-gradient(135deg, #2b1442 0%, #170d29 100%);
    border-radius: var(--radius-xl);
    padding: 1.35rem 1.25rem;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(43, 20, 66, 0.35);
    position: relative;
    overflow: hidden;
}

.legal-help-card::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(206, 78, 222, 0.4) 0%, transparent 70%);
    border-radius: 50%;
}

.legal-help-card h4 {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    color: #ffffff;
}

.legal-help-card p {
    font-size: 0.78rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.85rem;
}

.legal-help-contact {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.legal-help-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    padding: 7px 11px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    transition: background 0.2s ease;
}

.legal-help-link:hover {
    background: rgba(206, 78, 222, 0.35);
}

.legal-help-link i {
    color: var(--color-sky-blue);
}

/* --------------------------------------------------------------------------
   5. MOBILE & TABLET STICKY QUICK-JUMP TOC BAR (< 1024px)
   -------------------------------------------------------------------------- */
.legal-mobile-toc-bar {
    display: none; /* hidden on desktop */
}

@media (max-width: 1023px) {
    .legal-mobile-toc-bar {
        display: block;
        position: -webkit-sticky;
        position: sticky;
        top: 68px; /* sits right below fixed navbar */
        z-index: 95;
        margin-bottom: 1.25rem;
    }

    .legal-mobile-toc-btn {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 14px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border: 1px solid rgba(206, 78, 222, 0.3);
        border-radius: var(--radius-md);
        box-shadow: 0 4px 18px rgba(49, 27, 23, 0.08);
        cursor: pointer;
        text-align: left;
        font-family: inherit;
        transition: all 0.2s ease;
    }

    .legal-mobile-toc-btn:hover,
    .legal-mobile-toc-btn[aria-expanded="true"] {
        border-color: var(--color-primary-magenta);
        background: #ffffff;
        box-shadow: 0 6px 20px rgba(206, 78, 222, 0.15);
    }

    .legal-mobile-toc-info {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
        overflow: hidden;
    }

    .legal-mobile-toc-info i {
        color: var(--color-primary-magenta);
        font-size: 0.9rem;
        flex-shrink: 0;
    }

    .toc-jump-label {
        font-size: 0.74rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--color-purple);
        white-space: nowrap;
    }

    .toc-current-section {
        font-size: 0.84rem;
        font-weight: 700;
        color: var(--color-text-main);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .legal-mobile-toc-action {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 9px;
        background: rgba(206, 78, 222, 0.1);
        border-radius: var(--radius-full);
        font-size: 0.74rem;
        font-weight: 700;
        color: var(--color-purple);
        flex-shrink: 0;
    }

    .mobile-toc-chevron {
        font-size: 0.7rem;
        transition: transform 0.25s ease;
    }

    .legal-mobile-toc-btn[aria-expanded="true"] .mobile-toc-chevron {
        transform: rotate(180deg);
    }

    /* Mobile Dropdown Panel */
    .legal-mobile-toc-dropdown {
        display: none;
        margin-top: 6px;
        background: #ffffff;
        border: 1px solid rgba(206, 78, 222, 0.25);
        border-radius: var(--radius-lg);
        box-shadow: 0 12px 36px rgba(49, 27, 23, 0.15);
        max-height: 55vh;
        overflow-y: auto;
        padding: 0.75rem;
        animation: mobileTocFadeIn 0.2s ease-out;
    }

    .legal-mobile-toc-dropdown.open {
        display: block;
    }

    @keyframes mobileTocFadeIn {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .legal-mobile-toc-dropdown-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 4px 8px 8px;
        border-bottom: 1px solid rgba(49, 27, 23, 0.08);
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--color-text-muted);
        letter-spacing: 0.4px;
    }

    .mobile-toc-close {
        background: none;
        border: none;
        font-size: 1.25rem;
        line-height: 1;
        cursor: pointer;
        color: var(--color-text-muted);
        padding: 0 4px;
    }

    .legal-mobile-toc-list {
        list-style: none;
        padding: 6px 0 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .legal-mobile-toc-list li a {
        display: flex;
        align-items: center;
        gap: 9px;
        padding: 8px 10px;
        border-radius: var(--radius-md);
        font-size: 0.84rem;
        font-weight: 600;
        color: var(--color-text-main);
        text-decoration: none;
        transition: background 0.15s ease;
    }

    .legal-mobile-toc-list li a:active,
    .legal-mobile-toc-list li a:hover {
        background: rgba(206, 78, 222, 0.1);
        color: var(--color-purple);
    }

    .legal-mobile-toc-list li a .toc-num {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 24px;
        height: 24px;
        padding: 0 4px;
        border-radius: 6px;
        background: rgba(206, 78, 222, 0.12);
        color: var(--color-purple);
        font-size: 0.74rem;
        font-weight: 700;
    }

    .legal-mobile-toc-list li.active a {
        background: linear-gradient(135deg, rgba(206, 78, 222, 0.15) 0%, rgba(109, 61, 210, 0.12) 100%);
        color: var(--color-purple);
        font-weight: 700;
        border-left: 3px solid var(--color-primary-magenta);
    }

    .legal-mobile-toc-list li.active a .toc-num {
        background: var(--color-primary-magenta);
        color: #ffffff;
    }
}

/* --------------------------------------------------------------------------
   6. POLICY CONTENT SECTIONS
   -------------------------------------------------------------------------- */
.legal-content {
    display: flex;
    flex-direction: column;
    gap: clamp(1.25rem, 2.5vw, 2rem);
    min-width: 0;
    width: 100%;
}

.legal-section-card {
    background: #ffffff;
    border-radius: clamp(14px, 2.5vw, 22px);
    border: 1px solid rgba(206, 78, 222, 0.16);
    padding: clamp(1.25rem, 3vw, 2.35rem);
    box-shadow: 0 4px 20px rgba(49, 27, 23, 0.04);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    scroll-margin-top: 125px; /* accounts for sticky navbar + mobile TOC */
    word-break: break-word;
    overflow-wrap: break-word;
}

.legal-section-card:hover {
    border-color: rgba(206, 78, 222, 0.3);
    box-shadow: 0 6px 24px rgba(49, 27, 23, 0.07);
}

/* Section Header */
.legal-section-header {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2vw, 14px);
    margin-bottom: 1.15rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(49, 27, 23, 0.07);
}

.legal-section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: clamp(36px, 5vw, 42px);
    height: clamp(36px, 5vw, 42px);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(206, 78, 222, 0.15) 0%, rgba(109, 61, 210, 0.15) 100%);
    color: var(--color-purple);
    font-size: clamp(0.92rem, 1.4vw, 1.05rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.legal-section-title-wrap {
    flex-grow: 1;
    min-width: 0;
}

.legal-section-title {
    font-size: clamp(1.15rem, 2.2vw, 1.55rem);
    font-weight: 800;
    color: var(--color-text-main);
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin: 0;
    overflow-wrap: break-word;
}

.legal-section-icon {
    font-size: clamp(1.05rem, 1.8vw, 1.3rem);
    color: var(--color-primary-magenta);
    opacity: 0.85;
    flex-shrink: 0;
}

/* Typography in Body */
.legal-body-text {
    font-size: clamp(0.88rem, 1.2vw, 0.95rem);
    line-height: 1.7;
    color: var(--color-text-main);
    margin-bottom: 1rem;
    overflow-wrap: anywhere;
}

.legal-body-text:last-child {
    margin-bottom: 0;
}

.legal-body-text strong {
    color: var(--color-text-main);
    font-weight: 700;
}

/* Intro Callout Banner */
.legal-alliance-banner {
    display: flex;
    align-items: flex-start;
    gap: clamp(10px, 2vw, 16px);
    padding: clamp(1rem, 2vw, 1.35rem);
    background: linear-gradient(135deg, rgba(206, 78, 222, 0.08) 0%, rgba(45, 197, 244, 0.08) 100%);
    border: 1px solid rgba(206, 78, 222, 0.2);
    border-radius: var(--radius-lg);
    margin: 1.15rem 0;
}

.alliance-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(38px, 6vw, 44px);
    height: clamp(38px, 6vw, 44px);
    border-radius: 50%;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    color: var(--color-primary-magenta);
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    flex-shrink: 0;
}

.alliance-content h4 {
    font-size: clamp(0.88rem, 1.3vw, 0.95rem);
    font-weight: 800;
    color: var(--color-purple);
    margin-bottom: 0.25rem;
}

.alliance-content p {
    font-size: clamp(0.82rem, 1.1vw, 0.86rem);
    line-height: 1.5;
    color: var(--color-text-muted);
    margin: 0;
}

/* --------------------------------------------------------------------------
   7. SUBGRIDS (Information, Uses, Rights, Sharing)
   -------------------------------------------------------------------------- */
.legal-subgrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(0.85rem, 1.8vw, 1.25rem);
    margin-top: 1.15rem;
}

.legal-subcard {
    background: #fdfafd;
    border: 1px solid rgba(206, 78, 222, 0.14);
    border-radius: var(--radius-lg);
    padding: clamp(1rem, 2vw, 1.35rem);
    transition: transform 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

.legal-subcard:hover {
    border-color: rgba(206, 78, 222, 0.35);
    background: #ffffff;
}

.legal-subcard-header {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 0.85rem;
}

.legal-subcard-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(206, 78, 222, 0.12);
    color: var(--color-purple);
    font-size: 0.92rem;
    flex-shrink: 0;
}

.legal-subcard-header h3 {
    font-size: clamp(0.95rem, 1.4vw, 1.05rem);
    font-weight: 800;
    color: var(--color-text-main);
    margin: 0;
}

.legal-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legal-checklist li {
    font-size: clamp(0.82rem, 1.1vw, 0.88rem);
    line-height: 1.5;
    color: var(--color-text-main);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.legal-checklist li i {
    color: var(--color-primary-magenta);
    font-size: 0.72rem;
    margin-top: 5px;
    flex-shrink: 0;
}

/* Payment Security Callout */
.legal-payment-security {
    margin-top: 0.85rem;
    padding: 0.85rem 1rem;
    background: rgba(20, 184, 166, 0.08);
    border: 1px solid rgba(20, 184, 166, 0.25);
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.legal-payment-security i {
    color: var(--color-teal);
    font-size: 1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.legal-payment-security p {
    font-size: clamp(0.8rem, 1.1vw, 0.84rem);
    line-height: 1.5;
    color: #0f766e;
    margin: 0;
}

.legal-payment-security p strong {
    color: #115e59;
}

/* Technical Info Note */
.legal-tech-note {
    background: rgba(45, 197, 244, 0.08);
    border: 1px solid rgba(45, 197, 244, 0.25);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    margin-top: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.legal-tech-note i {
    color: var(--color-sky-blue);
    font-size: 1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.legal-tech-note p {
    font-size: clamp(0.8rem, 1.1vw, 0.84rem);
    line-height: 1.5;
    color: #0369a1;
    margin: 0;
}

/* Use Grid (Section 3) */
.legal-use-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin: 1.15rem 0;
}

.legal-use-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: #fdfafd;
    border: 1px solid rgba(206, 78, 222, 0.12);
    border-radius: var(--radius-md);
    font-size: clamp(0.8rem, 1.1vw, 0.86rem);
    font-weight: 600;
    color: var(--color-text-main);
    transition: all 0.2s ease;
}

.legal-use-item:hover {
    background: #ffffff;
    border-color: rgba(206, 78, 222, 0.3);
}

.legal-use-item i {
    color: #16a34a;
    font-size: 0.88rem;
    flex-shrink: 0;
}

/* Zero Sale Banner */
.legal-zero-sale-banner {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2vw, 14px);
    padding: clamp(0.9rem, 2vw, 1.25rem);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(20, 184, 166, 0.08) 100%);
    border: 1.5px solid rgba(34, 197, 94, 0.35);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
}

.zero-sale-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(36px, 5vw, 42px);
    height: clamp(36px, 5vw, 42px);
    border-radius: 50%;
    background: #ffffff;
    color: #16a34a;
    font-size: clamp(1.1rem, 1.6vw, 1.25rem);
    box-shadow: 0 3px 10px rgba(22, 163, 74, 0.16);
    flex-shrink: 0;
}

.legal-zero-sale-banner h4 {
    font-size: clamp(0.92rem, 1.3vw, 1.02rem);
    font-weight: 800;
    color: #15803d;
    margin-bottom: 0.15rem;
}

.legal-zero-sale-banner p {
    font-size: clamp(0.8rem, 1.1vw, 0.86rem);
    color: #166534;
    margin: 0;
}

/* Sharing list */
.legal-sharing-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.legal-sharing-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 1rem 1.15rem;
    background: #fdfafd;
    border: 1px solid rgba(49, 27, 23, 0.07);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.legal-sharing-card:hover {
    background: #ffffff;
    border-color: rgba(206, 78, 222, 0.25);
}

.legal-sharing-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(109, 61, 210, 0.1);
    color: var(--color-purple);
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.legal-sharing-info h4 {
    font-size: clamp(0.86rem, 1.2vw, 0.92rem);
    font-weight: 800;
    color: var(--color-text-main);
    margin-bottom: 0.2rem;
}

.legal-sharing-info p {
    font-size: clamp(0.8rem, 1.1vw, 0.84rem);
    line-height: 1.5;
    color: var(--color-text-muted);
    margin: 0;
}

/* Rights Grid (Section 8) */
.legal-rights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(0.65rem, 1.5vw, 1rem);
    margin: 1.15rem 0;
}

.legal-right-card {
    background: #fdfafd;
    border: 1px solid rgba(206, 78, 222, 0.14);
    border-radius: var(--radius-lg);
    padding: clamp(0.9rem, 1.5vw, 1.15rem);
    text-align: center;
    transition: all 0.2s ease;
}

.legal-right-card:hover {
    background: #ffffff;
    border-color: var(--color-primary-magenta);
}

.legal-right-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(206, 78, 222, 0.15) 0%, rgba(109, 61, 210, 0.15) 100%);
    color: var(--color-purple);
    font-size: 0.95rem;
    margin-bottom: 0.55rem;
}

.legal-right-card h4 {
    font-size: clamp(0.82rem, 1.2vw, 0.88rem);
    font-weight: 800;
    color: var(--color-text-main);
    margin-bottom: 0.25rem;
}

.legal-right-card p {
    font-size: clamp(0.74rem, 1.1vw, 0.8rem);
    line-height: 1.45;
    color: var(--color-text-muted);
    margin: 0;
}

/* --------------------------------------------------------------------------
   8. CONTACT US CARD
   -------------------------------------------------------------------------- */
.legal-contact-card {
    background: linear-gradient(135deg, #311b17 0%, #1e1110 100%);
    border-radius: clamp(14px, 2.5vw, 22px);
    padding: clamp(1.25rem, 3vw, 2.25rem);
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(49, 27, 23, 0.3);
}

.legal-contact-card::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(206, 78, 222, 0.35) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.legal-contact-card h3 {
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.legal-contact-card p.contact-desc {
    font-size: clamp(0.82rem, 1.2vw, 0.88rem);
    color: rgba(255, 255, 255, 0.75);
    max-width: 600px;
    margin-bottom: 1.35rem;
    line-height: 1.55;
}

.legal-contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(0.75rem, 1.5vw, 1.15rem);
    margin-bottom: 1.25rem;
}

.legal-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 0;
}

.legal-contact-icon {
    color: var(--color-primary-magenta);
    font-size: 1rem;
    margin-top: 3px;
    flex-shrink: 0;
}

.legal-contact-details {
    min-width: 0;
    flex-grow: 1;
}

.legal-contact-details h5 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 0.2rem;
    font-weight: 700;
}

.legal-contact-details p,
.legal-contact-details a {
    font-size: clamp(0.82rem, 1.2vw, 0.9rem);
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    margin: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.legal-contact-details a:hover {
    color: var(--color-sky-blue);
    text-decoration: underline;
}

/* Acknowledgement / Appreciation Box */
.legal-acknowledgement-box {
    margin-top: 1.5rem;
    padding: 1.25rem 1.35rem;
    background: #ffffff;
    border: 2px dashed rgba(206, 78, 222, 0.35);
    border-radius: var(--radius-lg);
    text-align: center;
}

.legal-acknowledgement-box i.paw-icon {
    font-size: 1.5rem;
    color: var(--color-primary-magenta);
    margin-bottom: 0.5rem;
    display: inline-block;
}

.legal-acknowledgement-box p {
    font-size: clamp(0.82rem, 1.2vw, 0.88rem);
    font-style: italic;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin: 0;
}

/* --------------------------------------------------------------------------
   9. MOBILE HELPER CARD (At bottom of content for < 1024px)
   -------------------------------------------------------------------------- */
.legal-mobile-help-card {
    display: none;
}

@media (max-width: 1023px) {
    .legal-mobile-help-card {
        display: block;
        background: linear-gradient(135deg, #2b1442 0%, #170d29 100%);
        border-radius: var(--radius-lg);
        padding: 1.35rem 1.25rem;
        color: #ffffff;
        box-shadow: 0 8px 24px rgba(43, 20, 66, 0.3);
        margin-top: 1.5rem;
    }

    .legal-mobile-help-card h4 {
        font-size: 0.95rem;
        font-weight: 800;
        margin-bottom: 0.35rem;
        color: #ffffff;
    }

    .legal-mobile-help-card p {
        font-size: 0.8rem;
        line-height: 1.5;
        color: rgba(255, 255, 255, 0.75);
        margin-bottom: 0.85rem;
    }

    .legal-mobile-help-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .legal-mobile-help-actions a {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        color: #ffffff;
        font-size: 0.8rem;
        font-weight: 600;
        text-decoration: none;
        padding: 8px 14px;
        background: rgba(255, 255, 255, 0.12);
        border-radius: var(--radius-full);
        transition: background 0.2s ease;
    }

    .legal-mobile-help-actions a:hover {
        background: rgba(206, 78, 222, 0.35);
    }

    .legal-mobile-help-actions a i {
        color: var(--color-sky-blue);
    }
}

/* --------------------------------------------------------------------------
   10. FOOTER LEGAL LINKS
   -------------------------------------------------------------------------- */
.footer-legal-links {
    margin-top: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
}

.footer-legal-links a {
    color: rgba(255, 255, 255, 0.65);
    font-size: clamp(0.72rem, 1.1vw, 0.78rem);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-legal-links a:hover {
    color: var(--color-primary-magenta);
    text-decoration: underline;
}

.footer-legal-sep {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.6rem;
}

/* --------------------------------------------------------------------------
   11. COMPREHENSIVE RESPONSIVE BREAKPOINTS (Tablet, Mobile, Mini Phones)
   -------------------------------------------------------------------------- */

/* TABLET BREAKPOINT (768px – 1023px) */
@media (max-width: 1023px) {
    .legal-layout {
        display: block;
        width: 100%;
    }

    .legal-sidebar {
        display: none !important; /* Replaced by sticky mobile TOC bar */
    }

    /* Subgrid stays 2 columns on tablet so it looks full and polished */
    .legal-subgrid {
        grid-template-columns: repeat(2, 1fr);
    }

    .legal-use-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .legal-rights-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .legal-contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* PHABLET & MOBILE BREAKPOINT (< 768px) */
@media (max-width: 767px) {
    .legal-hero {
        padding-top: 4.5rem;
        padding-bottom: 1.5rem;
    }

    .legal-meta-row {
        gap: 0.35rem 0.5rem;
    }

    .legal-subgrid {
        grid-template-columns: 1fr;
    }

    .legal-use-grid {
        grid-template-columns: 1fr;
    }

    .legal-rights-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .legal-contact-grid {
        grid-template-columns: 1fr;
    }
}

/* SMALL PHONES BREAKPOINT (< 480px, e.g. iPhone SE, Pixel, Galaxy) */
@media (max-width: 479px) {
    .legal-hero {
        padding-top: 4.25rem;
        padding-bottom: 1.25rem;
    }

    .legal-hero-inner {
        padding: 0 0.25rem;
    }

    .legal-title {
        font-size: 1.7rem;
    }

    .legal-lead {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .legal-breadcrumbs {
        padding: 4px 10px;
        font-size: 0.7rem;
    }

    .legal-badge {
        padding: 4px 10px;
        font-size: 0.7rem;
    }

    .legal-meta-item {
        font-size: 0.72rem;
        padding: 4px 8px;
        white-space: normal;
        text-align: center;
    }

    .legal-tab {
        padding: 7px 11px;
        font-size: 0.76rem;
    }

    .legal-tab-status {
        font-size: 0.6rem;
        padding: 1px 5px;
    }

    .btn-legal-tool {
        font-size: 0.72rem;
        padding: 5px 10px;
    }

    .legal-mobile-toc-bar {
        top: 62px;
    }

    .legal-mobile-toc-btn {
        padding: 8px 10px;
    }

    .toc-current-section {
        font-size: 0.78rem;
    }

    .legal-section-card {
        padding: 1.15rem 0.9rem;
        border-radius: 14px;
        scroll-margin-top: 115px;
    }

    .legal-section-num {
        min-width: 32px;
        height: 32px;
        font-size: 0.85rem;
        border-radius: 8px;
    }

    .legal-section-title {
        font-size: 1.1rem;
    }

    .legal-rights-grid {
        grid-template-columns: 1fr;
    }

    .legal-contact-card {
        padding: 1.15rem 0.9rem;
    }
}

/* --------------------------------------------------------------------------
   12. PRINT STYLESHEET
   -------------------------------------------------------------------------- */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    .navbar,
    .footer,
    .legal-hero::before,
    .legal-hero::after,
    .legal-tabs-wrapper,
    .legal-actions-bar,
    .legal-sidebar,
    .legal-mobile-toc-bar,
    .legal-mobile-help-card,
    .legal-toast {
        display: none !important;
    }

    .legal-hero {
        padding: 1rem 0 !important;
        background: none !important;
    }

    .legal-layout {
        display: block !important;
    }

    .legal-section-card {
        box-shadow: none !important;
        border: 1px solid #cccccc !important;
        margin-bottom: 1.5rem !important;
        break-inside: avoid;
        padding: 1.25rem !important;
    }

    .legal-contact-card {
        background: #f5f5f5 !important;
        color: #000000 !important;
        border: 1px solid #cccccc !important;
        box-shadow: none !important;
    }

    .legal-contact-card h3,
    .legal-contact-card p,
    .legal-contact-details h5,
    .legal-contact-details p,
    .legal-contact-details a {
        color: #000000 !important;
    }
}
