/**
 * Legal Pages Shared Styles
 * Sistema de design unificado para páginas jurídicas/legais
 * Utilizado por: legal.html, termos.html, contrato-b2b.html, politica-api.html, sla.html
 */

/* ========== CSS Variables ========== */
:root {
    --legal-primary: #6366f1;
    --legal-secondary: #8b5cf6;
    --legal-accent: #a855f7;
    --legal-dark: #1e1b4b;
    --legal-light: #f5f3ff;
    --legal-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --legal-card-bg: #ffffff;
    --legal-text: #475569;
    --legal-text-dark: #1e293b;
    --legal-border: #e2e8f0;
    --legal-shadow: rgba(0, 0, 0, 0.08);
    --legal-page-bg: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
}

/* ========== Site Header (Shared) ========== */
.site-header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 24px;
    color: var(--dark-blue, #0d47a1);
    transition: color 0.3s ease;
}

.site-header .logo-icon { 
    font-size: 32px; 
}

.nav-menu {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--text-gray, #6b7280);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active { 
    color: var(--primary-blue, #1a73e8); 
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--legal-gradient);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.theme-toggle {
    background: rgba(99, 102, 241, 0.1);
    border: 2px solid var(--legal-primary);
    color: var(--legal-primary);
    font-size: 18px;
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--legal-primary);
    color: white;
    transform: scale(1.05);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--legal-dark);
}

/* ========== Legal Page Base ========== */
.legal-page {
    padding-top: 100px;
    min-height: 100vh;
    background: var(--legal-page-bg);
}

.legal-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* ========== Legal Header ========== */
.legal-header {
    text-align: center;
    margin-bottom: 50px;
}

.legal-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--legal-gradient);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.legal-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--legal-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    line-height: 1.2;
}

.legal-subtitle {
    color: #64748b;
    font-size: 1.1rem;
}

