/* ============================================================
   RESET E BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --azul-marinho: #0a2540;
    --azul-medio: #1a4d7a;
    --verde: #1a9c5b;
    --verde-escuro: #147a47;
    --amarelo: #f5c518;
    --cinza-claro: #f5f7fa;
    --cinza-borda: #e0e5ec;
    --cinza-texto: #4a5568;
    --branco: #ffffff;
    --vermelho: #dc3545;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: #1a202c;
    background: var(--branco);
    font-size: 16px;
}

h1, h2, h3, h4 {
    color: var(--azul-marinho);
    line-height: 1.3;
    margin-bottom: 0.6em;
    font-weight: 700;
}

h1 { font-size: 2rem; margin-top: 0.5em; }
h2 { font-size: 1.5rem; margin-top: 1.5em; }
h3 { font-size: 1.2rem; margin-top: 1.2em; }

p { margin-bottom: 1rem; color: #2d3748; }

a { color: var(--verde-escuro); text-decoration: none; }
a:hover { color: var(--azul-marinho); text-decoration: underline; }

ul, ol { margin: 1rem 0 1rem 2rem; }
li { margin-bottom: 0.4rem; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--branco);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

th, td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--cinza-borda);
}

th {
    background: var(--azul-marinho);
    color: var(--branco);
    font-weight: 600;
}

tr:last-child td { border-bottom: none; }
tr:nth-child(even) { background: #f9fafb; }

hr {
    border: none;
    border-top: 1px solid var(--cinza-borda);
    margin: 2rem 0;
}

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
header {
    background: var(--branco);
    border-bottom: 1px solid var(--cinza-borda);
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--azul-marinho);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo:hover { text-decoration: none; color: var(--verde-escuro); }

.menu ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    margin: 0;
    flex-wrap: wrap;
}

.menu ul a {
    color: var(--azul-marinho);
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.menu ul a:hover {
    background: var(--cinza-claro);
    color: var(--verde-escuro);
    text-decoration: none;
}

main {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

footer {
    background: var(--azul-marinho);
    color: var(--branco);
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 4rem;
}

footer p { color: #cbd5e0; margin-bottom: 0.5rem; }
footer a { color: var(--branco); }
footer a:hover { color: var(--amarelo); }

/* ============================================================
   HOME (index.html)
   ============================================================ */
.hero {
    background: linear-gradient(135deg, var(--azul-marinho) 0%, var(--azul-medio) 100%);
    color: var(--branco);
    padding: 3rem 2rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 2rem;
}

.hero h1 { color: var(--branco); }
.hero p { color: #e2e8f0; font-size: 1.1rem; }

.badge-gratuito {
    display: inline-block;
    background: var(--amarelo);
    color: var(--azul-marinho);
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.card {
    background: var(--branco);
    border: 2px solid var(--cinza-borda);
    border-radius: 12px;
    padding: 1.8rem 1.5rem;
    text-align: center;
    transition: all 0.3s;
}

.card:hover {
    border-color: var(--verde);
    box-shadow: 0 8px 20px rgba(26, 156, 91, 0.12);
    transform: translateY(-4px);
}

.card .icone {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    display: block;
}

.card h3 {
    color: var(--azul-marinho);
    margin-bottom: 0.6rem;
    font-size: 1.15rem;
}

.card p {
    color: var(--cinza-texto);
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
}

.bloco-info {
    background: var(--cinza-claro);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    border-left: 4px solid var(--verde);
}

.bloco-info h2 { margin-top: 0; }

.destaque-amarelo {
    background: #fffbea;
    border-left: 4px solid var(--amarelo);
    padding: 1rem 1.2rem;
    border-radius: 6px;
    margin: 1rem 0;
}

/* ============================================================
   BOTÕES
   ============================================================ */
.botao, .botao-cta {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    font-size: 1rem;
}

.botao-primario, .botao-cta {
    background: var(--verde);
    color: var(--branco);
}

.botao-primario:hover, .botao-cta:hover {
    background: var(--verde-escuro);
    color: var(--branco);
    text-decoration: none;
    transform: translateY(-1px);
}

.botao-secundario {
    background: transparent;
    color: var(--verde-escuro);
    border: 2px solid var(--verde);
}

.botao-secundario:hover {
    background: var(--verde);
    color: var(--branco);
    text-decoration: none;
}

button[type="submit"], form button {
    background: var(--verde);
    color: var(--branco);
    border: none;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}

button[type="submit"]:hover, form button:hover {
    background: var(--verde-escuro);
}

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
form {
    background: var(--branco);
    padding: 1.8rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 2rem;
    border: 1px solid var(--cinza-borda);
}

form label {
    display: block;
    font-weight: 600;
    color: var(--azul-marinho);
    margin-bottom: 0.4rem;
    margin-top: 1rem;
    font-size: 0.95rem;
}

form label:first-of-type { margin-top: 0; }

form input[type="text"],
form input[type="email"],
form input[type="number"],
form select,
form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--cinza-borda);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: var(--branco);
    margin-bottom: 0.8rem;
}

