/* Conceito: linguagem visual de produto da Apple (tipografia do sistema, faixas largas, botões em pílula, listas agrupadas). Duas telas: formulário e análise. Azul = alugar e investir, laranja = comprar. */
:root {
  --bg: #ffffff; --bg2: #f5f5f7; --cardA: #f5f5f7; --cardB: #ffffff; --soft: #f5f5f7; --surf: #ffffff;
  --ink: #1d1d1f; --ink2: #424245; --mute: #6e6e73; --line: #d2d2d7; --sep: rgba(0, 0, 0, .12);
  --blue: #0071e3; --blue-h: #0077ed; --link: #0066cc; --rent: #0071e3; --buy: #ff9500; --optA: #5856d6; --optB: #30b0c7;
  --rent-tint: rgba(0, 113, 227, .12); --buy-tint: rgba(255, 149, 0, .17); --nav: rgba(255, 255, 255, .72); --seg: rgba(118, 118, 128, .12); --segsel: #ffffff;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #000000; --bg2: #161617; --cardA: #1d1d1f; --cardB: #2c2c2e; --soft: #1d1d1f; --surf: #000000;
  --ink: #f5f5f7; --ink2: #d2d2d7; --mute: #a1a1a6; --line: #424245; --sep: rgba(255, 255, 255, .16);
  --blue: #0071e3; --blue-h: #0a84ff; --link: #2997ff; --rent: #2997ff; --buy: #ff9f0a; --optA: #7d7aff; --optB: #40cbe0;
  --rent-tint: rgba(41, 151, 255, .2); --buy-tint: rgba(255, 159, 10, .22); --nav: rgba(22, 22, 23, .72); --seg: rgba(118, 118, 128, .24); --segsel: #636366; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #000000; --bg2: #161617; --cardA: #1d1d1f; --cardB: #2c2c2e; --soft: #1d1d1f; --surf: #000000;
  --ink: #f5f5f7; --ink2: #d2d2d7; --mute: #a1a1a6; --line: #424245; --sep: rgba(255, 255, 255, .16);
  --blue: #0071e3; --blue-h: #0a84ff; --link: #2997ff; --rent: #2997ff; --buy: #ff9f0a; --optA: #7d7aff; --optB: #40cbe0;
  --rent-tint: rgba(41, 151, 255, .2); --buy-tint: rgba(255, 159, 10, .22); --nav: rgba(22, 22, 23, .72); --seg: rgba(118, 118, 128, .24); --segsel: #636366; color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.47; letter-spacing: -.01em; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body[data-view="form"] { background: var(--bg2); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; color: var(--mute); }
b, strong { color: var(--ink); font-weight: 600; }
a { color: var(--link); text-underline-offset: 2px; }
.nw { white-space: nowrap; }
button { font-family: inherit; }
:focus-visible { outline: 4px solid rgba(0, 113, 227, .45); outline-offset: 2px; }

/* barra de navegação */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: var(--nav); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--sep); }
.nav-in { max-width: 980px; margin-inline: auto; min-height: 48px; padding: 6px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; text-decoration: none; }
.nav-r { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; flex: 1; }
body[data-view="analysis"] .brand { display: none; }
body[data-view="analysis"] .nav-r { justify-content: space-between; }
.live { display: inline-flex; align-items: center; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .btn { flex: none; }
.nav-act { display: flex; align-items: center; gap: 8px; flex: none; }
.iconbtn { flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--seg); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .2s ease; }
.iconbtn:hover { background: var(--line); }
.iconbtn svg { display: block; }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 980px; background: var(--blue); color: #fff; cursor: pointer; font-size: 17px; line-height: 1.18; padding: 12px 24px; transition: background .2s ease; }
.btn:hover { background: var(--blue-h); }
.btn:active { transform: scale(.985); }
.btn.sm { font-size: 13px; padding: 5px 12px; }
.btn.lg { min-width: 240px; padding: 14px 30px; }
.linkbtn { font: inherit; background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font-size: 14px; text-align: left; }
.linkbtn:hover { text-decoration: underline; }

