/* ================================
   LEGAL PAGES STYLES
   Clean, readable typography for Terms, Privacy, etc.
   ================================ */

/* Variables from main site */
:root {
    --primary-blue: #2563EB;
    --primary-green: #10B981;
    --text-dark: #1F2937;
    --text-medium: #4B5563;
    --text-muted: #6B7280;
    --bg-light: #F9FAFB;
    --border-light: #E5E7EB;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background: white;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* Container */
.legal-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary-green);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

/* Hero Section */
.legal-hero {
    text-align: center;
    padding: 3rem 0 2rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 3rem;
}

.legal-hero h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.legal-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    font-size: 0.9375rem;
    color: var(--text-medium);
}

.legal-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legal-meta-item strong {
    font-weight: 600;
    color: var(--text-dark);
}

/* Table of Contents */
.table-of-contents {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 3rem;
}

.table-of-contents h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.toc-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
}

.toc-list li {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.toc-number {
    font-weight: 600;
    color: var(--primary-blue);
    flex-shrink: 0;
    min-width: 2rem;
}

.toc-list a {
    color: var(--text-medium);
    text-decoration: none;
    transition: all 0.2s;
    flex: 1;
}

.toc-list a:hover {
    color: var(--primary-blue);
    transform: translateX(4px);
}

/* Legal Content */
.legal-content {
    margin-bottom: 4rem;
}

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

.legal-section h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-light);
}

.legal-section h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 2rem 0 1rem;
}

.legal-section h4 {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 1.5rem 0 0.75rem;
}

.legal-section p {
    color: var(--text-medium);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.legal-section ul,
.legal-section ol {
    margin: 1rem 0 1rem 1.5rem;
    color: var(--text-medium);
}

.legal-section li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

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

.legal-section em {
    font-style: italic;
}

/* Whereas Clauses (T&C Introduction) */
.whereas-clause {
    font-style: italic;
    color: var(--text-medium);
    margin-bottom: 0.75rem;
    padding-left: 1rem;
    border-left: 3px solid var(--border-light);
}

/* Important Notice Box */
.notice-box {
    background: rgba(37, 99, 235, 0.05);
    border-left: 4px solid var(--primary-blue);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
}

.notice-box p {
    color: var(--text-dark);
    font-weight: 500;
}

/* Warning Box */
.warning-box {
    background: rgba(239, 68, 68, 0.05);
    border-left: 4px solid #EF4444;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
}

.warning-box p {
    color: var(--text-dark);
    font-weight: 500;
}

/* Contact Card */
.contact-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin: 2rem 0;
}

.contact-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.contact-card p {
    color: var(--text-medium);
    margin-bottom: 0.5rem;
}

.contact-card a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.contact-card a:hover {
    color: var(--primary-green);
}

/* Definitions List */
.definitions-list {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.definitions-list dt {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.definitions-list dd {
    color: var(--text-medium);
    margin-bottom: 1rem;
    margin-left: 1rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    z-index: 100;
}

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

.back-to-top:hover {
    background: var(--primary-green);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

/* Print Styles */
@media print {
    .breadcrumb,
    .back-to-top,
    .table-of-contents {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.6;
    }

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

    .legal-section h2 {
        page-break-after: avoid;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .legal-container {
        padding: 1.5rem 1rem;
    }

    .legal-hero h1 {
        font-size: 2rem;
    }

    .legal-meta {
        gap: 1rem;
        font-size: 0.875rem;
    }

    .table-of-contents {
        padding: 1.5rem;
    }

    .toc-list {
        grid-template-columns: 1fr;
    }

    .legal-section h2 {
        font-size: 1.5rem;
    }

    .legal-section h3 {
        font-size: 1.125rem;
    }

    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 2.75rem;
        height: 2.75rem;
    }
}

@media (max-width: 480px) {
    .legal-hero {
        padding: 2rem 0 1.5rem;
    }

    .legal-hero h1 {
        font-size: 1.75rem;
    }

    .legal-section h2 {
        font-size: 1.25rem;
    }

    .legal-section h3 {
        font-size: 1rem;
    }

    .table-of-contents h2 {
        font-size: 1.125rem;
    }

    .contact-card {
        padding: 1.5rem;
    }
}