form input:focus,
form select:focus,
form textarea:focus {
    outline: none;
    border-color: var(--verde);
    box-shadow: 0 0 0 3px rgba(26, 156, 91, 0.1);
}

form textarea { min-height: 120px; resize: vertical; }

/* ============================================================
   RESULTADO DO SIMULADOR
   ============================================================ */
.resultado {
    background: var(--branco);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid var(--cinza-borda);
    margin-top: 2rem;
}

.resultado h2 {
    margin-top: 0;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--cinza-borda);
}

.resultado p strong {
    color: var(--azul-marinho);
}

.resultado ul {
    background: var(--cinza-claro);
    padding: 1rem 1rem 1rem 2rem;
    border-radius: 8px;
    margin: 1rem 0;
}

/* ============================================================
   ALERTAS E MENSAGENS
   ============================================================ */
.alerta {
    padding: 1rem 1.2rem;
    border-radius: 8px;
    margin-bottom: 1.2rem;
    font-weight: 500;
    border-left: 4px solid;
}

.alerta-danger {
    background: #fef2f2;
    color: #991b1b;
    border-left-color: var(--vermelho);
}

.alerta-warning {
    background: #fffbeb;
    color: #92400e;
    border-left-color: var(--amarelo);
}

.flash {
    padding: 1rem 1.2rem;
    border-radius: 8px;
    margin-bottom: 1.2rem;
    font-weight: 500;
}

.flash-error { background: #fef2f2; color: #991b1b; }
.flash-success { background: #f0fdf4; color: #166534; }

/* ============================================================
   ARTIGOS
   ============================================================ */
.lista-artigos {
    display: grid;
    gap: 1.2rem;
    margin: 2rem 0;
}

.card-artigo {
    background: var(--branco);
    padding: 1.5rem 1.8rem;
    border-radius: 12px;
    border: 1px solid var(--cinza-borda);
    border-left: 4px solid var(--verde);
    transition: all 0.2s;
}

.card-artigo:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    transform: translateX(4px);
}

.card-artigo h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.card-artigo h2 a {
    color: var(--azul-marinho);
    text-decoration: none;
}

.card-artigo h2 a:hover {
    color: var(--verde-escuro);
    text-decoration: none;
}

.card-artigo p {
    color: var(--cinza-texto);
    margin-bottom: 0.6rem;
}

.card-artigo small {
    color: #718096;
    font-size: 0.85rem;
    font-weight: 500;
}

.artigo {
    background: var(--branco);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.artigo header {
    position: static;
    background: none;
    border-bottom: 2px solid var(--cinza-borda);
    padding: 0 0 1.2rem 0;
    margin-bottom: 1.5rem;
    box-shadow: none;
}

.artigo h1 {
    color: var(--azul-marinho);
    font-size: 1.9rem;
    margin-bottom: 0.5rem;
}

.meta-info {
    color: #718096;
    font-size: 0.9rem;
    font-weight: 500;
}

.conteudo-artigo h2 {
    margin-top: 2rem;
    color: var(--azul-marinho);
    border-left: 4px solid var(--verde);
    padding-left: 0.8rem;
}

.conteudo-artigo h3 {
    margin-top: 1.5rem;
    color: var(--azul-medio);
}

.cta-calculadora {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px dashed var(--verde);
    padding: 1.8rem;
    border-radius: 12px;
    text-align: center;
    margin: 2rem 0;
}

.cta-calculadora h3 {
    color: var(--verde-escuro);
    margin-top: 0;
}

.cta-calculadora .botao-cta {
    margin-top: 0.8rem;
}

.voltar {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--cinza-borda);
}

.voltar a {
    color: var(--verde-escuro);
    font-weight: 600;
}

/* ============================================================
   ERRO 404
   ============================================================ */
.erro-404 {
    text-align: center;
    padding: 3rem 1rem;
}

.erro-404 h1 {
    font-size: 2.5rem;
    color: var(--azul-marinho);
}

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 640px) {
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }
    main { padding: 0 1rem; margin: 1rem auto; }

    .menu {
        flex-direction: column;
        align-items: flex-start;
    }

    .menu ul {
        width: 100%;
        gap: 0.2rem;
    }

    .menu ul a {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }

    .hero { padding: 2rem 1.2rem; }
    .artigo { padding: 1.2rem; }
    .artigo h1 { font-size: 1.5rem; }

    table { font-size: 0.9rem; }
    th, td { padding: 0.6rem 0.7rem; }
}
/* Aviso legal no rodapé */
footer .aviso-legal {
    max-width: 800px;
    margin: 0 auto 1rem;
    font-size: 0.85rem;
}

