@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* Dynamic Abstract Background Shapes */
.legal-page-wrapper {
    position: relative;
    background-color: #f8fafc;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

.blur-shape-1 {
    position: absolute;
    top: -100px;
    right: -100px;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0) 70%);
    filter: blur(60px);
    z-index: 1;
    pointer-events: none;
}

.blur-shape-2 {
    position: absolute;
    top: 500px;
    left: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.07) 0%, rgba(99, 102, 241, 0) 70%);
    filter: blur(80px);
    z-index: 1;
    pointer-events: none;
}

/* Premium Visual Hero */
.legal-hero {
    position: relative;
    z-index: 2;
    padding: 80px 24px 70px 24px;
    text-align: center;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    background: linear-gradient(180deg, rgba(255,255,255,0.7) 0%, rgba(248,250,252,0.4) 100%);
    backdrop-filter: blur(8px);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 24px;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.03);
}

.hero-badge-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0% { transform: scale(0.9); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.5; }
}

.legal-hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 48px;
    font-weight: 900;
    letter-spacing: -1.5px;
    margin: 0 0 16px 0;
    background: linear-gradient(135deg, var(--secondary) 20%, #475569 50%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.15;
}

.legal-hero-desc {
    font-size: 16.5px;
    max-width: 650px;
    margin: 0 auto;
    color: #475569;
    line-height: 1.7;
    font-weight: 400;
}

/* Responsive Grid Layout */
.legal-container {
    position: relative;
    z-index: 2;
    max-width: 1140px;
    margin: 45px auto 90px auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 900px) {
    .legal-container {
        grid-template-columns: 1fr;
        gap: 30px;
        margin: 30px auto 70px auto;
    }
}

/* Sidebar Navigation - Glass Card */
.legal-sidebar {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.05);
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legal-nav-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(226, 232, 240, 0.6);
    text-align: left;
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Outfit', sans-serif;
    position: relative;
    overflow: hidden;
}

.legal-nav-btn svg {
    width: 20px;
    height: 20px;
    color: #64748b;
    transition: all 0.3s;
}

.legal-nav-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: var(--primary);
    transform: scaleY(0);
    transition: transform 0.3s;
    border-radius: 0 4px 4px 0;
}

.legal-nav-btn:hover {
    background-color: rgba(239, 68, 68, 0.05);
    color: var(--primary);
    border-color: rgba(239, 68, 68, 0.15);
    padding-left: 22px;
}

.legal-nav-btn:hover svg {
    color: var(--primary);
    transform: scale(1.1);
}

.legal-nav-btn.active {
    background-color: rgba(239, 68, 68, 0.08);
    color: var(--primary);
    border-color: rgba(239, 68, 68, 0.2);
    box-shadow: none;
    padding-left: 22px;
}

.legal-nav-btn.active::before {
    transform: scaleY(1);
}

.legal-nav-btn.active svg {
    color: var(--primary);
}

@media (max-width: 900px) {
    .legal-sidebar {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        padding: 12px;
        border-radius: 16px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .legal-sidebar::-webkit-scrollbar {
        display: none;
    }
    .legal-nav-btn {
        flex: 0 0 auto;
        width: auto;
        padding: 12px 18px;
        font-size: 13.5px;
    }
    .legal-nav-btn::before {
        left: 0;
        top: auto;
        bottom: 0;
        width: 100%;
        height: 3px;
        border-radius: 3px 3px 0 0;
        transform: scaleX(0);
    }
    .legal-nav-btn.active::before {
        transform: scaleX(1);
        transform: scaleY(1);
    }
    .legal-nav-btn:hover {
        padding-left: 18px;
    }
    .legal-nav-btn.active {
        padding-left: 18px;
    }
}

/* Content Area - Premium Glass Card */
.legal-content-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    padding: 50px 55px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.04);
    min-height: 550px;
    transition: all 0.3s;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

@media (max-width: 600px) {
    .legal-content-card {
        padding: 30px 24px;
        border-radius: 20px;
    }
}