.version-info {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.version-tag {
    background: #e2e8f0;
    color: #475569;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* ========== Back Link ========== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--legal-primary);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.back-link:hover {
    text-decoration: underline;
    transform: translateX(-4px);
}

/* ========== Controller/Info Boxes ========== */
.controller-box {
    background: var(--legal-gradient);
    color: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 40px;
}

.controller-box h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.controller-box p {
    margin: 8px 0;
    opacity: 0.95;
    line-height: 1.6;
}

.controller-box a {
    color: #fef3c7;
    text-decoration: underline;
}

.controller-box a:hover {
    color: #fde68a;
}

.parties-box,
.scope-box {
    background: var(--legal-card-bg);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px var(--legal-shadow);
    border-left: 4px solid var(--legal-primary);
}

.parties-box h3,
.scope-box h3 {
    color: var(--legal-primary);
    margin-bottom: 15px;
}

/* ========== Section/Clause Cards ========== */
.section,
.clause {
    background: var(--legal-card-bg);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px var(--legal-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section:hover,
.clause:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.section h2,
.clause h2 {
    color: var(--legal-text-dark);
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--legal-border);
}

.section-icon,
.clause-icon {
    width: 40px;
    height: 40px;
    background: var(--legal-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.section p,
.clause p {
    color: var(--legal-text);
    line-height: 1.8;
    margin: 12px 0;
}

.section ul,
.clause ul {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.section li,
.clause li {
    position: relative;
    padding-left: 28px;
    margin: 10px 0;
    color: var(--legal-text);
    line-height: 1.7;
}

.section li::before,
.clause li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

.section.prohibited li::before,
.clause.prohibited li::before {
    content: "✗";
    color: #ef4444;
}

.section.info li::before {
    content: "•";
    color: var(--legal-primary);
}

/* ========== Highlight Text ========== */
.highlight-text {
    background: linear-gradient(120deg, #fef3c7 0%, #fde68a 100%);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    color: #92400e;
}

/* ========== Document ID Footer ========== */
.document-id {
    background: #1e293b;
    color: white;
    border-radius: 16px;
    padding: 30px;
    margin-top: 40px;
    text-align: center;
}

.document-id h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.document-id p {
    margin: 5px 0;
    opacity: 0.9;
}

/* ========== SLA Specific Components ========== */
.uptime-highlight {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    text-align: center;
}

.uptime-value {
    font-size: 4rem;
    font-weight: 800;
    display: block;
    margin-bottom: 10px;
}

.uptime-label {
    font-size: 1.2rem;
    opacity: 0.9;
}

.incident-levels {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

.incident-level {
    display: flex;
    align-items: stretch;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}

.level-badge {
    width: 100px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    text-align: center;
}

.level-1 .level-badge { background: #dc2626; }
.level-2 .level-badge { background: #f97316; }
.level-3 .level-badge { background: #eab308; }
.level-4 .level-badge { background: #22c55e; }

.level-content {
    flex: 1;
    padding: 15px;
}

.level-content h4 {
    margin: 0 0 8px 0;
    color: var(--legal-text-dark);
}

.level-content ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.level-content li {
    padding: 3px 0;
    font-size: 0.9rem;
}

.level-content li::before {
    content: "–";
    margin-right: 8px;
    color: #94a3b8;
}

/* ========== SLA Table ========== */
.sla-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
}

.sla-table th,
.sla-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--legal-border);
}

.sla-table th {
    background: var(--legal-gradient);
    color: white;
    font-weight: 600;
}

.sla-table tr:nth-child(even) {
    background: #f8fafc;
}

.sla-table tr:last-child td {
    border-bottom: none;
}

/* ========== Scope Columns ========== */
.scope-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.scope-column h4 {
    color: #10b981;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.scope-column.excluded h4 {
    color: #ef4444;
}

.scope-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.scope-column li {
    padding: 5px 0;
    color: var(--legal-text);
    font-size: 0.95rem;
}

.scope-column li::before {
    content: none;
}

/* ========== DARK MODE ========== */
[data-theme="dark"] {
    --legal-card-bg: #1e293b;
    --legal-text: #cbd5e1;
    --legal-text-dark: #f1f5f9;
    --legal-border: #334155;
    --legal-shadow: rgba(0, 0, 0, 0.3);
    --legal-page-bg: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="dark"] .site-header {
    background: rgba(15, 23, 42, 0.98);
    border-color: #334155;
}

[data-theme="dark"] .site-header .logo {
    color: white;
}

[data-theme="dark"] .nav-link {
    color: #94a3b8;
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    color: #a78bfa;
}

[data-theme="dark"] .theme-toggle {
    background: rgba(139, 92, 246, 0.2);
    border-color: #a78bfa;
    color: #a78bfa;
}

[data-theme="dark"] .legal-subtitle {
    color: #94a3b8;
}

[data-theme="dark"] .version-tag {
    background: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .back-link {
    color: #a78bfa;
}

[data-theme="dark"] .parties-box,
[data-theme="dark"] .scope-box {
    background: var(--legal-card-bg);
    border-color: #a78bfa;
}

[data-theme="dark"] .parties-box h3,
[data-theme="dark"] .scope-box h3 {
    color: #a78bfa;
}

[data-theme="dark"] .section,
[data-theme="dark"] .clause {
    background: var(--legal-card-bg);
}

[data-theme="dark"] .section h2,
[data-theme="dark"] .clause h2 {
    color: var(--legal-text-dark);
    border-color: var(--legal-border);
}

[data-theme="dark"] .highlight-text {
    background: linear-gradient(120deg, #78350f 0%, #92400e 100%);
    color: #fef3c7;
}

[data-theme="dark"] .incident-level {
    background: #334155;
}

[data-theme="dark"] .level-content h4 {
    color: white;
}

[data-theme="dark"] .level-content li {
    color: #cbd5e1;
}

[data-theme="dark"] .sla-table tr:nth-child(even) {
    background: #334155;
}

[data-theme="dark"] .sla-table td {
    color: #cbd5e1;
    border-color: #475569;
}

[data-theme="dark"] .scope-column li {
    color: #cbd5e1;
}

/* ========== LEGAL HUB PAGE (legal.html) ========== */
.legal-page-hub .legal-container {
    max-width: 1200px;
}

.legal-page-hub .legal-header .subtitle {
    font-size: 18px;
    color: var(--text-gray, #64748b);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

.legal-categories {
    display: grid;
    gap: 40px;
}

.legal-category {
    background: var(--legal-card-bg);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.08);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--legal-light);
}

.category-icon {
    width: 60px;
    height: 60px;
    background: var(--legal-gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.category-title h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--legal-dark);
    margin-bottom: 4px;
}

.category-title p {
    font-size: 14px;
    color: var(--text-gray, #64748b);
}

.legal-docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.legal-doc-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.legal-doc-card:hover {
    border-color: var(--legal-primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
}

.legal-doc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--legal-gradient);
    opacity: 0;
    transition: opacity 0.3s;
}

.legal-doc-card:hover::before {
    opacity: 1;
}

.doc-icon {
    font-size: 32px;
    margin-bottom: 16px;
}

.doc-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--legal-dark);
    margin-bottom: 8px;
    line-height: 1.4;
}

.doc-description {
    font-size: 14px;
    color: var(--text-gray, #64748b);
    line-height: 1.6;
    margin-bottom: 16px;
}

.doc-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.doc-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doc-tag.lgpd {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.doc-tag.lda {
    background: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
}

.doc-tag.b2b {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.doc-tag.sla {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.doc-tag.iso {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.legal-notice {
    background: linear-gradient(135deg, var(--legal-dark) 0%, #312e81 100%);
    border-radius: 24px;
    padding: 40px;
    margin-top: 60px;
    color: white;
    text-align: center;
}

.legal-notice h3 {
    font-size: 24px;
    margin-bottom: 16px;
}

.legal-notice p {
    font-size: 16px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 24px;
    line-height: 1.7;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    margin-top: 24px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    opacity: 0.9;
}

/* Legal Hub Dark Mode */
[data-theme="dark"] .legal-category {
    background: #1e293b;
}

[data-theme="dark"] .category-title h2,
[data-theme="dark"] .doc-title {
    color: #e0e0e0;
}

[data-theme="dark"] .category-title p,
[data-theme="dark"] .doc-description {
    color: #a0a0a0;
}

[data-theme="dark"] .legal-doc-card {
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .category-header {
    border-bottom-color: #374151;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    [data-theme="dark"] .nav-menu {
        background: #1e293b;
    }

    .menu-toggle {
        display: block;
    }

    .legal-header h1 {
        font-size: 1.8rem;
    }

    .section,
    .clause {
        padding: 20px;
    }

    .uptime-value {
        font-size: 3rem;
    }

    .incident-level {
        flex-direction: column;
    }

    .level-badge {
        width: 100%;
        padding: 10px;
        flex-direction: row;
        gap: 10px;
    }

    .scope-columns {
        grid-template-columns: 1fr;
    }

    .version-info {
        flex-direction: column;
        align-items: center;
    }

    /* Legal Hub Responsive */
    .legal-category {
        padding: 24px;
    }

    .legal-docs-grid {
        grid-template-columns: 1fr;
    }

    .legal-notice {
        padding: 24px;
    }

    .contact-info {
        flex-direction: column;
        align-items: center;
    }
}