.hero .botao { margin-top: 0.5rem; }
.card-artigo h3 { margin-top: 0; margin-bottom: 0.5rem; }

/* ============================================================
   SIMULADOR
   ============================================================ */
.simulador-topo {
    text-align: center;
    margin-bottom: 2rem;
}

.simulador-topo .badge-gratuito { margin-top: 0; }
.simulador-topo h1 { margin-top: 0.8rem; font-size: 2.2rem; }
.simulador-topo p { color: var(--cinza-texto); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

.form-simulador {
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(10, 37, 64, 0.08);
}

.passo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.8rem;
}

.passo + .opcoes-atividade { margin-top: 0; }
.campo-ajuda + .passo { margin-top: 1.8rem; }

.passo-numero {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--azul-marinho);
    color: var(--branco);
    font-weight: 700;
    font-size: 0.9rem;
    display: grid;
    place-items: center;
}

.form-simulador .passo label,
.passo-titulo {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--azul-marinho);
}

.campo-moeda {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--cinza-borda);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.campo-moeda:focus-within {
    border-color: var(--verde);
    box-shadow: 0 0 0 4px rgba(26, 156, 91, 0.12);
}

.campo-moeda-prefixo {
    display: grid;
    place-items: center;
    padding: 0 1.1rem;
    background: var(--cinza-claro);
    color: var(--azul-marinho);
    font-weight: 700;
    font-size: 1.2rem;
    border-right: 2px solid var(--cinza-borda);
}

form .campo-moeda input[type="number"] {
    border: none;
    border-radius: 0;
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    padding: 0.9rem 1rem;
    box-shadow: none;
}

.campo-ajuda {
    font-size: 0.88rem;
    color: #718096;
    margin: 0.5rem 0 0;
}

.opcoes-atividade {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-bottom: 1.6rem;
}

form label.opcao-atividade {
    margin: 0;
    cursor: pointer;
    font-weight: normal;
}

.opcao-atividade input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.opcao-conteudo {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem 1.1rem;
    border: 2px solid var(--cinza-borda);
    border-radius: 12px;
    background: var(--branco);
    transition: all 0.2s;
    position: relative;
}

