/* Identidade visual extraída de resultadocontabil.com (variáveis :root do site) */
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-display: swap; src: url(/fonts/plus-jakarta-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 500; font-display: swap; src: url(/fonts/plus-jakarta-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url(/fonts/plus-jakarta-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url(/fonts/plus-jakarta-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 800; font-display: swap; src: url(/fonts/plus-jakarta-sans-latin-800-normal.woff2) format("woff2"); }

:root {
  --navy: #1B2A5E; --navy2: #0F1C40; --cyan: #00B4D8; --cyan-d: #0090B0; --cyan-l: #E0F7FD; --cyan-ll: #F0FBFE;
  --bg: #F4F6FA; --white: #fff; --text: #1A1F2E; --muted: #64748B; --border: #E2E8F0;
  --amber: #B45309; --amber-l: #FEF3C7; --green: #059669; --green-l: #ECFDF5; --red: #B91C1C; --red-l: #FEF2F2;
  --wa: #25D366; --r: 14px; --sh: 0 2px 14px rgba(0,0,0,.06); --sh-lg: 0 8px 32px rgba(0,0,0,.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: "Plus Jakarta Sans", system-ui, sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; overflow-x: hidden; }
a { color: var(--cyan-d); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* topo */
.topo { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; padding: 0 5%; box-shadow: 0 1px 8px rgba(0,0,0,.05); }
.topo-in { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 12px; }
.topo-logo img { height: 46px; width: auto; display: block; }
.topo-r { display: flex; gap: 9px; align-items: center; }
.btn-voltar { font-size: 13.5px; font-weight: 600; color: var(--navy); text-decoration: none; padding: 8px 14px; border-radius: 50px; border: 1px solid var(--border); white-space: nowrap; }
.btn-voltar:hover { background: var(--cyan-ll); border-color: var(--cyan); }
.btn-wa { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--wa); color: #fff; padding: 9px 17px; border-radius: 50px; font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; border: 0; }
.btn-wa:hover { background: #1EBE5D; }

/* hero */
.hero { background: var(--navy); padding: 48px 5% 88px; position: relative; overflow: hidden; color: #fff; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 80% 40%, rgba(0,180,216,.22), transparent 60%); pointer-events: none; }
.hero-in { max-width: 1100px; margin: 0 auto; position: relative; }
.tag { display: inline-block; background: rgba(0,180,216,.16); color: #7FE3F5; border: 1px solid rgba(0,180,216,.35); font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 50px; letter-spacing: .02em; }
.hero h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 800; line-height: 1.15; margin: 14px 0 10px; }
.hero p { max-width: 720px; color: rgba(255,255,255,.82); font-size: 15.5px; }
.motor-status { margin-top: 14px; font-size: 13px !important; color: rgba(255,255,255,.7) !important; }
.motor-status.ok::before { content: "● "; color: #34D399; }
.motor-status.off::before { content: "● "; color: #FBBF24; }

/* layout */
.principal { max-width: 1100px; margin: -60px auto 0; padding: 0 5% 48px; position: relative; display: grid; gap: 20px; }
.card { background: #fff; border-radius: var(--r); box-shadow: var(--sh-lg); padding: 28px; border: 1px solid var(--border); }
.card h2 { font-size: 20px; font-weight: 800; color: var(--navy); margin-bottom: 10px; }
.card h3 { font-size: 15px; font-weight: 800; color: var(--navy); margin: 22px 0 8px; }

/* abas */
.abas { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--bg); padding: 6px; border-radius: 50px; margin-bottom: 18px; }
.aba { font: inherit; font-size: 15px; font-weight: 700; border: 0; background: transparent; color: var(--muted); padding: 12px 10px; border-radius: 50px; cursor: pointer; }
.aba.ativa { background: var(--navy); color: #fff; box-shadow: var(--sh); }
.aba:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

.acoes-topo { display: flex; justify-content: flex-end; gap: 16px; margin-bottom: 6px; }
fieldset { border: 0; border-top: 1px solid var(--border); padding: 18px 0 6px; }
fieldset:first-of-type { border-top: 0; padding-top: 4px; }
legend { font-size: 16px; font-weight: 800; color: var(--navy); padding-right: 10px; display: flex; align-items: center; gap: 10px; }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--cyan-l); color: var(--cyan-d); font-size: 13px; }
.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 18px; margin-top: 12px; }
.campo { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.campo-largo { grid-column: 1 / -1; margin-top: 12px; }
label { font-size: 13.5px; font-weight: 700; color: var(--text); }
input, select { font: inherit; font-size: 16px; color: var(--text); background: #fff; border: 1.5px solid var(--border); border-radius: 10px; padding: 11px 12px; width: 100%; min-height: 46px; }
input:focus, select:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px var(--cyan-l); }
input.invalido, select.invalido { border-color: var(--red); background: var(--red-l); }
.dica { font-size: 13px; color: var(--muted); }
.escolhido { font-size: 13px; color: var(--navy); font-weight: 600; min-height: 1em; }
.ajuda { font-size: 13px; color: var(--muted); }
.ajuda summary { cursor: pointer; color: var(--cyan-d); font-weight: 600; list-style: none; display: inline-block; }
.ajuda summary::before { content: "ⓘ "; }
.ajuda summary::-webkit-details-marker { display: none; }
.ajuda p { margin-top: 4px; background: var(--cyan-ll); border-left: 3px solid var(--cyan); padding: 8px 10px; border-radius: 0 8px 8px 0; color: var(--text); }
details.mais { margin-top: 14px; }
details.mais > summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--navy); }

/* autocomplete */
.autocomp { position: relative; }
.autocomp-lista { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); list-style: none; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--sh-lg); max-height: 320px; overflow-y: auto; }
.autocomp-lista li { padding: 10px 12px; font-size: 14px; cursor: pointer; border-bottom: 1px solid var(--bg); }
.autocomp-lista li:last-child { border-bottom: 0; }
.autocomp-lista li[aria-selected="true"], .autocomp-lista li:hover { background: var(--cyan-ll); }
.autocomp-lista li small { display: block; color: var(--muted); font-weight: 600; }

/* classificação */
.class-opcoes { display: grid; gap: 10px; margin-top: 12px; }
.class-op { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.class-op:has(input:checked) { border-color: var(--cyan); background: var(--cyan-ll); }
.class-op input { width: 20px; min-height: 20px; height: 20px; margin-top: 3px; accent-color: var(--cyan-d); flex: none; }
.class-op strong { display: block; font-size: 14.5px; color: var(--navy); }
.class-op span { font-size: 13px; color: var(--muted); }
.class-op .pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 50px; margin-left: 6px; vertical-align: 1px; }
.pill-ok { background: var(--green-l); color: var(--green); }
.pill-conf { background: var(--amber-l); color: var(--amber); }
.class-outras { margin-top: 4px; }
.class-outras select { margin-top: 6px; }

/* avisos */
.aviso { font-size: 14px; border-radius: 10px; padding: 12px 14px; margin-top: 14px; }
.aviso-info { background: var(--cyan-ll); border: 1px solid var(--cyan-l); color: var(--navy); }
.aviso-alerta { background: var(--amber-l); border: 1px solid #FDE68A; color: #78350F; }
.aviso-ok { background: var(--green-l); border: 1px solid #A7F3D0; color: #065F46; }
.erro { background: var(--red-l); border: 1px solid #FECACA; color: var(--red); border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-top: 14px; }
.link-wa { display: inline-block; margin-top: 6px; font-weight: 700; color: #128C3E; }

/* botões */
.acoes { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; align-items: center; }
.btn-cyan, .btn-ghost-navy { font: inherit; font-size: 15px; font-weight: 700; border-radius: 50px; padding: 13px 24px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; }
.btn-cyan { background: var(--cyan); color: #fff; border: 0; }
.btn-cyan:hover { background: var(--cyan-d); }
.btn-cyan[disabled] { opacity: .6; cursor: wait; }
.btn-ghost-navy { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-ghost-navy:hover { background: var(--bg); }
.acoes .btn-wa { font-size: 15px; padding: 13px 22px; min-height: 48px; }
.btn-link { font: inherit; font-size: 13.5px; font-weight: 700; color: var(--cyan-d); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; }
.privacidade { font-size: 12.5px; color: var(--muted); margin-top: 12px; }

/* resultado */
.res-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.res-cab h2 { margin: 0; }
.selo { font-size: 12.5px; font-weight: 800; padding: 6px 12px; border-radius: 50px; }
.selo-motor { background: var(--green-l); color: var(--green); border: 1px solid #A7F3D0; }
.selo-est { background: var(--amber-l); color: var(--amber); border: 1px solid #FDE68A; }
.selo-resumo { background: var(--cyan-l); color: var(--cyan-d); border: 1px solid #BAEAF5; }
.res-total { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.res-total div { background: var(--bg); border-radius: 12px; padding: 14px; }
.res-total span { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.res-total strong { font-size: 22px; font-weight: 800; color: var(--navy); }
.res-total .destaque { background: var(--navy); }
.res-total .destaque span { color: rgba(255,255,255,.75); }
.res-total .destaque strong { color: #fff; }
.tabela-wrap { overflow-x: auto; }
.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 2px solid var(--border); padding: 8px; }
.tabela td { border-bottom: 1px solid var(--border); padding: 10px 8px; vertical-align: top; }
.tabela .dir { text-align: right; white-space: nowrap; }
.tabela td.origem { font-size: 12.5px; color: var(--muted); }
.tabela tr.sub td { color: var(--muted); }
.tabela tr.tot td { font-weight: 800; color: var(--navy); }
.premissas { display: grid; grid-template-columns: minmax(150px, 230px) 1fr; gap: 6px 14px; font-size: 14px; }
.premissas dt { color: var(--muted); font-weight: 600; }
.premissas dd { color: var(--text); word-break: break-word; }
.memoria { margin-top: 18px; font-size: 13px; }
.memoria summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.memoria pre { white-space: pre-wrap; word-break: break-word; background: var(--bg); padding: 10px; border-radius: 8px; font-size: 11.5px; max-height: 360px; overflow: auto; margin-top: 8px; }
.memoria ul { margin: 8px 0 0 18px; }
.nota-legal { font-size: 12.5px; color: var(--muted); margin-top: 16px; }
.print-cab, .print-rodape { display: none; }

/* cadastro */
.campo-largo-2 { grid-column: span 2; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; font-weight: 500; color: var(--text); margin-top: 16px; cursor: pointer; }
.consent input { width: 20px; height: 20px; min-height: 20px; flex: none; margin-top: 2px; accent-color: var(--cyan-d); }
.erro-campo { font-size: 12.5px; color: var(--red); font-weight: 600; }
.ola { font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.ola button { font: inherit; font-size: 13px; background: none; border: 0; color: var(--cyan-d); font-weight: 700; text-decoration: underline; cursor: pointer; }
.principal-texto { margin-top: 24px; max-width: 860px; }
.texto-legal h1 { font-size: 24px; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.texto-legal h2 { font-size: 16px; margin: 20px 0 6px; }
.texto-legal p, .texto-legal li { font-size: 14.5px; margin-bottom: 8px; }
.texto-legal ul { margin-left: 20px; }
@media (max-width: 700px) { .campo-largo-2 { grid-column: auto; } }

/* rodapé */
.rodape { background: var(--navy2); color: rgba(255,255,255,.7); padding: 32px 5%; font-size: 13px; }
.rodape-in { max-width: 1100px; margin: 0 auto; display: grid; gap: 8px; }
.rodape a { color: #fff; }
.rodape-logo { height: 40px; width: auto; filter: brightness(0) invert(1); opacity: .9; }

@media (max-width: 700px) {
  .topo-in { height: 64px; }
  .topo-logo img { height: 38px; }
  .topo-r .btn-wa { display: none; }
  .btn-voltar { font-size: 12.5px; padding: 7px 11px; }
  .btn-voltar::after { content: ""; }
  .card { padding: 18px; }
  .principal { margin-top: -64px; padding: 0 4% 32px; }
  .hero { padding: 32px 5% 84px; }
  .aba { font-size: 13.5px; padding: 11px 6px; }
  .res-total { grid-template-columns: 1fr 1fr; }
  .res-total .destaque { grid-column: 1 / -1; }
  .premissas { grid-template-columns: 1fr; gap: 0 0; }
  .premissas dd { margin-bottom: 8px; }
  .acoes > * { width: 100%; }
  .tabela th:nth-child(4), .tabela td.origem { display: none; }
  .tabela tr.origem-linha td { display: table-cell; font-size: 12px; color: var(--muted); padding-top: 0; }
}
@media (min-width: 701px) { .tabela tr.origem-linha { display: none; } }
@media (max-width: 700px) { .btn-voltar .longo { display: none; } }

/* impressão / PDF */
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; font-size: 11pt; }
  .topo, .hero, #formCard, #cardBaseManual, #cardEstimativa, .rodape, .no-print, .memoria { display: none !important; }
  .principal { margin: 0; padding: 0; max-width: none; display: block; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .print-cab { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--navy); padding-bottom: 8px; margin-bottom: 14px; }
  .print-cab img { height: 48px; width: auto; }
  .print-cab div { text-align: right; font-size: 10pt; color: var(--muted); }
  .print-cab span { display: block; }
  .print-cab strong { display: block; color: var(--navy); font-size: 13pt; }
  .print-rodape { display: block; border-top: 1px solid var(--border); margin-top: 14px; padding-top: 6px; font-size: 9pt; color: var(--muted); }
  .res-total div, .res-total .destaque { background: #fff !important; border: 1px solid var(--border); }
  .res-total .destaque span, .res-total .destaque strong { color: var(--navy) !important; }
  .res-total { grid-template-columns: repeat(3, 1fr) !important; }
  .res-total .destaque { grid-column: auto !important; }
  .tabela th:nth-child(4), .tabela td.origem { display: table-cell !important; }
  .tabela tr.origem-linha { display: none !important; }
  .premissas { grid-template-columns: 200px 1fr !important; }
  .selo { border: 1.5px solid currentColor; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table, dl, .res-total { break-inside: avoid; }
  body { font-size: 9.5pt; line-height: 1.4; }
  .card h2 { font-size: 14pt; }
  .card h3 { margin: 10px 0 4px; font-size: 11pt; }
  .res-total { margin: 10px 0; gap: 8px; }
  .res-total div { padding: 8px 10px; }
  .res-total strong { font-size: 15pt; }
  .tabela { font-size: 9pt; }
  .tabela td { padding: 5px 6px; }
  .tabela th { padding: 4px 6px; }
  .tabela td:first-child { white-space: nowrap; }
  .tabela td.origem { font-size: 8pt; }
  .premissas { font-size: 9pt; gap: 2px 12px; }
  .aviso { padding: 8px 10px; font-size: 9pt; margin-top: 8px; }
  .nota-legal { font-size: 8.5pt; margin-top: 10px; }
}
