/* =============================================================================
   TEMA ESCURO + BOTÃO SOL/LUA + INDICADOR DE ROLAGEM — 16/11/2026
   Par de js/tema.js. Carregar por último no <head> (depois do <style> da
   página). As regras do escuro usam html[data-theme="dark"], mais específico
   que o :root das páginas, então valem em qualquer ordem.

   Cuidado ao mexer: na paleta clara, --forest é ao mesmo tempo fundo (seções
   Quem Somos e Contato, menu lateral) e cor de destaque em texto, e --ink é texto
   e fundo do rodapé. No escuro essas variáveis viram as cores de TEXTO e os
   fundos recebem cores próprias (--superficie-verde, --rodape), abaixo.
   ============================================================================= */

/* ---------- paleta escura ---------- */
html[data-theme="dark"] {
    --cream: #14110D;          /* fundo da página */
    --warm-white: #1C1813;     /* faixas alternadas */
    --off-white: #1C1813;
    --white: #231E18;          /* cartões */
    --forest-pale: #1E2B24;
    --green-pale: #1E2B24;

    --ink: #EFE8DE;            /* texto principal */
    --charcoal: #D7CEC1;
    --mid: #A89B8B;
    --light: #3A332A;          /* bordas */
    --brown: #CBB8A5;
    --sand: #B5A285;

    --forest: #8AB49A;         /* destaque em texto (itálicos) */
    --forest-mid: #7FA58E;
    --green: #8AB49A;

    --terra-dark: #D4A090;     /* texto pequeno em terracota, claro no escuro */

    --superficie-verde: #2E463C;
    --rodape: #0C0A08;
}

/* ---------- fundos verdes (seções, menu) ---------- */
html[data-theme="dark"] .section-about,
html[data-theme="dark"] .section-contact,
html[data-theme="dark"] .sidenav,
html[data-theme="dark"] .mobile-header,
html[data-theme="dark"] .nav-overlay-v3__left,
html[data-theme="dark"] .location-btn--maps {
    background: var(--superficie-verde);
}

html[data-theme="dark"] .nav-overlay-v3__right::after {
    background: linear-gradient(to right, var(--superficie-verde) 0%, transparent 40%);
}

