/* ========================================
   Legal Pages Specific Styles
   ======================================== */

.legal-header {
    padding: 10rem 0 4rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.legal-header-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.legal-title {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    margin-bottom: var(--spacing-md);
}

.legal-subtitle {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    margin-bottom: var(--spacing-lg);
}

.legal-description {
    font-size: var(--font-size-base);
    opacity: 0.85;
    line-height: 1.7;
}

/* Legal Content Layout */
.legal-content {
    padding: var(--spacing-3xl) 0;
    background: white;
}

.legal-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--spacing-3xl);
    align-items: start;
}

/* Sidebar / Table of Contents */
.legal-sidebar {
    position: relative;
}

.toc-sticky {
    position: sticky;
    top: 100px;
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
}

.toc-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.toc-link {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
}

.toc-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    transition: height var(--transition-base);
}

.toc-link:hover,
.toc-link.active {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.toc-link.active::before {
    height: 100%;
}

/* Legal Content */
.legal-main {
    flex: 1;
    max-width: 800px;
}

.legal-section {
    margin-bottom: 3rem;
    scroll-margin-top: 100px;
}

.legal-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
    letter-spacing: -0.02em;
}

.legal-section h3 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.legal-section p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #4b5563;
    margin-bottom: 1.25rem;
}

.legal-section ul,
.legal-section ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.legal-section li {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #4b5563;
    margin-bottom: 0.75rem;
}

.legal-section a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 500;
}

.legal-section a:hover {
    color: var(--secondary-color);
}

.legal-section strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* Contact Info Box */
.contact-info {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    margin-top: 1rem;
}

.contact-info p {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.contact-info p:last-child {
    margin-bottom: 0;
}

/* Legal Footer */
.legal-footer {
    margin-top: var(--spacing-2xl);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: var(--radius-lg);
    text-align: center;
}

.legal-footer p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin: 0;
}

.legal-footer i {
    color: var(--primary-color);
    margin-right: var(--spacing-xs);
}

/* Highlight Boxes */
.highlight-box {
    background: rgba(102, 126, 234, 0.05);
    border-left: 4px solid var(--primary-color);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    margin: var(--spacing-lg) 0;
}

.highlight-box p:last-child {
    margin-bottom: 0;
}

.warning-box {
    background: rgba(245, 87, 108, 0.05);
    border-left: 4px solid var(--secondary-color);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    margin: var(--spacing-lg) 0;
}

.warning-box p:last-child {
    margin-bottom: 0;
}

/* Print Styles */
@media print {

    .navbar,
    .footer,
    .legal-sidebar {
        display: none;
    }

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

    .legal-header {
        background: none;
        color: var(--text-primary);
        padding: 2rem 0;
    }

    .legal-section {
        page-break-inside: avoid;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .legal-wrapper {
        grid-template-columns: 1fr;
    }

    .legal-sidebar {
        order: -1;
    }

    .toc-sticky {
        position: static;
    }

    .toc-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }

    .toc-link {
        flex: 0 0 auto;
    }
}

@media (max-width: 768px) {
    .legal-header {
        padding: 8rem 0 3rem;
    }

    .legal-title {
        font-size: var(--font-size-3xl);
    }

    .legal-content {
        padding: var(--spacing-2xl) 0;
    }

    .legal-wrapper {
        gap: var(--spacing-xl);
    }

    .toc-nav {
        display: none;
    }

    .toc-sticky {
        padding: var(--spacing-md);
    }

    .toc-title {
        margin-bottom: 0;
        cursor: pointer;
    }

    .toc-title::after {
        content: ' ▼';
        font-size: var(--font-size-sm);
    }

    .toc-sticky.expanded .toc-nav {
        display: flex;
        margin-top: var(--spacing-md);
    }

    .toc-sticky.expanded .toc-title::after {
        content: ' ▲';
    }

    .legal-section h2 {
        font-size: var(--font-size-xl);
    }

    .legal-section h3 {
        font-size: var(--font-size-lg);
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Active Section Highlighting */
.legal-section.in-view {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0.5;
    }

    to {
        opacity: 1;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-lg);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.back-to-top i {
    font-size: 1.25rem;
}