/* Hub Átrio — casca das calculadoras (identidade void + warm gold do site)
   Tema claro disponível via html[data-theme="light"] (toggle injetado pelo hub.js). */
:root {
    --void: #08080A; --void-light: #0F0F12; --void-card: #141418;
    --void-elevated: #1A1A1F; --void-border: #2A2A30;
    --accent: #C4956A; --accent-light: #D4AD86; --accent-muted: #A77A62; --accent-dark: #6B4D3C;
    --accent-glow: rgba(196,149,106,0.12);
    --text: #F2EDE9; --sec: #A0A0A5; --muted: #7A7A82;
    --success: #4ADE80; --danger: #EF4444;
    --font-heading: 'Sora', sans-serif; --font-body: 'Manrope', sans-serif;
    --font-data: 'Space Grotesk', monospace; --font-wordmark: 'Josefin Sans', sans-serif;
}
html[data-theme="light"] {
    --void: #FAF7F2; --void-light: #F2EDE5; --void-card: #FFFFFF;
    --void-elevated: #F5EFE7; --void-border: #E6DDD1;
    --text: #27211C; --sec: #56504A; --muted: #857C72;
    --accent-glow: rgba(196, 149, 106, 0.14);
}
html[data-theme="light"] .winner { background: linear-gradient(180deg, rgba(196,149,106,0.10), transparent); }
html[data-theme="light"] .btn-main, html[data-theme="light"] .gate-form button { color: #F5F0EB; }
html[data-theme="light"] .thermo-dot { background: #27211C; border-color: #FFF; }

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; background: var(--void); }
body { font-family: var(--font-body); background: var(--void); color: var(--text); line-height: 1.7; -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
.container { max-width: 980px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }

/* topo — fixo no scroll, com blur (mesma linguagem da nav do site) */
.hub-top {
    position: sticky; top: 0; z-index: 200;
    padding: 14px 0;
    border-bottom: 1px solid var(--void-border);
    background: rgba(8, 8, 10, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
html[data-theme="light"] .hub-top { background: rgba(250, 247, 242, 0.86); }
.hub-top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hub-brand { display: flex; align-items: center; gap: 10px; }
.hub-brand svg { width: 26px; height: 28px; }
.hub-wordmark { font-family: var(--font-wordmark); font-size: 1.05rem; font-weight: 300; letter-spacing: 0.32em;
    background: linear-gradient(135deg, #9A7B5A, #DCC9AD, #9A7B5A); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hub-back { font-size: 0.8rem; font-weight: 600; color: var(--sec); padding: 9px 16px; border: 1px solid var(--void-border); border-radius: 6px; transition: all .3s ease; white-space: nowrap; }
.hub-back:hover { border-color: var(--accent); color: var(--text); }
.hub-top-acoes { display: flex; align-items: center; gap: 8px; }
.theme-toggle { width: 40px; height: 38px; display: flex; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--void-border); border-radius: 6px; color: var(--sec); cursor: pointer; font-size: 1rem; transition: all .3s ease; }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* hero da ferramenta */
.tool-hero { padding: clamp(40px, 7vw, 72px) 0 8px; text-align: center; }
.tool-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.tool-hero h1 { font-family: var(--font-heading); font-size: clamp(1.6rem, 4.5vw, 2.5rem); font-weight: 600; line-height: 1.2; color: var(--text); text-wrap: balance; margin-bottom: 14px; }
.tool-hero h1 strong { color: var(--accent); }
.tool-sub { color: var(--sec); font-size: clamp(0.92rem, 1.6vw, 1rem); max-width: 560px; margin: 0 auto; text-wrap: balance; }

/* calculadora */
.calc { padding: clamp(28px, 5vw, 48px) 0 clamp(48px, 7vw, 72px); }
.calc-grid { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.calc-form, .calc-result { background: var(--void-card); border: 1px solid var(--void-border); border-radius: 16px; padding: clamp(22px, 3.5vw, 32px); min-width: 0; }
.calc-result { overflow-x: auto; }
.r-table td:first-child { overflow-wrap: break-word; }  /* rótulos quebram */
.r-table td.num { white-space: nowrap; }                /* números, nunca */
.calc-form h2, .calc-result h2 { font-family: var(--font-heading); font-size: 0.95rem; font-weight: 600; color: var(--accent); margin-bottom: 18px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.74rem; font-weight: 600; color: var(--sec); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.field input, .field select { width: 100%; padding: 12px 14px; background: var(--void-elevated); border: 1px solid var(--void-border); border-radius: 10px; color: var(--text); font-family: var(--font-body); font-size: 16px; outline: none; transition: border-color .2s; }
.field input:focus, .field select:focus { border-color: var(--accent); }
.field .hint { font-size: 0.72rem; color: var(--muted); margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 10px 0; }
.toggle input { width: auto; accent-color: var(--accent); transform: scale(1.25); }
.toggle span { font-size: 0.85rem; color: var(--sec); }

/* resultado */
.winner { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 18px; border: 1px solid rgba(196,149,106,0.35); border-radius: 12px; background: linear-gradient(180deg, rgba(196,149,106,0.08), transparent); margin-bottom: 18px; }
.winner .w-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-muted); }
.winner .w-value { font-family: var(--font-data); font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 700; color: var(--accent); }
.winner .w-note { font-size: 0.78rem; color: var(--sec); width: 100%; }
.r-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.r-table th { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--void-border); }
.r-table th:first-child, .r-table td:first-child { text-align: left; }
.r-table td { padding: 9px 10px; border-bottom: 1px solid var(--void-border); color: var(--sec); text-align: right; }
.r-table td.num { font-family: var(--font-data); color: var(--text); }
.r-table tr.total td { color: var(--accent); font-weight: 700; border-bottom: none; }
.r-foot { font-size: 0.72rem; color: var(--muted); margin-top: 14px; line-height: 1.6; }

/* soft gate */
.gate { margin-top: 22px; border: 1px dashed rgba(196,149,106,0.4); border-radius: 14px; padding: 20px; }
.gate h3 { font-family: var(--font-heading); font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.gate p { font-size: 0.8rem; color: var(--sec); margin-bottom: 14px; }
.gate-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gate-form input { padding: 11px 13px; background: var(--void-elevated); border: 1px solid var(--void-border); border-radius: 9px; color: var(--text); font-size: 16px; outline: none; min-width: 0; width: 100%; }
.gate-form input:focus { border-color: var(--accent); }
.gate-form button { padding: 11px 22px; background: linear-gradient(135deg, var(--accent-dark), var(--accent-muted)); color: #F5F0EB; border: none; border-radius: 9px; font-weight: 700; font-size: 0.85rem; cursor: pointer; transition: all .3s; white-space: nowrap; }
.gate-form button:hover { background: var(--accent); }
.gate-form button:disabled { opacity: 0.5; cursor: wait; }
.gate-ok { display: none; color: var(--success); font-size: 0.85rem; font-weight: 600; }
.gate-priv { font-size: 0.68rem; color: var(--muted); margin-top: 8px; }
.hp { position: absolute; left: -9999px; opacity: 0; }

/* conteúdo SEO + FAQ */
.tool-content { padding: clamp(40px, 6vw, 64px) 0; border-top: 1px solid var(--void-border); background: var(--void-light); }
.tool-content .prose { max-width: 720px; margin: 0 auto; }
.prose h2 { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 600; color: var(--text); margin: 28px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { font-size: 0.92rem; color: var(--sec); }
.prose ul { padding-left: 20px; margin: 8px 0; }
.prose strong { color: var(--text); }
.faq-item { border-bottom: 1px solid var(--void-border); }
.faq-q { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 0; background: none; border: none; color: var(--text); font-family: var(--font-body); font-size: 0.95rem; font-weight: 500; cursor: pointer; text-align: left; min-height: 48px; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.faq-a div { padding-bottom: 16px; font-size: 0.88rem; color: var(--sec); }
.faq-item.open .faq-a { max-height: 400px; }
.faq-ico { color: var(--muted); transition: transform .3s; }
.faq-item.open .faq-ico { transform: rotate(45deg); color: var(--accent); }

/* CTA final + rodapé */
.tool-cta { text-align: center; padding: clamp(44px, 7vw, 72px) 0; }
.tool-cta h2 { font-family: var(--font-heading); font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 600; color: var(--text); margin-bottom: 10px; text-wrap: balance; }
.tool-cta p { color: var(--sec); font-size: 0.92rem; max-width: 460px; margin: 0 auto 24px; }
.btn-main { display: inline-block; padding: 15px 38px; background: linear-gradient(135deg, var(--accent-dark), var(--accent-muted)); color: #F5F0EB; border-radius: 9px; font-weight: 700; font-size: 0.92rem; transition: all .3s; }
.btn-main:hover { background: var(--accent); transform: translateY(-2px); }
.hub-foot { padding: 26px 0; border-top: 1px solid var(--void-border); text-align: center; font-size: 0.74rem; color: var(--muted); }
.hub-foot a { color: var(--accent-muted); }

/* aviso de planejamento (transição 2025) */
.aviso { display: flex; gap: 12px; align-items: flex-start; background: linear-gradient(180deg, rgba(196,149,106,0.10), rgba(196,149,106,0.04));
    border: 1px solid rgba(196,149,106,0.35); border-left: 3px solid var(--accent); border-radius: 12px;
    padding: 14px 18px; margin: 0 0 24px; font-size: 0.85rem; color: var(--sec); line-height: 1.6; }
.aviso strong { color: var(--accent); }

/* fontes dinâmicas (dividendos) — card em 2 linhas: nome + remover / valor + meses */
.fonte-row {
    display: grid;
    grid-template-columns: 1fr 48px 42px;
    grid-template-areas: "nome nome x" "valor meses meses";
    gap: 10px 8px;
    align-items: end;
    background: var(--void-elevated);
    border: 1px solid var(--void-border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}
.fonte-row .field { margin-bottom: 0; }
.fonte-row .field input { background: var(--void-card); }
.fonte-row .f-nome { grid-area: nome; }
.fonte-row .f-valor { grid-area: valor; }
.fonte-row .f-meses { grid-area: meses; }
.fonte-row .f-x { grid-area: x; height: 46px; background: transparent; border: 1px solid var(--void-border); border-radius: 9px; color: var(--muted); cursor: pointer; font-size: 1rem; }
.fonte-row .f-x:hover { border-color: var(--danger); color: var(--danger); }
.btn-add { width: 100%; padding: 11px; background: transparent; border: 1px dashed var(--void-border); border-radius: 9px; color: var(--accent-muted); font-family: var(--font-body); font-weight: 600; font-size: 0.82rem; cursor: pointer; transition: all .3s; }
.btn-add:hover { border-color: var(--accent); color: var(--accent); }
.fonte-tag { font-size: 0.66rem; font-weight: 700; padding: 2px 9px; border-radius: 100px; }
.fonte-tag.sim { background: rgba(239,68,68,0.12); color: var(--danger); }
.fonte-tag.nao { background: rgba(74,222,128,0.10); color: var(--success); }

/* termômetro fiscal (IRPFM) */
.thermo { margin: 16px 0 6px; }
.thermo-bar { position: relative; height: 10px; border-radius: 100px; overflow: visible;
    background: linear-gradient(90deg, rgba(74,222,128,0.55) 0 33.3%, rgba(196,149,106,0.65) 33.3% 66.6%, rgba(239,68,68,0.6) 66.6% 100%); }
.thermo-dot { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 18px; height: 18px; border-radius: 50%;
    background: var(--text); border: 3px solid var(--void-card); box-shadow: 0 0 10px rgba(0,0,0,0.6); transition: left .4s ease; }
.thermo-labels { display: flex; justify-content: space-between; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-top: 7px; }

/* seção avançada (redutor) */
details.adv { margin-top: 22px; border: 1px solid var(--void-border); border-radius: 14px; background: var(--void-card); }
details.adv summary { cursor: pointer; padding: 16px 20px; font-family: var(--font-heading); font-size: 0.92rem; font-weight: 600; color: var(--accent); list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv summary::after { content: '+'; color: var(--muted); font-size: 1.2rem; transition: transform .3s; }
details.adv[open] summary::after { transform: rotate(45deg); color: var(--accent); }
details.adv .adv-body { padding: 0 20px 20px; }
.adv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.num-neg { color: var(--danger) !important; }
.num-pos { color: var(--success) !important; }

/* hub index (cards) */
.tools-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; padding-bottom: clamp(48px, 7vw, 80px); }
.tool-card { background: var(--void-card); border: 1px solid var(--void-border); border-radius: 16px; padding: 28px; transition: all .4s ease; display: flex; flex-direction: column; }
.tool-card:hover { border-color: rgba(196,149,106,0.35); transform: translateY(-3px); }
.tool-card .t-tag { align-self: flex-start; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-muted); background: var(--accent-glow); border-radius: 100px; padding: 4px 12px; margin-bottom: 14px; }
.tool-card h3 { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.tool-card p { font-size: 0.85rem; color: var(--sec); flex: 1; margin-bottom: 16px; }
.tool-card .t-go { font-size: 0.82rem; font-weight: 700; color: var(--accent); }

/* responsivo */
@media (max-width: 860px) {
    .calc-grid { grid-template-columns: 1fr; }
    .gate-form { grid-template-columns: 1fr; }
    .tools-grid { grid-template-columns: 1fr; }
    .adv-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
