/* =====================================================
   FINANCIAI - ESTILOS COMPARTILHADOS
   Carregado em todas as páginas (includes/topo.php).
   Cores ficam em variáveis: o modo escuro só troca
   os valores, sem repetir regras.
===================================================== */

:root {
    --fonte: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --largura: 1240px;
    --raio: 22px;

    --verde: #3FAF8A;
    --verde-claro: #67C5A6;
    --azul: #164A7A;
    --degrade: linear-gradient(90deg, #164A7A, #67C5A6);
}

body {
    /* modo claro */
    --fundo: #f6faf9;
    --texto: #1b2a33;
    --texto-suave: #5d6e76;
    --titulo: #0f2f4d;
    --destaque: linear-gradient(90deg, #1f6fb5, #3FAF8A);
    --cartao: rgba(255, 255, 255, 0.78);
    --cartao-borda: rgba(22, 74, 122, 0.14);
    --cartao-sombra: 0 14px 40px rgba(22, 74, 122, 0.10);
    --campo: #ffffff;
    --campo-borda: #d3dfde;
    --suave: rgba(103, 197, 166, 0.14);
    --linha: rgba(22, 74, 122, 0.10);
    --brilho-verde: rgba(63, 175, 138, 0.42);
    --brilho-azul: rgba(70, 130, 210, 0.22);
    --grafico: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22470%22 height=%22640%22 viewBox=%220 0 470 640%22 fill=%22none%22%3E%3Cdefs%3E%3ClinearGradient id=%22b%22 x1=%220%22 y1=%220%22 x2=%220%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%232f9c7a%22 stop-opacity=%220.26%22/%3E%3Cstop offset=%221%22 stop-color=%22%232f9c7a%22 stop-opacity=%220%22/%3E%3C/linearGradient%3E%3ClinearGradient id=%22l%22 x1=%220%22 y1=%220%22 x2=%221%22 y2=%220%22%3E%3Cstop offset=%220%22 stop-color=%22%232f9c7a%22 stop-opacity=%220%22/%3E%3Cstop offset=%22.4%22 stop-color=%22%232f9c7a%22 stop-opacity=%220.45%22/%3E%3Cstop offset=%221%22 stop-color=%22%232f9c7a%22 stop-opacity=%220.75%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x=%22168%22 y=%22195%22 width=%2236%22 height=%22445%22 rx=%226%22 fill=%22url(%23b)%22/%3E%3Crect x=%22225%22 y=%22158%22 width=%2236%22 height=%22482%22 rx=%226%22 fill=%22url(%23b)%22/%3E%3Crect x=%22282%22 y=%22118%22 width=%2236%22 height=%22522%22 rx=%226%22 fill=%22url(%23b)%22/%3E%3Crect x=%22340%22 y=%2278%22 width=%2236%22 height=%22562%22 rx=%226%22 fill=%22url(%23b)%22/%3E%3Crect x=%22398%22 y=%2228%22 width=%2236%22 height=%22612%22 rx=%226%22 fill=%22url(%23b)%22/%3E%3Cpath d=%22M60 308C190 302 330 250 470 146%22 stroke=%22url(%23l)%22 stroke-width=%221.6%22/%3E%3C/svg%3E");
}

body.modo-escuro {
    --fundo: #050a12;
    --texto: #eef3f5;
    --texto-suave: #a9b7bd;
    --titulo: #ffffff;
    --destaque: linear-gradient(90deg, #3d9be6, #5fd3ad);
    --cartao: rgba(9, 18, 28, 0.62);
    --cartao-borda: rgba(103, 197, 166, 0.30);
    --cartao-sombra: 0 14px 40px rgba(0, 0, 0, 0.35);
    --campo: rgba(255, 255, 255, 0.04);
    --campo-borda: rgba(255, 255, 255, 0.16);
    --suave: rgba(103, 197, 166, 0.12);
    --linha: rgba(255, 255, 255, 0.10);
    --brilho-verde: rgba(46, 168, 136, 0.50);
    --brilho-azul: rgba(32, 78, 150, 0.42);
    --grafico: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22470%22 height=%22640%22 viewBox=%220 0 470 640%22 fill=%22none%22%3E%3Cdefs%3E%3ClinearGradient id=%22b%22 x1=%220%22 y1=%220%22 x2=%220%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%233FAF8A%22 stop-opacity=%220.3%22/%3E%3Cstop offset=%221%22 stop-color=%22%233FAF8A%22 stop-opacity=%220%22/%3E%3C/linearGradient%3E%3ClinearGradient id=%22l%22 x1=%220%22 y1=%220%22 x2=%221%22 y2=%220%22%3E%3Cstop offset=%220%22 stop-color=%22%233FAF8A%22 stop-opacity=%220%22/%3E%3Cstop offset=%22.4%22 stop-color=%22%233FAF8A%22 stop-opacity=%220.57%22/%3E%3Cstop offset=%221%22 stop-color=%22%233FAF8A%22 stop-opacity=%220.95%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x=%22168%22 y=%22195%22 width=%2236%22 height=%22445%22 rx=%226%22 fill=%22url(%23b)%22/%3E%3Crect x=%22225%22 y=%22158%22 width=%2236%22 height=%22482%22 rx=%226%22 fill=%22url(%23b)%22/%3E%3Crect x=%22282%22 y=%22118%22 width=%2236%22 height=%22522%22 rx=%226%22 fill=%22url(%23b)%22/%3E%3Crect x=%22340%22 y=%2278%22 width=%2236%22 height=%22562%22 rx=%226%22 fill=%22url(%23b)%22/%3E%3Crect x=%22398%22 y=%2228%22 width=%2236%22 height=%22612%22 rx=%226%22 fill=%22url(%23b)%22/%3E%3Cpath d=%22M60 308C190 302 330 250 470 146%22 stroke=%22url(%23l)%22 stroke-width=%221.6%22/%3E%3C/svg%3E");
    color-scheme: dark;
}


/* ================= BASE ================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #f6faf9;
}

html:has(body.modo-escuro) {
    background: #050a12;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    font-family: var(--fonte);
    color: var(--texto);
    line-height: 1.5;
}

/* Fundo: brilho verde à esquerda, brilho azul embaixo à direita
   e gráfico de barras. Fica fixo enquanto a página rola. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        var(--grafico) right top 190px / 470px 640px no-repeat,
        radial-gradient(ellipse 36% 64% at 0% 42%, var(--brilho-verde), transparent),
        radial-gradient(ellipse 46% 56% at 100% 94%, var(--brilho-azul), transparent),
        var(--fundo);
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1,
h2,
h3 {
    color: var(--titulo);
    line-height: 1.15;
}

a {
    color: var(--verde);
}

img {
    max-width: 100%;
}

.escondido {
    display: none !important;
}

/* palavra em degradê dentro dos títulos */
.destaque {
    background: var(--destaque);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* área central de cada página */
.pagina {
    flex: 1;
    width: min(100% - 48px, var(--largura));
    margin: 0 auto;
    padding: 56px 0 96px;
}


/* ================= CABEÇALHO ================= */

.cabecalho {
    display: flex;
    align-items: center;
    gap: 48px;
    width: min(100% - 48px, 1400px);
    margin: 0 auto;
    padding: 22px 0;
}

.logo {
    display: block;
    flex-shrink: 0;
}

.logo img {
    display: block;
    height: 46px;
    width: auto;
}

/* a logo de letras brancas só aparece no modo escuro */
.logo-escuro,
body.modo-escuro .logo-claro {
    display: none !important;
}

body.modo-escuro .logo-escuro {
    display: block !important;
}

.menu {
    display: flex;
    gap: 36px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu a {
    position: relative;
    padding: 6px 0;
    color: var(--texto);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}

.menu a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--degrade);
    transform: scaleX(0);
    transition: transform 0.2s;
}

.menu a:hover,
.menu a.ativo {
    color: var(--verde);
}

.menu a:hover::after,
.menu a.ativo::after {
    transform: scaleX(1);
}

.cabecalho-acoes {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.botao-tema {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--cartao-borda);
    border-radius: 50%;
    background: var(--cartao);
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.botao-tema:hover {
    transform: scale(1.08);
    border-color: var(--verde-claro);
}

.botao-tema:focus-visible {
    outline: 2px solid var(--verde-claro);
    outline-offset: 2px;
}

/* ícones do botão de tema: lua no modo claro, sol no modo escuro */
.botao-tema svg {
    grid-area: 1 / 1;
    width: 20px;
    height: 20px;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 0.25s, transform 0.35s;
}

.icone-lua {
    fill: var(--titulo);
    stroke: none;
}

.icone-sol {
    fill: none;
    stroke: #f2b632;
    stroke-width: 2;
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

.icone-sol circle {
    fill: #f2b632;
}

body.modo-escuro .icone-lua {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}

body.modo-escuro .icone-sol {
    opacity: 1;
    transform: none;
}


/* ================= BOTÕES ================= */

.botao,
.botao-entrar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 30px;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.botao {
    background: var(--degrade);
    color: #ffffff;
}

.botao-entrar {
    padding: 11px 26px;
    background: var(--verde-claro);
    color: #06281f;
}

.botao:hover,
.botao-entrar:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(63, 175, 138, 0.28);
}

.botao-largo {
    width: 100%;
}

.botao:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


/* ================= CARTÕES E CAMPOS ================= */

.cartao {
    padding: 32px;
    border: 1px solid var(--cartao-borda);
    border-radius: var(--raio);
    background: var(--cartao);
    box-shadow: var(--cartao-sombra);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

input:not([type="file"]),
select,
textarea {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid var(--campo-borda);
    border-radius: 12px;
    outline: none;
    background: var(--campo);
    color: var(--texto);
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input::placeholder,
textarea::placeholder {
    color: var(--texto-suave);
}

input:not([type="file"]):focus,
select:focus,
textarea:focus {
    border-color: var(--verde-claro);
    box-shadow: 0 0 0 3px rgba(103, 197, 166, 0.18);
}

body.modo-escuro option {
    background: #0c1622;
}

label {
    display: block;
    margin-bottom: 7px;
    color: var(--texto-suave);
    font-size: 13px;
    font-weight: 600;
}


/* ================= PERFIL NO CABEÇALHO ================= */

.perfil-topo {
    position: relative;
}

.perfil-botao {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px 5px 5px;
    border: 1px solid var(--cartao-borda);
    border-radius: 999px;
    background: var(--cartao);
    color: var(--texto);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.foto-perfil-topo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.nome-perfil {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-perfil {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 50;
    display: none;
    min-width: 190px;
    padding: 8px;
    border: 1px solid var(--cartao-borda);
    border-radius: 16px;
    background: var(--fundo);
    box-shadow: var(--cartao-sombra);
}

.menu-perfil.aberto {
    display: block;
}

.menu-perfil a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--texto);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.menu-perfil a:hover {
    background: var(--suave);
}

.menu-perfil a.sair {
    color: #e05c5c;
}

/* ícones do menu do perfil (desenhados, sem emoji) */
.icone-menu {
    flex: none;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--verde);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.menu-perfil a.sair .icone-menu {
    stroke: currentColor;
}

.menu-perfil a.sair {
    margin-top: 4px;
    border-top: 1px solid var(--linha);
    border-radius: 0 0 10px 10px;
}


/* ================= RODAPÉ ================= */

.rodape {
    border-top: 1px solid var(--linha);
    background: var(--cartao);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.rodape-conteudo {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 48px;
    width: min(100% - 48px, var(--largura));
    margin: 0 auto;
    padding: 44px 0 32px;
}

.rodape .logo img {
    height: 36px;
    margin-bottom: 14px;
}

.rodape h3 {
    margin-bottom: 12px;
    color: var(--verde);
    font-size: 15px;
}

.rodape p {
    max-width: 320px;
    color: var(--texto-suave);
    font-size: 14px;
}

.rodape-links a {
    display: block;
    width: fit-content;
    margin-bottom: 8px;
    color: var(--texto-suave);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.rodape-links a:hover {
    color: var(--verde);
}

.rodape-inferior {
    padding: 16px 24px;
    border-top: 1px solid var(--linha);
    text-align: center;
}

.rodape-inferior p {
    max-width: none;
    font-size: 13px;
}


/* ================= TELAS MENORES ================= */

/* o menu desce para uma linha própria */
@media (max-width: 1100px) {
    .cabecalho {
        flex-wrap: wrap;
        gap: 14px 20px;
        padding: 16px 0;
    }

    .cabecalho nav {
        order: 3;
        width: 100%;
    }

    .menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px 24px;
    }
}

@media (max-width: 900px) {
    /* sem o gráfico, para não atrapalhar a leitura */
    body,
    body.modo-escuro {
        --grafico: none;
    }

    .pagina {
        padding: 32px 0 64px;
    }

    .cartao {
        padding: 24px;
    }

    .rodape-conteudo {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

@media (max-width: 560px) {
    .logo img {
        height: 32px;
    }

    .menu a {
        font-size: 15px;
    }

    .botao-tema {
        width: 40px;
        height: 40px;
    }

    .botao-entrar {
        padding: 9px 20px;
        font-size: 15px;
    }

    .nome-perfil {
        display: none;
    }
}