.legal-tab-panel {
    display: none;
    animation: legalFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.legal-tab-panel.active {
    display: block;
}

@keyframes legalFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.legal-h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 8px 0;
    color: var(--secondary);
    letter-spacing: -0.8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.legal-h2 svg {
    width: 32px;
    height: 32px;
    color: var(--primary);
    flex-shrink: 0;
}

.legal-last-updated {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 35px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(100, 116, 139, 0.06);
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid rgba(100, 116, 139, 0.1);
}

.legal-section {
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.01);
    transition: all 0.3s;
}

.legal-section:hover {
    border-color: rgba(226, 232, 240, 1);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.02);
}

.legal-h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 14px 0;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.legal-h3 span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary) 0%, #f43f5e 100%);
    color: #ffffff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

.legal-content-card p {
    font-size: 15px;
    color: #475569;
    line-height: 1.75;
    margin: 0 0 16px 0;
}

.legal-content-card p:last-child {
    margin-bottom: 0;
}

/* Styled Premium Checklists */
.legal-list {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.legal-list-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-size: 14.5px;
    color: #475569;
    line-height: 1.65;
}

.legal-list-item svg {
    width: 18px;
    height: 18px;
    color: #10b981;
    margin-top: 3px;
    flex-shrink: 0;
}

.legal-list-item strong {
    color: var(--secondary);
}

/* State of the art Notification Banner */
.legal-callout {
    background-color: #fffbeb;
    border: 1px solid #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0 0 0;
    display: flex;
    gap: 14px;
}

.legal-callout-icon {
    color: #d97706;
    flex-shrink: 0;
    margin-top: 2px;
}

.legal-callout-icon svg {
    width: 22px;
    height: 22px;
}

.legal-callout-text h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 15.5px;
    font-weight: 700;
    color: #92400e;
    margin: 0 0 4px 0;
}

.legal-callout-text p {
    font-size: 13.5px;
    color: #b45309;
    margin-bottom: 0;
    line-height: 1.55;
}


/* --- Dynamic Accordions --- */
.accordion-item {
    padding: 0 !important;
    overflow: hidden;
}
.accordion-header {
    width: 100%;
    background: none;
    border: none;
    outline: none;
    text-align: left;
    padding: 24px 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: background-color 0.3s;
}
.accordion-header:hover {
    background-color: rgba(239, 68, 68, 0.02);
}
.accordion-caret {
    width: 20px;
    height: 20px;
    color: #64748b;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
}
.accordion-item.active .accordion-caret {
    transform: rotate(180deg);
    color: var(--primary);
}
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.accordion-body {
    padding: 0 28px 28px 28px;
}
.accordion-body p {
    font-size: 15px;
    color: #475569;
    line-height: 1.75;
    margin: 0 0 16px 0;
}
.accordion-body p:last-child {
    margin-bottom: 0;
}

/* --- Premium Interactive Search Box --- */
.legal-search-wrapper {
    margin-bottom: 35px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding-bottom: 25px;
}
.search-box-premium {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    border: 1.5px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    padding: 2px 14px;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.02);
    transition: all 0.3s;
}
.search-box-premium:focus-within {
    border-color: rgba(239, 68, 68, 0.4);
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.06);
}
.search-icon {
    width: 20px;
    height: 20px;
    color: #94a3b8;
    margin-right: 12px;
}
.search-box-premium input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    padding: 12px 0;
    font-size: 14.5px;
    color: var(--secondary);
    font-weight: 500;
}
.search-box-premium input::placeholder {
    color: #94a3b8;
}
.clear-search-btn {
    border: none;
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
    font-size: 16px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}
