/* ==========================================================================
   R.R EDUCAÇÃO — TERMOS E CONDIÇÕES DE USO (DARK NEON DESIGN SYSTEM)
   Paleta Oficial: Ciano Neon (#00ffcc) + Roxo (#7000ff) + Fundo Deep (#05070b)
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

:root {
    --bg-deep: #05070b;
    --bg-surface: #0b0f19;
    --bg-card: #101626;
    --bg-card-hover: #151d32;
    --text-main: #f3f6fa;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    /* Degradê Oficial R.R Educação (Backup Original) */
    --accent-neon: #00ffcc;
    --gradient-primary: linear-gradient(135deg, #00ffcc 0%, #7000ff 100%);
    
    --accent-cyan: #00e5ff;
    --accent-emerald: #2ed573;
    --border-color: #1e293b;
    --border-neon-cyan: rgba(0, 229, 255, 0.35);
    --border-neon-emerald: rgba(46, 213, 115, 0.35);
    --shadow-card: 0 12px 32px -8px rgba(0, 0, 0, 0.6);
    --header-height: 80px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 105px;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.7;
    background-image: 
        radial-gradient(circle at 15% 10%, rgba(0, 255, 204, 0.05) 0%, transparent 35%),
        radial-gradient(circle at 85% 30%, rgba(112, 0, 255, 0.04) 0%, transparent 35%),
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- BARRA DE PROGRESSO DE LEITURA --- */
.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.04);
    z-index: 2000;
}

.reading-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    box-shadow: 0 0 12px var(--accent-neon);
    transition: width 0.1s ease-out;
}

/* --- CABEÇALHO --- */
.site-header, header {
    height: 80px;
    width: 100%;
    border-bottom: 1px solid #1e293b;
    background-color: rgba(5, 7, 11, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container, header .container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.brand-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    transition: transform 0.2s ease;
}

.brand-box:hover {
    transform: translateY(-1px);
}

/* LOGO OFICIAL CONFORME O BACKUP */
.logo-rs {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -2px;
    display: flex;
}

.logo-rs span {
    background: linear-gradient(135deg, #00ffcc 0%, #7000ff 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.logo-rs span.mirrored {
    transform: scaleX(-1);
}

.logo-sub {
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-voltar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(0, 255, 204, 0.08);
    color: #00ffcc;
    border: 1px solid rgba(0, 255, 204, 0.35);
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-voltar:hover {
    background: #00ffcc;
    color: #05070b;
    box-shadow: 0 0 18px rgba(0, 255, 204, 0.4);
    transform: translateY(-1px);
}

/* --- HERO JURÍDICO --- */
.legal-hero {
    padding: 56px 0 40px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(11, 15, 25, 0.85) 0%, rgba(5, 7, 11, 0.4) 100%);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(46, 213, 115, 0.12);
    color: var(--accent-emerald);
    border: 1px solid rgba(46, 213, 115, 0.3);
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.8rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

.meta-version {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 2px 10px;
    border-radius: 6px;
    color: var(--accent-neon);
    font-size: 0.78rem;
    font-weight: 600;
}

.legal-hero h1 {
    font-size: clamp(2rem, 4vw, 2.85rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    background: linear-gradient(90deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-lead {
    max-width: 850px;
    color: var(--text-secondary);
    font-size: 1.08rem;
    margin-bottom: 36px;
}

.hero-lead strong {
    color: var(--accent-neon);
}

/* Cards de Resumo Rápido */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.summary-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 255, 204, 0.3);
}

.summary-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    flex-shrink: 0;
}

.summary-icon.cyan {
    background: rgba(0, 255, 204, 0.1);
    color: var(--accent-neon);
    border: 1px solid rgba(0, 255, 204, 0.25);
}

.summary-icon.emerald {
    background: rgba(46, 213, 115, 0.1);
    color: var(--accent-emerald);
    border: 1px solid rgba(46, 213, 115, 0.25);
}

.summary-card h3 {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.summary-card p {
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* --- LAYOUT PRINCIPAL (SIDEBAR + ARTIGO) --- */
.legal-layout {
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 40px;
    padding-top: 48px;
    padding-bottom: 80px;
    align-items: start;
}

/* --- SUMÁRIO LATERAL (TOC) --- */
.toc-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 24px);
}

.toc-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow-card);
}

.toc-mobile-toggle {
    display: none;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 700;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.toc-header-desktop {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent-neon);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toc-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 0.87rem;
    font-weight: 500;
    color: var(--text-muted);
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
}

.toc-link:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
}

.toc-link.active {
    background: rgba(0, 255, 204, 0.08);
    color: var(--accent-neon);
    border-left-color: var(--accent-neon);
    font-weight: 600;
}

.toc-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
}

.toc-link.active .toc-num {
    color: var(--accent-emerald);
    opacity: 1;
}

.toc-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.toc-footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.toc-support-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid rgba(0, 255, 204, 0.25);
    color: var(--accent-neon);
    font-size: 0.84rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.toc-support-btn:hover {
    background: var(--accent-neon);
    color: var(--bg-deep);
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.3);
}

/* --- CONTEÚDO DAS CLÁUSULAS --- */
.legal-content {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.legal-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 36px;
    box-shadow: var(--shadow-card);
    transition: border-color 0.25s ease;
}

.legal-section:hover {
    border-color: rgba(0, 255, 204, 0.22);
}