.opcao-atividade:hover .opcao-conteudo { border-color: #a7d7bd; }

.opcao-atividade input:checked + .opcao-conteudo {
    border-color: var(--verde);
    background: #f0fdf4;
    box-shadow: 0 4px 12px rgba(26, 156, 91, 0.15);
}

.opcao-atividade input:checked + .opcao-conteudo::after {
    content: "✓";
    position: absolute;
    top: 0.7rem;
    right: 0.8rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--verde);
    color: var(--branco);
    font-size: 0.8rem;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.opcao-atividade input:focus-visible + .opcao-conteudo {
    outline: 3px solid rgba(26, 156, 91, 0.4);
    outline-offset: 2px;
}

.opcao-nome { font-weight: 700; color: var(--azul-marinho); padding-right: 1.6rem; }
.opcao-detalhe { font-size: 0.85rem; color: #718096; margin-bottom: 0.5rem; }
.opcao-preco { margin-top: auto; font-weight: 700; color: var(--verde-escuro); font-size: 1.15rem; }
.opcao-preco small { font-weight: 500; color: #718096; font-size: 0.8rem; margin-left: 2px; }

.form-simulador button[type="submit"] {
    font-size: 1.1rem;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(26, 156, 91, 0.25);
}

/* Resultado */
.resultado {
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
    scroll-margin-top: 90px;
}

.resultado-destaque {
    background: linear-gradient(135deg, var(--azul-marinho) 0%, var(--azul-medio) 100%);
    color: var(--branco);
    text-align: center;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.resultado-rotulo { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; color: #cbd5e0; font-weight: 600; }
.resultado-valor { font-size: 3rem; font-weight: 800; line-height: 1.1; color: var(--branco); }
.resultado-sub { color: #e2e8f0; }

.resultado-corpo { padding: 1.8rem 2rem 2rem; }

.resultado .resultado-corpo h2 {
    font-size: 1.1rem;
    margin: 1.6rem 0 0.8rem;
    padding: 0;
    border: none;
}

.resultado .resultado-corpo h2:first-of-type { margin-top: 0; }
.resultado-corpo .alerta + h2 { margin-top: 1.2rem; }

.composicao {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.8rem;
}

.composicao-item {
    background: var(--cinza-claro);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
}

.composicao-item span { font-size: 0.85rem; font-weight: 600; color: var(--cinza-texto); }
.composicao-item strong { font-size: 1.3rem; color: var(--azul-marinho); }
.composicao-item small { font-size: 0.8rem; color: #718096; }

.limite-barra {
    height: 14px;
    background: var(--cinza-claro);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--cinza-borda);
}

.limite-barra span {
    display: block;
    height: 100%;
    background: var(--verde);
    border-radius: 999px;
}

.limite-warning span { background: var(--amarelo); }
.limite-danger span { background: var(--vermelho); }

.limite-legenda { margin: 0.5rem 0 1.2rem; font-size: 0.95rem; color: var(--cinza-texto); }

.resumo-numeros {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin: 0;
}

.resumo-numeros div {
    border: 1px solid var(--cinza-borda);
    border-radius: 10px;
    padding: 0.8rem 1rem;
}

.resumo-numeros dt { font-size: 0.82rem; color: #718096; font-weight: 600; }
.resumo-numeros dd { margin: 0; font-weight: 700; color: var(--azul-marinho); font-size: 1.05rem; }

.resultado-links {
    margin-top: 1.8rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--cinza-borda);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.resultado-links p { margin: 0 0.4rem 0 0; font-weight: 600; }
.resultado-links .botao { padding: 0.5rem 1rem; font-size: 0.92rem; }

.simulador .conteudo-artigo { margin-top: 3rem; }

@media (max-width: 640px) {
    .simulador-topo h1 { font-size: 1.7rem; }
    .form-simulador { padding: 1.3rem; }
    .opcoes-atividade { grid-template-columns: 1fr; }
    .resultado-valor { font-size: 2.4rem; }
    .resultado-corpo { padding: 1.3rem; }
    .resumo-numeros { grid-template-columns: 1fr; }
}

/* ============================================================
   CALCULADORAS EXTRAS
   ============================================================ */
.migalhas {
    font-size: 0.88rem;
    color: #718096;
    margin-bottom: 1rem;
}

.calc-campos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 1.2rem;
    margin-bottom: 1rem;
}

.calc-campos label { margin-top: 0; }
.calc-campos .campo-moeda { margin-bottom: 0; }
.form-simulador > label { margin-top: 1rem; }
.form-simulador .campo-moeda + .campo-ajuda,
.form-simulador input + .campo-ajuda { margin-bottom: 1rem; }
.form-simulador .campo-moeda input[type="number"] { font-size: 1.15rem; }

form input[type="month"],
form input[type="date"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--cinza-borda);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--branco);
    color: inherit;
}

form label.opcao-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
    margin: 0.5rem 0 1.5rem;
    cursor: pointer;
}

.opcao-check input { width: 18px; height: 18px; accent-color: var(--verde); }

.alerta-sucesso {
    background: #f0fdf4;
    color: #166534;
    border-left-color: var(--verde);
}

a.card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

a.card-link:hover { text-decoration: none; }

.outras-calculadoras { margin-top: 3rem; }
.outras-calculadoras h2 { text-align: center; }

.resultado-valor small { font-size: 1rem; font-weight: 500; margin-left: 4px; }

.comparativo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.comparativo-col {
    border: 2px solid var(--cinza-borda);
    border-radius: 12px;
    padding: 1.2rem;
}

.comparativo-col h3 { margin-top: 0; }
.comparativo-col ul { margin: 0.5rem 0 0 1.2rem; font-size: 0.92rem; }
.comparativo-melhor { border-color: var(--verde); background: #f0fdf4; }
.comparativo-valor { font-size: 1.6rem; font-weight: 800; color: var(--azul-marinho); margin-bottom: 0.3rem; }
.comparativo-valor small { font-size: 0.9rem; font-weight: 500; color: #718096; }

.aviso-calculo {
    font-size: 0.9rem;
    background: var(--cinza-claro);
    padding: 1rem 1.2rem;
    border-radius: 8px;
    margin-top: 2rem;
}

@media (max-width: 640px) {
    .calc-campos,
    .comparativo { grid-template-columns: 1fr; }
    .calc-campos > div + div { margin-top: 1rem; }
}

.cta-calculadora .cta-mais { margin: 0.8rem 0 0; font-size: 0.9rem; }
