/* Calculadora de juros compostos e investimentos - estilos compartilhados
   Paleta: verde escuro e dourado. Tipografia: Poppins, Roboto, Roboto Mono. */
:root {
  --bg: #07241a;
  --surface: #0c3123;
  --surface-2: #11402f;
  --fg: #eaf1ec;
  --muted: #9bb7a8;
  --line: rgba(234, 241, 236, 0.13);
  --grid: rgba(234, 241, 236, 0.09);
  --gold: #d4af37;
  --gold-ink: #07241a;
  --accent-2: #6fc5a0;
  --danger: #ff9b8a;
  --font-display: "Poppins", system-ui, sans-serif;
  --font-body: "Roboto", system-ui, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f6f2; --surface: #ffffff; --surface-2: #e4eee7; --fg: #0b2a1f; --muted: #4a6657;
    --line: rgba(11, 42, 31, 0.16); --grid: rgba(11, 42, 31, 0.09);
    --gold: #8d6b0f; --gold-ink: #f6e3a1; --accent-2: #1d7a55; --danger: #b3321f;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
.wrap { max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; line-height: 1.22; }
p { margin: 0; }
a { color: var(--gold); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--gold-ink); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* Cabeçalho */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-block: 12px; }
.brand { font: 600 15px var(--font-display); color: var(--fg); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand .mark { width: 28px; height: 28px; border-radius: 7px; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; font: 700 15px var(--font-display); }
nav.main { display: flex; gap: 4px 18px; flex-wrap: wrap; }
nav.main a { color: var(--muted); text-decoration: none; font: 500 14.5px var(--font-body); padding: 6px 2px; border-bottom: 2px solid transparent; }
nav.main a:hover { color: var(--fg); }
nav.main a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--gold); }