.section-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.section-badge {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-emerald);
    background: rgba(46, 213, 115, 0.1);
    border: 1px solid rgba(46, 213, 115, 0.25);
    padding: 3px 10px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.legal-section h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.legal-section p {
    color: var(--text-secondary);
    font-size: 0.98rem;
    margin-bottom: 16px;
    text-align: justify;
}

.legal-section p:last-child {
    margin-bottom: 0;
}

.legal-section strong {
    color: var(--text-main);
    font-weight: 600;
}

.inline-link {
    color: var(--accent-neon);
    font-weight: 600;
    border-bottom: 1px dashed var(--accent-neon);
    transition: all 0.2s ease;
}

.inline-link:hover {
    color: var(--accent-emerald);
    border-bottom-color: var(--accent-emerald);
}

/* Listas Jurídicas */
.legal-list {
    list-style: none;
    margin: 16px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legal-list li {
    position: relative;
    padding-left: 24px;
    color: var(--text-secondary);
    font-size: 0.96rem;
    line-height: 1.65;
}

.legal-list li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 10px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-neon);
    box-shadow: 0 0 8px var(--accent-neon);
}

/* Grid de Categorias de Contas (Seção 4) */
.tiers-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 22px 0;
}

.tier-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
}

.tier-item.highlight-cyan {
    border-color: rgba(0, 255, 204, 0.35);
    background: linear-gradient(180deg, rgba(0, 255, 204, 0.06) 0%, var(--bg-card) 100%);
}

.tier-item.highlight-emerald {
    border-color: var(--border-neon-emerald);
    background: linear-gradient(180deg, rgba(46, 213, 115, 0.06) 0%, var(--bg-card) 100%);
}

.tier-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.tier-item.highlight-cyan .tier-title i {
    color: var(--accent-neon);
}

.tier-item.highlight-emerald .tier-title i {
    color: var(--accent-emerald);
}

.tier-item p {
    font-size: 0.86rem;
    color: var(--text-muted);
    text-align: left;
    margin-bottom: 0;
}

/* --- CAIXAS DESTACADAS (CALLOUTS CDC E LGPD) --- */
.callout-box {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 22px 24px;
    border-radius: 12px;
    margin: 22px 0;
}

.callout-icon {
    font-size: 1.75rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.callout-body h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.callout-body p {
    font-size: 0.92rem;
    margin-bottom: 0;
    line-height: 1.65;
}

.emerald-callout {
    background: rgba(46, 213, 115, 0.07);
    border: 1px solid var(--border-neon-emerald);
    border-left: 4px solid var(--accent-emerald);
}

.emerald-callout .callout-icon,
.emerald-callout .callout-body h4 {
    color: var(--accent-emerald);
}

.cyan-callout {
    background: rgba(0, 255, 204, 0.07);
    border: 1px solid rgba(0, 255, 204, 0.35);
    border-left: 4px solid var(--accent-neon);
}

.cyan-callout .callout-icon,
.cyan-callout .callout-body h4 {
    color: var(--accent-neon);
}

/* Selo Final de Autenticação */
.document-seal {
    margin-top: 28px;
    padding: 20px 24px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.seal-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.seal-left i {
    font-size: 2.2rem;
    color: var(--accent-emerald);
}

.seal-left div {
    display: flex;
    flex-direction: column;
}

.seal-left strong {
    font-size: 0.95rem;
    color: var(--text-main);
}

.seal-left span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.seal-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent-neon);
    background: rgba(0, 255, 204, 0.08);
    border: 1px solid rgba(0, 255, 204, 0.25);
    padding: 6px 12px;
    border-radius: 8px;
}

/* --- BOTÃO VOLTAR AO TOPO --- */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--bg-surface);
    border: 1px solid rgba(0, 255, 204, 0.35);
    color: var(--accent-neon);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.25s ease;
    z-index: 900;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--accent-neon);
    color: var(--bg-deep);
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.45);
}

/* --- RODAPÉ ELEGANTE --- */
.site-footer, footer {
    border-top: 1px solid #1e293b;
    background-color: #0b0f19;
    padding: 44px 0 28px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

/* LINK DA PÁGINA ATIVA DESTACADO EM VERDE/CIANO NEON */
.footer-links a.active,
.footer-links a[aria-current="page"] {
    color: #00ffcc !important;
    font-weight: 700;
}

.social-icons {
    display: flex;
    gap: 14px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #111827;
    border: 1px solid #1e293b;
    color: #94a3b8;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-icons a:hover {
    color: #00ffcc;
    border-color: #00ffcc;
    background: rgba(0, 255, 204, 0.08);
    transform: translateY(-2px);
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 0.8rem;
    text-align: center;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    width: 100%;
}

.footer-bottom p {
    margin: 0;
}

.footer-update-note {
    color: #475569;
    font-size: 0.75rem;
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 992px) {
    .summary-grid,
    .tiers-box {
        grid-template-columns: 1fr;
    }

    .legal-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .toc-sidebar {
        position: sticky;
        top: calc(var(--header-height) + 8px);
        z-index: 800;
    }

    .toc-header-desktop,
    .toc-footer {
        display: none;
    }

    .toc-mobile-toggle {
        display: flex;
    }

    .toc-nav {
        display: none;
        margin-top: 14px;
        padding-top: 12px;
        border-top: 1px solid var(--border-color);
        max-height: 60vh;
        overflow-y: auto;
    }

    .toc-nav.open {
        display: flex;
    }
}

@media (max-width: 640px) {
    .legal-section {
        padding: 24px 18px;
    }

    .legal-section p {
        text-align: left;
    }

    .callout-box {
        flex-direction: column;
        gap: 10px;
        padding: 18px;
    }
}