/* tela do formulário */
.page { max-width: 692px; margin-inline: auto; padding: 44px 20px 72px; display: flex; flex-direction: column; gap: 24px; }
.landing { text-align: center; display: flex; flex-direction: column; gap: 14px; padding-block: 12px 8px; }
.landing h1 { font-size: clamp(38px, 11vw, 56px); font-weight: 600; letter-spacing: -.028em; line-height: 1.07; }
.landing .sub { font-size: clamp(19px, 5.2vw, 24px); line-height: 1.25; letter-spacing: -.012em; color: var(--mute); }
.gt { font-size: 13px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--mute); margin: 18px 16px 8px; }
.group { background: var(--bg); border-radius: 18px; overflow: hidden; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 42%); align-items: center; gap: 2px 14px; padding: 12px 16px; transition: background .15s ease; }
.row:not([hidden]) ~ .row:not([hidden]) { border-top: 1px solid var(--sep); }   /* separador só entre linhas visíveis */
.row:focus-within { background: color-mix(in srgb, var(--blue) 7%, transparent); }
.row .lab { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row label, .row .lbl { font-size: 17px; color: var(--ink); line-height: 1.25; }
.row small { font-size: 13px; line-height: 1.35; color: var(--mute); }
.row .inp { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.row .inp span { color: var(--mute); white-space: nowrap; }
.row .inp input + span { min-width: 3em; }
.row .inp input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; outline: none; font: inherit; font-size: 17px; font-weight: 500; color: var(--ink); text-align: right; padding: 6px 0; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
@supports (field-sizing: content) { .row .inp input { field-sizing: content; flex: 0 1 auto; width: auto; min-width: 1.5ch; max-width: 100%; } }
.row.block { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.switch { position: relative; flex: none; width: 51px; height: 31px; padding: 0; border: 0; border-radius: 999px; background: var(--seg); cursor: pointer; transition: background .2s ease; }
.switch span { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .2s ease; }
.switch[aria-checked="true"] { background: var(--blue); }
.switch[aria-checked="true"] span { transform: translateX(20px); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--seg); border-radius: 10px; padding: 2px; }
.seg .chip { border: 0; background: transparent; color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.25; padding: 8px 6px; border-radius: 8px; cursor: pointer; text-align: center; }
.seg .chip small { display: block; font-size: 12px; font-weight: 400; color: var(--mute); }
.seg .chip[aria-pressed="true"] { background: var(--segsel); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); font-weight: 600; }
.cash { font-size: 14px; line-height: 1.4; color: var(--mute); padding-inline: 16px; }
.cash b { color: var(--ink); }
.cta { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 8px; }
.msg { min-height: 20px; font-size: 14px; color: #d70015; text-align: center; }

/* tela da análise */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
#view-analysis.enter { animation: rise .55s cubic-bezier(.28, .11, .32, 1) both; }
.tela { padding: 64px 20px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.tela > * { width: 100%; max-width: 692px; margin-inline: auto; min-width: 0; }
.tela { background: var(--bg); --soft: var(--cardA); }
.tela[data-band="b"] { background: var(--bg2); --soft: var(--cardB); }   /* faixas alternadas, definidas pelo script entre as seções visíveis */
.eyebrow { font-size: 14px; font-weight: 600; letter-spacing: -.005em; color: var(--mute); }
.tela h1 { font-size: clamp(36px, 10.5vw, 56px); font-weight: 600; letter-spacing: -.028em; line-height: 1.07; }
.tela h2 { font-size: clamp(30px, 8.6vw, 44px); font-weight: 600; letter-spacing: -.024em; line-height: 1.1; }
.tela h3 { font-size: 21px; font-weight: 600; letter-spacing: -.012em; line-height: 1.2; }
.lead { font-size: clamp(19px, 5.4vw, 24px); font-weight: 500; line-height: 1.3; letter-spacing: -.012em; color: var(--ink2); margin-block: 0; }
.lead .nw, .lead b { color: var(--ink); font-weight: 600; }
.note { font-size: 14px; line-height: 1.4; color: var(--mute); }
.rule { border: 0; border-top: 1px solid var(--sep); margin-block: 0; }
.big { font-weight: 600; letter-spacing: -.025em; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: baseline; flex: none; }
.dot.rent { background: var(--rent); } .dot.buy { background: var(--buy); } .dot.optA { background: var(--optA); } .dot.optB { background: var(--optB); }
.warn { background: var(--soft); border-radius: 18px; padding: 16px 18px; font-size: 15px; line-height: 1.4; display: flex; flex-direction: column; gap: 4px; color: var(--ink2); }
.warn b { font-size: 15px; }
.warn:empty { display: none; }

/* gráficos e leituras */
.chart { width: 100%; height: auto; display: block; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart text { font-family: var(--font); fill: var(--mute); font-size: 11px; }
.chart text.t-ink { fill: var(--ink); font-weight: 600; font-size: 11.5px; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.chart text.t-ink2 { fill: var(--ink2); font-size: 11px; }
.chart .grid line { stroke: var(--sep); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px 18px; font-size: 14px; color: var(--ink2); }
.legend span { display: inline-flex; align-items: center; }
.readout { min-height: 52px; background: var(--soft); border-radius: 16px; padding: 12px 16px; font-size: 14px; color: var(--ink2); display: flex; flex-wrap: wrap; gap: 3px 16px; align-items: center; font-variant-numeric: tabular-nums; }
.readout .when { flex-basis: 100%; font-weight: 600; color: var(--ink); font-size: 14px; }
.se { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.se > div { background: var(--soft); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.se .k { font-size: 14px; font-weight: 600; color: var(--ink2); display: flex; align-items: center; }
.se .row2 { display: flex; flex-direction: column; }
.se .row2 small { font-size: 12px; color: var(--mute); }
.se .row2 b { font-size: clamp(15px, 4.5vw, 19px); line-height: 1.15; font-weight: 600; letter-spacing: -.02em; }
.tiles { display: grid; gap: 12px; }
.tile { background: var(--soft); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.tile .k { font-size: 14px; font-weight: 600; color: var(--mute); }
.tile .v { font-size: clamp(30px, 8.6vw, 40px); line-height: 1.1; color: var(--ink); }
.tile p { font-size: 15px; line-height: 1.4; }

/* cartões e listas */
.pair { display: grid; gap: 12px; }
.card { background: var(--soft); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card h3 { display: flex; align-items: center; }
.card ul { margin: 0; padding-left: 20px; color: var(--ink2); display: flex; flex-direction: column; gap: 8px; font-size: 16px; line-height: 1.4; }
.facts { display: grid; grid-template-columns: 1fr; margin-block: 0; background: var(--soft); border-radius: 20px; padding: 4px 18px; }
.facts div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 13px 0; border-top: 1px solid var(--sep); }
.facts div:first-child { border-top: 0; }
.facts dt { color: var(--ink2); } .facts dd { margin: 0; font-weight: 600; font-size: 19px; text-align: right; letter-spacing: -.015em; }
.facts dd small { display: block; font-weight: 400; font-size: 13px; color: var(--mute); letter-spacing: 0; }
.steps { margin-block: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.steps li { background: var(--soft); border-radius: 18px; padding: 16px 18px; color: var(--ink2); font-size: 17px; line-height: 1.4; }
.assump { margin-block: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.45; color: var(--ink2); }
.src { font-size: 14px; display: flex; flex-direction: column; gap: 6px; margin-block: 0; padding-left: 20px; color: var(--ink2); }

/* tabelas, barras, custo, veredito */
.wrap-x { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 10px 6px; border-bottom: 1px solid var(--sep); text-align: right; font-weight: 400; white-space: nowrap; }
.tbl th:first-child { text-align: left; color: var(--ink2); }
.tbl tbody th:first-child { white-space: normal; line-height: 1.3; font-weight: 500; color: var(--ink); }
.tbl thead th { font-size: 13px; color: var(--mute); font-weight: 500; vertical-align: bottom; white-space: normal; }
.tbl.cmp td { white-space: normal; font-size: 14px; }
.tbl.hz td { white-space: normal; text-align: center; font-size: 14px; }
.tbl.hz td.w-rent { background: var(--rent-tint); } .tbl.hz td.w-buy { background: var(--buy-tint); } .tbl.hz td.w-eq { background: var(--soft); }
.tbl.hz td b { display: block; font-size: 13px; } .tbl.hz td span { display: block; }
.tbl.hz thead th { text-align: center; } .tbl.hz thead th:first-child { text-align: left; }
.tbl.hz tbody th small { display: block; font-weight: 400; color: var(--mute); font-size: 12px; }
.bgroup { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.bgroup + .bgroup { border-top: 1px solid var(--sep); padding-top: 16px; }
.bhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bhead b { font-size: 16px; } .bhead span { font-size: 14px; color: var(--ink2); }
.brow { display: grid; grid-template-columns: 112px 1fr; gap: 8px; align-items: center; font-size: 14px; color: var(--ink2); }
.btrack { position: relative; height: 28px; }
.bfill { min-width: max-content; height: 100%; border-radius: 8px; display: flex; align-items: center; justify-content: flex-end; padding-inline: 10px; font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bfill.rent { background: var(--rent); } .bfill.buy { background: var(--buy); color: #1d1d1f; }
.ledger { list-style: none; padding: 4px 18px; margin-block: 0; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; background: var(--soft); border-radius: 20px; }
.ledger li { display: flex; justify-content: space-between; gap: 14px; padding: 13px 0; border-top: 1px solid var(--sep); color: var(--ink2); font-size: 16px; }
.ledger li:first-child { border-top: 0; }
.ledger li b { white-space: nowrap; }
.ledger li.tot { border-top: 2px solid var(--ink); margin-top: 2px; padding-top: 14px; color: var(--ink); font-weight: 600; }
.ledger li.tot b { font-size: 26px; letter-spacing: -.02em; }
.vs { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--soft); border-radius: 18px; padding: 16px 18px; color: var(--ink2); }
.vs b { font-size: 24px; letter-spacing: -.02em; }
.verdict { border-radius: 20px; padding: 18px 20px; display: flex; flex-direction: column; gap: 3px; background: var(--rent-tint); }
.verdict.buy { background: var(--buy-tint); } .verdict.tie { background: var(--soft); }
.verdict .head { font-weight: 600; font-size: 24px; letter-spacing: -.02em; color: var(--ink); line-height: 1.15; }
.verdict p { font-size: 15px; color: var(--ink2); }
.verdict .fin { margin-top: 4px; color: var(--ink); }
.eqs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.eqs div { background: var(--soft); border-radius: 16px; padding: 12px 4px; }
.eqs div span { display: block; font-size: 12px; color: var(--mute); }
.eqs div b { font-size: 18px; white-space: nowrap; letter-spacing: -.015em; }
@media (min-width: 560px) { .pair { grid-template-columns: 1fr 1fr; } .tiles { grid-template-columns: 1fr 1fr; } }
/* conteúdo abaixo do formulário, rodapé e páginas de apoio */
.guia { display: flex; flex-direction: column; gap: 14px; padding-inline: 16px; font-size: 17px; line-height: 1.5; color: var(--ink2); }
.guia h2 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; color: var(--ink); margin-top: 16px; }
.guia h3 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; color: var(--ink); margin-top: 8px; }
.guia p, .guia li { color: var(--ink2); }
.guia ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.guia b { color: var(--ink); }
.rodape { max-width: 692px; margin-inline: auto; padding: 32px 20px 48px; border-top: 1px solid var(--sep); display: flex; flex-direction: column; gap: 12px; font-size: 14px; line-height: 1.4; color: var(--mute); }
.rodape nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.rodape p { font-size: 13px; }
@media (prefers-reduced-motion: reduce) { #view-analysis.enter { animation: none; } .btn, .switch, .switch span { transition: none; } }