.clear-search-btn:hover {
    background: var(--primary);
    color: #ffffff;
}
.search-feedback {
    font-size: 13px;
    color: #475569;
    margin-top: 10px;
    padding-left: 4px;
}
mark.legal-highlight {
    background-color: rgba(239, 68, 68, 0.18);
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

/* --- Helpfulness Feedback Widget --- */
.legal-feedback-widget {
    margin-top: 50px;
    background: rgba(255, 255, 255, 0.5);
    border: 1.5px dashed rgba(226, 232, 240, 1);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s;
}
.feedback-initial, .feedback-success {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: opacity 0.3s;
}
.feedback-initial span {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--secondary);
    font-family: 'Outfit', sans-serif;
}
.feedback-btn-group {
    display: flex;
    gap: 10px;
}
.feedback-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: #ffffff;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Outfit', sans-serif;
}
.feedback-btn svg {
    width: 14px;
    height: 14px;
    color: #94a3b8;
    transition: color 0.3s;
}
.btn-yes:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
    color: #10b981;
}
.btn-yes:hover svg {
    color: #10b981;
}
.btn-no:hover {
    border-color: var(--primary);
    background: rgba(239, 68, 68, 0.05);
    color: var(--primary);
}
.btn-no:hover svg {
    color: var(--primary);
}
.feedback-success span {
    font-size: 14px;
    font-weight: 600;
    color: #10b981;
}
.success-check {
    width: 22px;
    height: 22px;
    color: #10b981;
    flex-shrink: 0;
}

/* --- Sticky Support Card --- */
.legal-support-card {
    position: relative;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 20px;
    padding: 24px;
    color: #ffffff;
    overflow: hidden;
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.3);
    margin-top: 15px;
    transition: all 0.3s;
}
.legal-support-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 45px -15px rgba(15, 23, 42, 0.4);
}
.support-card-glow {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.25) 0%, rgba(239, 68, 68, 0) 70%);
    filter: blur(20px);
    pointer-events: none;
}
.support-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: var(--primary);
    margin-bottom: 18px;
}
.support-card-icon svg {
    width: 22px;
    height: 22px;
}
.legal-support-card h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 8px 0;
    letter-spacing: -0.3px;
    color: var(--primary);
}
.legal-support-card p {
    font-size: 12.5px;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0 0 20px 0;
}
.support-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px;
    background: #ffffff;
    color: #0f172a;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
    font-family: 'Outfit', sans-serif;
}
.support-btn svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s;
}
.support-btn:hover {
    background: var(--primary);
    color: #ffffff;
}
.support-btn:hover svg {
    transform: translateX(4px);
}

@media (max-width: 900px) {
    .legal-support-card {
        display: none;
    }
}
@media (max-width: 600px) {
    .feedback-initial {
        flex-direction: column;
        text-align: center;
        gap: 14px;
    }
}

/* Sidebar search match badge */
.search-badge {
    background-color: var(--primary);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 99px;
    margin-left: auto;
    animation: badgeScaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes badgeScaleIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Floating back to top button */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 50%;
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}
.back-to-top-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(239, 68, 68, 0.25);
}
.back-to-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
}
.back-to-top-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s;
}
.back-to-top-btn:hover svg {
    transform: translateY(-2px);
}

/* Hero Print Action Button */
.legal-print-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    color: #475569;
    padding: 8px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px;
    font-family: 'Outfit', sans-serif;
    box-shadow: var(--shadow-sm);
}
.legal-print-trigger:hover {
    background: var(--secondary);
    color: #ffffff;
    border-color: var(--secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.legal-print-trigger svg {
    width: 16px;
    height: 16px;
}

/* @media print stylesheet overrides */
@media print {
    body {
        background: #ffffff !important;
        color: #1e293b !important;
    }
    header, footer, .legal-sidebar, .legal-search-wrapper, .legal-feedback-widget, .blur-shape-1, .blur-shape-2, .legal-hero, .mobile-drawer-overlay, .mobile-drawer, .back-to-top-btn {
        display: none !important;
    }
    .legal-page-wrapper {
        background: #ffffff !important;
    }
    .legal-container {
        grid-template-columns: 1fr !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
    }
    .legal-content-card {
        background: #ffffff !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }
    .legal-tab-panel {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .legal-tab-panel:not(.active) {
        display: none !important;
    }
    .accordion-content {
        max-height: none !important;
        opacity: 1 !important;
        display: block !important;
        overflow: visible !important;
    }
    .accordion-header {
        pointer-events: none !important;
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        margin-top: 20px !important;
        page-break-inside: avoid !important;
    }
    .accordion-caret {
        display: none !important;
    }
    .accordion-body {
        padding: 20px !important;
        border: 1px solid #e2e8f0 !important;
        border-top: none !important;
    }
    .legal-section {
        background: #ffffff !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        page-break-inside: avoid !important;
    }
}