/* Hero */
.hero { padding-block: 40px 28px; display: grid; gap: 12px; }
.eyebrow { font: 500 12px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.hero h1 { font-size: clamp(28px, 5.2vw, 46px); font-weight: 700; letter-spacing: -0.01em; max-width: 20ch; }
.hero p { color: var(--muted); max-width: 62ch; font-size: 17px; }

/* Calculadora */
.calc { display: grid; gap: 20px; padding-bottom: 28px; }
@media (min-width: 920px) { .calc { grid-template-columns: 360px minmax(0, 1fr); align-items: start; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; min-width: 0; }
.panel h2 { font-size: 16px; font-weight: 600; margin-bottom: 18px; }
form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field > label, .field > .lbl { font-size: 14px; font-weight: 500; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.ctl { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.inp { position: relative; flex: 1 1 120px; min-width: 0; }
.inp input {
  width: 100%; height: 46px; padding: 0 12px; border-radius: 9px;
  background: var(--bg); color: var(--fg); border: 1px solid var(--line);
  font: 500 16px var(--font-mono);
}
.inp input:focus-visible { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.inp.pre input { padding-left: 42px; }
.inp .pfx { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font: 500 14px var(--font-mono); pointer-events: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--bg); position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg label { display: grid; place-items: center; padding: 0 14px; min-height: 44px; font: 500 13.5px var(--font-body); color: var(--muted); cursor: pointer; text-align: center; }
.seg input:checked + label { background: var(--gold); color: var(--gold-ink); }
.seg input:focus-visible + label { outline: 2px solid var(--fg); outline-offset: -3px; }
.seg.full { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn-ghost { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 9px; padding: 9px 14px; font: 500 13.5px var(--font-body); cursor: pointer; }
.btn-ghost:hover { color: var(--fg); border-color: var(--muted); }
.msg { min-height: 20px; font-size: 13.5px; color: var(--danger); }
.note-js { color: var(--muted); font-size: 14px; }

/* Resultados */
.right { display: grid; gap: 20px; min-width: 0; }
.results { display: grid; gap: 18px; }
.final { display: grid; gap: 4px; }
.final .k { font-size: 13px; color: var(--muted); }
.final .v { font: 600 clamp(28px, 6vw, 44px)/1.1 var(--font-mono); color: var(--gold); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 4px; min-width: 0; }
.stat .k { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stat .v { font: 500 20px var(--font-mono); overflow-wrap: anywhere; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.inv { background: var(--accent-2); }
.dot.jur { background: var(--gold); }
.split { height: 8px; border-radius: 99px; background: var(--accent-2); overflow: hidden; display: flex; justify-content: flex-end; }
.split i { display: block; background: var(--gold); height: 100%; }
.sum { font-size: 14.5px; color: var(--muted); }
.sum b { color: var(--fg); font-weight: 500; }
.eq { font-size: 12.5px; color: var(--muted); }

/* Gráfico */
.chart-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; margin-bottom: 10px; }
.chart-head h2 { margin: 0; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; gap: 7px; align-items: center; }
.chart { position: relative; width: 100%; height: 300px; }
.chart svg { display: block; width: 100%; height: 100%; }
.chart text { font: 400 12px var(--font-mono); fill: var(--muted); }
.chart .g { stroke: var(--grid); stroke-width: 1; fill: none; }
.chart .ax { stroke: var(--line); stroke-width: 1; fill: none; }
.chart .l-bal { stroke: var(--gold); stroke-width: 2.5; fill: none; stroke-linejoin: round; }
.chart .l-inv { stroke: var(--accent-2); stroke-width: 2; stroke-dasharray: 6 5; fill: none; stroke-linejoin: round; }
.chart .a-bal { fill: var(--gold); fill-opacity: .14; stroke: none; }
.chart .cur { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .pt-bal { fill: var(--gold); stroke: var(--surface); stroke-width: 2; }
.chart .pt-inv { fill: var(--accent-2); stroke: var(--surface); stroke-width: 2; }
.tip { position: absolute; top: 8px; pointer-events: none; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; font-size: 12.5px; line-height: 1.55; min-width: 170px; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 2; }
.tip .t { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.tip .r { display: flex; justify-content: space-between; gap: 14px; }
.tip .r span:last-child { font-family: var(--font-mono); }

/* Tabela da simulação */
.table-sec { padding-bottom: 28px; }
.table-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.table-head h2 { font-size: 20px; }
.scroll { overflow: auto; max-height: 440px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
.scroll table { min-width: 680px; }
th, td { padding: 11px 14px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
thead th { position: sticky; top: 0; background: var(--surface-2); font: 600 12.5px var(--font-body); color: var(--muted); letter-spacing: .02em; z-index: 1; }
td { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
td:first-child { font-family: var(--font-body); color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
.scroll tbody td:last-child { color: var(--gold); font-weight: 500; }
.scroll tbody tr:hover td { background: var(--surface-2); }

/* Conteúdo: guia, artigos, institucionais */
.guide { border-top: 1px solid var(--line); padding-block: 44px 20px; display: grid; gap: 40px; }
.guide h2, .article h2 { font-size: clamp(22px, 3.4vw, 28px); font-weight: 600; margin-bottom: 14px; }
.guide h3, .article h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.prose { max-width: 72ch; color: var(--muted); display: grid; gap: 14px; }
.prose b, .prose strong { color: var(--fg); font-weight: 500; }
.prose ul, .prose ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 72ch; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 14px; color: var(--muted); }
.steps li::before { content: counter(s); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--gold-ink); font: 600 14px var(--font-display); }
.steps li strong { color: var(--fg); font-weight: 500; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.fcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.fcard p { color: var(--muted); font-size: 14.5px; }
.fcard .ex { font: 400 13px var(--font-mono); color: var(--accent-2); }
a.fcard { text-decoration: none; color: var(--fg); }
a.fcard:hover { border-color: var(--gold); }
a.fcard h3 { color: var(--fg); }
a.fcard .more { color: var(--gold); font-size: 14px; font-weight: 500; }
.formula { font: 500 15px var(--font-mono); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; color: var(--fg); overflow-x: auto; max-width: 72ch; }
.faq { display: grid; gap: 0; max-width: 78ch; }
details { border-bottom: 1px solid var(--line); padding: 4px 0; }
summary { cursor: pointer; padding: 14px 0; font: 500 16px var(--font-body); }
details p { color: var(--muted); padding-bottom: 14px; max-width: 70ch; }

/* Artigos */
.article-wrap { padding-block: 36px 40px; display: grid; gap: 28px; }
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.article { max-width: 74ch; display: grid; gap: 18px; }
.article h1 { font-size: clamp(28px, 4.8vw, 40px); font-weight: 700; letter-spacing: -0.01em; }
.article .meta { font-size: 13.5px; color: var(--muted); }
.article .lead { font-size: 18px; color: var(--fg); }
.article p, .article li { color: var(--muted); }
.article p b, .article li b { color: var(--fg); font-weight: 500; }
.article ul, .article ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.article h2 { margin-top: 18px; margin-bottom: 0; }
.article .tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.article .tbl table { min-width: 460px; }
.article .tbl caption { text-align: left; padding: 12px 14px 0; font-size: 13px; color: var(--muted); caption-side: top; }
.article th { position: static; background: var(--surface-2); }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 10px; background: var(--surface); padding: 14px 16px; color: var(--muted); }
.callout b { color: var(--fg); font-weight: 500; }
.cta-box { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.cta-box h2 { font-size: 20px; margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; background: var(--gold); color: var(--gold-ink); text-decoration: none; font: 600 14.5px var(--font-body); padding: 12px 18px; border-radius: 10px; width: fit-content; }
.btn:hover { filter: brightness(1.08); }
.related { display: grid; gap: 14px; }
.related h2 { font-size: 20px; margin: 0; }

/* Rodapé */
.site-footer { border-top: 1px solid var(--line); margin-top: 24px; }
.site-footer .wrap { padding-block: 30px 36px; display: grid; gap: 22px; }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 22px; }
.foot-grid h3 { font: 600 13px var(--font-display); color: var(--fg); margin-bottom: 8px; letter-spacing: .02em; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.foot-grid a { color: var(--muted); text-decoration: none; font-size: 14px; }
.foot-grid a:hover { color: var(--gold); }
.foot-note { color: var(--muted); font-size: 13px; max-width: 80ch; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* CTA do ebook (faixa abaixo do resultado) */
.cta-strip { display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--gold); border-radius: 14px; padding: 22px 24px; margin-bottom: 28px; }
.cta-strip .cs-text { flex: 1 1 360px; min-width: 0; display: grid; gap: 6px; }
.cta-strip .cs-eyebrow { font: 500 12px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.cta-strip strong { font: 600 clamp(18px, 2.6vw, 22px)/1.25 var(--font-display); }
.cta-strip p { color: var(--muted); font-size: 15px; }
.cta-strip p b { color: var(--fg); font-weight: 500; }
.cta-strip .btn { padding: 15px 24px; font-size: 15.5px; }
@media (max-width: 560px) { .cta-strip .btn { width: 100%; } }

/* Banner do ebook (depois da explicação) */
.ebook-card { display: flex; align-items: center; gap: 24px; max-width: 860px; padding: 26px 28px; background: #0F2E22; border: 1px solid var(--line); border-left: 6px solid #C8A24A; border-radius: 12px; text-decoration: none; color: #fff; transition: transform .15s, box-shadow .15s; }
.ebook-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 0, 0, .28); }
.ebook-card:focus-visible { outline: 3px solid #C8A24A; outline-offset: 3px; }
.ebook-card .ec-text { flex: 1; min-width: 0; }
.ebook-card small { display: block; font: 500 .72rem var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: #C8A24A; margin-bottom: 6px; }
.ebook-card strong { display: block; font: 700 1.35rem/1.25 var(--font-display); margin-bottom: 6px; color: #fff; }
.ebook-card p { margin: 0; color: #C9D8CF; font-size: .95rem; line-height: 1.5; }
.ebook-card .ec-btn { flex: 0 0 auto; background: #C8A24A; color: #0F2E22; font: 600 .95rem var(--font-display); padding: 14px 22px; border-radius: 8px; white-space: nowrap; }
@media (max-width: 640px) { .ebook-card { flex-direction: column; align-items: flex-start; gap: 16px; padding: 22px 20px; } .ebook-card .ec-btn { width: 100%; text-align: center; } .ebook-card strong { font-size: 1.2rem; } }

/* Comparador de renda fixa */
.rf-form { display: grid; gap: 20px; }
.rf-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); gap: 16px; }
.rf-prod { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 14px; background: var(--bg); min-width: 0; align-content: start; }
.rf-prod .eyebrow { font-size: 11.5px; }
.rf-prod .inp input, .rf-prod .sel { background: var(--surface); }
.sel { width: 100%; height: 46px; padding: 0 12px; border-radius: 9px; background: var(--bg); color: var(--fg); border: 1px solid var(--line); font: 500 15px var(--font-body); }
.sel:focus-visible { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.seg.wrap3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.seg.wrap3 label { padding: 0 6px; font-size: 12.5px; }
.un { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font: 500 12.5px var(--font-mono); pointer-events: none; white-space: nowrap; }
.inp.suf input { padding-right: 128px; }
.rf-shared { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.rf-assume { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; border-top: 1px solid var(--line); padding-top: 16px; }
.rf-assume .ai { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.rf-assume .inp { flex: 0 0 104px; }
.rf-assume .inp input { height: 38px; font-size: 14px; padding: 0 22px 0 10px; }
.rf-assume .inp .sfx { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); font: 500 12px var(--font-mono); pointer-events: none; }
.rf-src { font-size: 12.5px; color: var(--muted); flex: 1 1 100%; }
.rf-src a { color: var(--accent-2); }
.btn.big { padding: 14px 26px; font-size: 15.5px; border: 0; cursor: pointer; }
#results { display: grid; gap: 18px; scroll-margin-top: 16px; }
.verdict { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 12px; padding: 18px 20px; display: grid; gap: 8px; }
.verdict strong { font: 600 12px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.verdict p { font-size: 16.5px; line-height: 1.6; max-width: 80ch; }
.cmp { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); gap: 16px; }
.ccard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.ccard.win { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.badge { position: absolute; top: 16px; right: 16px; background: var(--gold); color: var(--gold-ink); font: 600 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; padding: 6px 9px; border-radius: 99px; }
.badge.neutral { background: none; color: var(--muted); border: 1px solid var(--line); }
.c-eyebrow { font: 500 11.5px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0; }
.ccard h3 { font-size: 22px; }
.c-rate { color: var(--muted); font-size: 14.5px; margin-top: -6px; }
.c-big { display: grid; gap: 2px; }
.c-big .k { font-size: 13px; color: var(--muted); }
.c-big .v { font: 600 clamp(26px, 5vw, 34px)/1.1 var(--font-mono); font-variant-numeric: tabular-nums; }
.ccard.win .c-big .v { color: var(--gold); }
.c-chips .chip { display: inline-block; border: 1px solid var(--line); border-radius: 99px; padding: 4px 11px; font: 500 12px var(--font-mono); color: var(--accent-2); }
.c-rows { margin: 0; display: grid; }
.c-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.c-rows dt { color: var(--muted); }
.c-rows dd { margin: 0; font: 500 14px var(--font-mono); text-align: right; overflow-wrap: anywhere; }
.bars { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 10px; }
.barrow { display: grid; grid-template-columns: minmax(110px, 190px) 1fr 76px; gap: 12px; align-items: center; font-size: 13.5px; }
.barrow b { font: 500 13.5px var(--font-mono); text-align: right; }
.bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent-2); }
.bar i.g { background: var(--gold); }
.rf-warn { font-size: 13px; color: var(--muted); max-width: 90ch; }
@media (max-width: 560px) { .barrow { grid-template-columns: 1fr 64px; } .barrow .bar { grid-column: 1 / -1; grid-row: 2; } .badge { position: static; justify-self: start; } }
.guide > * { min-width: 0; }
.guide .tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); max-width: 100%; }
.guide .tbl table { min-width: 460px; }
.guide .tbl caption { text-align: left; padding: 12px 14px 0; font-size: 13px; color: var(--muted); caption-side: top; }
.guide th { position: static; background: var(--surface-2); }
.rf-prod { min-width: 0; }
@media (max-width: 760px) { .site-header { position: static; } }
.empty-note { color: var(--muted); font-size: 14px; text-align: center; padding: 90px 16px; margin: 0; }
td.empty-note { padding: 28px 16px; }