/* ---------- rodapé ---------- */
html[data-theme="dark"] footer,
html[data-theme="dark"] .footer {
    background: var(--rodape);
    border-top-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .footer-inst-v3,
html[data-theme="dark"] .footer__institutional {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* ---------- página inicial ---------- */
html[data-theme="dark"] .btn-editorial:hover {
    color: var(--superficie-verde);
}

html[data-theme="dark"] .section-courses {
    background: #5B4C30;
}

html[data-theme="dark"] .heading-courses em {
    color: var(--gold-light);
}

html[data-theme="dark"] .course-badge-v3 {
    color: #ffffff;
    background: rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .pub-type-v3 {
    color: var(--gold-light);
}

/* bloco "Quero ser parceiro" (Impacto/Mensagens): o fundo era var(--ink), que no
   escuro vira cor de texto clara */
html[data-theme="dark"] .cta-wrap {
    background: var(--rodape);
}

html[data-theme="dark"] .cta-btn-p {
    color: #1A1208;
}

/* números coloridos da página Impacto: claros o bastante no escuro */
html[data-theme="dark"] .dore-num,
html[data-theme="dark"] .pillar-card__num {
    filter: brightness(1.7);
}

html[data-theme="dark"] .btn-submit-v3 {
    color: #1A1208;
}

html[data-theme="dark"] .tool-status-v3--ar {
    background: rgba(138, 180, 154, 0.16);
    color: #A9CDB6;
}

html[data-theme="dark"] .tool-status-v3--demo {
    background: rgba(212, 190, 144, 0.16);
    color: #E0C995;
}

html[data-theme="dark"] .tool-status-v3--plan {
    background: rgba(184, 122, 106, 0.2);
    color: #E3AE9F;
}

html[data-theme="dark"] .tool-card-v3 ul li a,
html[data-theme="dark"] .doc-card__link {
    color: #D4A090;
}

/* ---------- subpáginas: estados de foco/hover que eram claros fixos ---------- */
html[data-theme="dark"] .doc-card:hover,
html[data-theme="dark"] .sig-card:hover,
html[data-theme="dark"] .feat-card:hover,
html[data-theme="dark"] .dore-card:hover,
html[data-theme="dark"] .feat-card--hero:hover {
    background: #252B23;
}

/* Mensagens Educativas: cartões e botões com branco fixo */
html[data-theme="dark"] .msg-card,
html[data-theme="dark"] .view-btn {
    background: var(--white);
    border-color: var(--light);
}

html[data-theme="dark"] .msg-id {
    background: var(--superficie-verde);
}

html[data-theme="dark"] .msg-cartilha__cta {
    color: var(--superficie-verde);
}

/* logo colorido: um pouco mais claro no fundo escuro */
html[data-theme="dark"] .standard-logo,
html[data-theme="dark"] .hero-left img {
    filter: brightness(1.15);
}

/* =============================================================================
   BOTÃO SOL/LUA (no menu lateral e no cabeçalho do celular)
   ============================================================================= */
.tema-botao {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    cursor: pointer;
    margin-bottom: 14px;
    transition: background 0.2s, border-color 0.2s;
}

.tema-botao:hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.5);
}

.tema-botao:focus-visible {
    outline: 2px solid var(--gold-light, #D4BE90);
    outline-offset: 2px;
}

.tema-botao--celular {
    margin: 0 14px 0 auto;
    width: 34px;
    height: 34px;
}

.tema-sol {
    display: none;
    color: var(--gold-light, #D4BE90);
}

html[data-theme="dark"] .tema-lua {
    display: none;
}

html[data-theme="dark"] .tema-sol {
    display: block;
}

/* =============================================================================
   INDICADOR DE ROLAGEM / VOLTAR AO TOPO (mesmo padrão do LAC Smart)
   ============================================================================= */
.topo-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 450;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}

.topo-widget.visivel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.topo-botao {
    position: relative;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--light, #CFC6B8);
    background: var(--cream, #F5F0EA);
    color: var(--ink, #1A1208);
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(26, 18, 8, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

.topo-botao:hover,
.topo-botao:focus-visible {
    background: var(--terra, #B87A6A);
    border-color: var(--terra, #B87A6A);
}

.topo-botao:focus-visible {
    outline: 2px solid var(--terra, #B87A6A);
    outline-offset: 3px;
}

.topo-anel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    pointer-events: none;
}

.topo-anel__fundo {
    fill: none;
    stroke: rgba(26, 18, 8, 0.1);
    stroke-width: 3;
}

.topo-anel__progresso {
    fill: none;
    stroke: var(--terra, #B87A6A);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 157.08;
    stroke-dashoffset: 157.08;
    transition: stroke-dashoffset 0.1s linear;
}

.topo-pct,
.topo-seta {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    transition: opacity 0.2s, transform 0.2s;
}

.topo-pct {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.topo-seta {
    opacity: 0;
    color: #ffffff;
    transform: translate(-50%, -50%) scale(0.6);
}

.topo-botao:hover .topo-pct,
.topo-botao:focus-visible .topo-pct {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6);
}

.topo-botao:hover .topo-seta,
.topo-botao:focus-visible .topo-seta {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

html[data-theme="dark"] .topo-botao {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .topo-anel__fundo {
    stroke: rgba(255, 255, 255, 0.12);
}

@media (max-width: 768px) {
    .topo-widget {
        right: 16px;
        bottom: 16px;
    }

    .topo-botao {
        width: 46px;
        height: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .topo-widget,
    .topo-anel__progresso,
    .topo-pct,
    .topo-seta {
        transition: none;
    }
}

@media print {
    .topo-widget,
    .tema-botao {
        display: none !important;
    }
}
