/* ============================================
   LEGAL PAGES — Shared Styles
   Used by: terms.html, privacy.html, 
            disclaimer.html, risk-warning.html
   Theme: Dark, consistent with platform
   ============================================ */

/* Layout */
.legal-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 20px;
}

/* Back Link */
.legal-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgb(249, 115, 22);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 24px;
    transition: all 0.3s;
}

.legal-back-link:hover {
    gap: 12px;
    color: rgb(251, 146, 60);
}

/* Header */
.legal-header {
    text-align: center;
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 2px solid #27272a;
}

.legal-title {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.legal-subtitle {
    color: #9ca3af;
    font-size: 14px;
}

/* Content Area */
.legal-content {
    background: rgba(39, 39, 42, 0.5);
    border: 1px solid #3f3f46;
    border-radius: 16px;
    padding: 40px;
    line-height: 1.8;
    color: #e5e7eb;
}

.legal-content h1,
.legal-content h2,
.legal-content h3 {
    color: #fff;
    margin-top: 32px;
    margin-bottom: 16px;
}

.legal-content h1 {
    font-size: 28px;
    font-weight: 700;
}

.legal-content h2 {
    font-size: 24px;
    font-weight: 600;
}

.legal-content h3 {
    font-size: 20px;
    font-weight: 600;
}

.legal-content p {
    margin-bottom: 16px;
}

.legal-content ul,
.legal-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.legal-content li {
    margin-bottom: 8px;
}

.legal-content a {
    color: rgb(249, 115, 22);
    text-decoration: underline;
}

.legal-content a:hover {
    color: rgb(251, 146, 60);
}

/* Loading State */
.legal-loading {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.legal-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #3f3f46;
    border-top-color: rgb(249, 115, 22);
    border-radius: 50%;
    animation: legal-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes legal-spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.legal-error {
    text-align: center;
    padding: 40px 20px;
    color: #ef4444;
}

.legal-error svg {
    margin-bottom: 12px;
}

.legal-error p {
    margin-bottom: 16px;
}

.legal-retry-btn {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    color: rgb(249, 115, 22);
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.legal-retry-btn:hover {
    background: rgba(249, 115, 22, 0.2);
}

/* Risk Warning Badge (risk-warning.html only) */
.legal-warning-badge {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

/* Print Button */
.legal-print-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #3f3f46;
    color: #9ca3af;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.legal-print-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
}

/* Cross-Navigation Footer */
.legal-nav-footer {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #27272a;
}

.legal-nav-footer h3 {
    font-size: 14px;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legal-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.legal-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(39, 39, 42, 0.5);
    border: 1px solid #3f3f46;
    border-radius: 10px;
    color: #d1d5db;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.legal-nav-link:hover {
    border-color: rgba(249, 115, 22, 0.4);
    color: rgb(249, 115, 22);
    background: rgba(249, 115, 22, 0.05);
}

.legal-nav-link.active {
    border-color: rgba(249, 115, 22, 0.5);
    color: rgb(249, 115, 22);
    background: rgba(249, 115, 22, 0.08);
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .legal-content {
        padding: 24px;
    }

    .legal-title {
        font-size: 28px;
    }

    .legal-nav-links {
        flex-direction: column;
    }

    .legal-nav-link {
        justify-content: center;
    }
}

@media print {
    .pro-topbar,
    .legal-back-link,
    .legal-nav-footer,
    .legal-print-btn,
    .legal-warning-badge {
        display: none !important;
    }

    .legal-container {
        padding: 0;
    }

    .legal-content {
        background: none;
        border: none;
        padding: 0;
        color: #000;
    }

    .legal-content h1,
    .legal-content h2,
    .legal-content h3 {
        color: #000;
    }

    .legal-title {
        color: #000;
    }
}
