:root {
  /* paleta da capa */
  --blue: #0a47a6;
  --blue-dark: #063a8a;
  --blue-deep: #05408f;
  --blue-light: #0a55b5;
  --blue-soft: #e6eefb;
  --navy: #0b2a5b;
  --yellow: #ffd60a;
  --yellow-dark: #f0c400;
  --yellow-soft: #fff6c7;
  --bg: #f3f6fc;
  --card: #ffffff;
  --text: #0f1b2d;
  --muted: #56667e;
  --line: #d9e1ee;
  --error: #c2410c;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(11, 42, 91, 0.06), 0 8px 24px rgba(11, 42, 91, 0.08);
  --rounded: ui-rounded, 'SF Pro Rounded', Nunito, 'Arial Rounded MT Bold', 'Hiragino Maru Gothic ProN', system-ui, sans-serif;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
img { max-width: 100%; }

/* ---------- topo das telas internas ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: linear-gradient(180deg, var(--blue-deep), var(--blue));
  box-shadow: 0 2px 12px rgba(5, 64, 143, 0.25);
}
.back {
  width: 44px; height: 44px; margin-left: -10px;
  display: grid; place-items: center;
  border: 0; border-radius: 12px; background: transparent; color: #fff; cursor: pointer;
}
.back svg { width: 26px; height: 26px; stroke-width: 2.4; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 46px; width: auto; display: block; }

/* ---------- tela inicial (capa) ---------- */
.home {
  background: linear-gradient(180deg, var(--blue-deep) 0%, var(--blue) 55%, var(--blue-light) 100%);
  color: #fff;
  padding-top: env(safe-area-inset-top, 0px);
  overflow: hidden;
}
.home-inner { max-width: 520px; margin: 0 auto; padding: 22px 20px 8px; text-align: center; }
.home-logo { width: min(300px, 78vw); height: auto; display: block; margin: 0 auto 22px; }
.home-title {
  font-family: var(--rounded);
  font-size: clamp(30px, 9vw, 40px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.6px;
  margin: 0 0 26px;
  text-shadow: 0 2px 10px rgba(0, 20, 60, 0.18);
}
.home-title em { font-style: normal; color: var(--yellow); display: block; }
.cta-yellow {
  display: flex; align-items: center; gap: 14px;
  min-height: 82px; padding: 14px 22px 14px 24px;
  border-radius: 99px;
  background: linear-gradient(180deg, #ffe14a, var(--yellow) 60%, var(--yellow-dark));
  color: var(--navy); text-decoration: none; text-align: left;
  box-shadow: 0 10px 26px rgba(0, 18, 60, 0.32), inset 0 -3px 0 rgba(0, 0, 0, 0.06);
  transition: transform 0.15s;
}
.cta-yellow:active { transform: scale(0.98); }
.cta-icon svg { width: 40px; height: 40px; stroke-width: 2.2; display: block; }
.cta-icon .dots { stroke-width: 3.2; }
.cta-sep { width: 2px; align-self: stretch; margin: 6px 0; background: rgba(11, 42, 91, 0.35); border-radius: 2px; }
.cta-text { flex: 1; font-family: var(--rounded); font-size: 23px; font-weight: 800; line-height: 1.12; letter-spacing: -0.3px; }
.cta-chev { width: 26px; height: 26px; stroke-width: 3; flex: none; }
.home-note { margin: 16px 0 0; font-size: 15px; font-weight: 600; line-height: 1.4; }
.swoosh { display: block; width: 120px; height: 10px; margin: 6px auto 0; stroke: var(--yellow); stroke-width: 4; }
.seals { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); margin: 22px 0 0; padding: 0; }
.seals li { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 6px; font-family: var(--rounded); font-size: 15px; font-weight: 700; line-height: 1.15; }
.seals li + li { border-left: 2px solid rgba(255, 255, 255, 0.55); }
.seals svg { width: 40px; height: 40px; stroke: #fff; stroke-width: 1.9; }
.home-photo { position: relative; max-width: 620px; margin: 6px auto 0; }
.home-photo img {
  display: block; width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 22%);
}
.wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 46px; display: block; stroke: none; }

/* ---------- layout das telas internas ---------- */
main { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: 16px 16px 32px; }
body.is-home main { display: none; }
.screen { animation: enter 0.25s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }

h2 { font-family: var(--rounded); font-size: 25px; line-height: 1.2; letter-spacing: -0.4px; margin: 4px 0 20px; color: var(--navy); }
.step { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.4px; color: var(--blue); text-transform: uppercase; }

/* ---------- escolha das funções ---------- */
.choices { display: grid; gap: 12px; }
.choice {
  display: flex; align-items: center; gap: 14px;
  min-height: 96px; padding: 18px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.choice:active { transform: scale(0.985); border-color: var(--yellow); }
.choice > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.choice strong { font-family: var(--rounded); font-size: 19px; letter-spacing: -0.2px; color: var(--navy); }
.choice small { font-size: 14px; color: var(--muted); line-height: 1.35; }
.choice-icon { flex: none; width: 54px; height: 54px; border-radius: 16px; background: var(--blue); color: #fff; display: grid; place-items: center; }
.choice-icon.yellow { background: var(--yellow); color: var(--navy); }
.choice-icon svg { width: 30px; height: 30px; }
.chev { width: 22px; height: 22px; color: var(--blue); flex: none; }

/* ---------- formulário ---------- */
.field { border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
.field legend, .field > label { display: block; font-size: 15px; font-weight: 700; margin-bottom: 10px; padding: 0; color: var(--navy); }
.opt { font-weight: 400; color: var(--muted); }
.hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.hint:empty { display: none; }
.error { margin: 8px 0 0; font-size: 14px; color: var(--error); font-weight: 600; }
.error:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-col { flex-direction: column; }
.chip {
  min-height: 50px; padding: 12px 16px; flex: 1 1 auto;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--card);
  font: inherit; font-size: 16px; font-weight: 600; color: var(--text); cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.chips-col .chip { text-align: left; }
.chip[aria-pressed='true'] { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: inset 0 -3px 0 var(--yellow); }

.stepper { display: flex; align-items: stretch; gap: 8px; }
.stepper button {
  width: 58px; flex: none; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card);
  font-size: 26px; color: var(--blue); cursor: pointer;
}
.stepper input { text-align: center; }
input {
  width: 100%; min-height: 56px; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--card);
  font: inherit; font-size: 20px; font-weight: 600; color: var(--text);
  outline: none; -webkit-appearance: none; appearance: none;
}
input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(10, 71, 166, 0.15); }
input[aria-invalid='true'] { border-color: var(--error); }
.money { position: relative; }
.money span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 20px; font-weight: 600; color: var(--muted); }
.money input { padding-left: 38px; }

.prazo-box { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px 12px; }
.prazo-box output { display: block; font-size: 22px; font-weight: 700; margin-bottom: 6px; color: var(--navy); }
.prazo-box output small { font-size: 15px; font-weight: 500; color: var(--muted); }
input[type='range'] {
  -webkit-appearance: none; appearance: none;
  min-height: 44px; padding: 0; border: 0; background: transparent; box-shadow: none; cursor: pointer;
}
input[type='range']::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--blue) var(--fill, 100%), #d9e1ee var(--fill, 100%)); }
input[type='range']::-moz-range-track { height: 8px; border-radius: 99px; background: #d9e1ee; }
input[type='range']::-moz-range-progress { height: 8px; border-radius: 99px; background: var(--blue); }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -11px; border-radius: 50%; background: var(--yellow); border: 3px solid var(--blue); box-shadow: 0 2px 6px rgba(11, 42, 91, 0.3); }
input[type='range']::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--yellow); border: 3px solid var(--blue); }
input[type='range']:focus { box-shadow: none; }

/* ---------- botões ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 58px; padding: 14px 18px;
  border: 0; border-radius: 16px; font: inherit; font-size: 17px; font-weight: 700;
  text-decoration: none; cursor: pointer; text-align: center; line-height: 1.25;
}
.btn svg { width: 26px; height: 26px; flex: none; }
.btn-primary, .btn-whatsapp {
  background: linear-gradient(180deg, #ffe14a, var(--yellow) 60%, var(--yellow-dark));
  color: var(--navy);
  box-shadow: 0 6px 16px rgba(240, 196, 0, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.06);
}
.btn-primary { margin-top: 8px; font-family: var(--rounded); font-size: 19px; font-weight: 800; }
.btn-primary:active, .btn-whatsapp:active { filter: brightness(0.96); }
.btn-whatsapp { min-height: 64px; font-family: var(--rounded); font-size: 17px; font-weight: 800; }
.btn-whatsapp svg .wa { fill: var(--navy); stroke: none; }
.btn-whatsapp.btn-whatsapp-sec {
  background: #fff; color: var(--blue); min-height: 50px; margin-top: 10px;
  font-family: inherit; font-size: 15px; font-weight: 700;
  border: 1.5px solid var(--blue); box-shadow: none;
}
.btn-whatsapp.btn-whatsapp-sec svg { width: 20px; height: 20px; }
.btn-whatsapp.btn-whatsapp-sec svg .wa { fill: var(--blue); }
.details strong { white-space: nowrap; }
.details strong .pct { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.result-actions .btn-ghost { border: 0; min-height: 44px; margin-top: 6px; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.btn-ghost { background: transparent; color: var(--blue); border: 1.5px solid var(--line); margin-top: 10px; }

/* ---------- resultado ---------- */
.result:empty { display: none; }
.result { margin-top: 6px; }
.result-card { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.result-main { background: linear-gradient(155deg, var(--blue-light) 0%, var(--blue) 45%, var(--blue-deep) 100%); color: #fff; padding: 22px 20px 20px; }
.result-main .label { margin: 0; font-size: 14px; font-weight: 700; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.4px; }
.result-main .value { margin: 6px 0 2px; font-family: var(--rounded); font-size: clamp(34px, 10.5vw, 44px); font-weight: 800; letter-spacing: -1px; line-height: 1.05; color: var(--yellow); }
.result-main .value .pre { display: block; font-family: inherit; font-size: 16px; font-weight: 600; letter-spacing: 0; color: #fff; opacity: 0.92; margin-bottom: 2px; }
.result-main .value .per { font-size: 20px; font-weight: 700; color: #fff; opacity: 0.85; letter-spacing: 0; }
.result-main .sub { margin: 4px 0 0; font-size: 15px; opacity: 0.92; }
.result-main .alt { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.14); font-size: 15px; line-height: 1.35; }
.result-main .alt strong { font-size: 19px; }
.result-main .alt.imovel { margin-top: 10px; background: #fff; color: var(--text); display: flex; flex-direction: column; gap: 2px; border-left: 6px solid var(--yellow); }
.result-main .alt.imovel span { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; color: var(--blue); }
.result-main .alt.imovel strong { font-family: var(--rounded); font-size: 25px; letter-spacing: -0.4px; color: var(--navy); }
.result-main .alt.imovel small { font-size: 13.5px; color: var(--muted); }
.details { list-style: none; margin: 0; padding: 6px 20px; }
.details li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf1f7; font-size: 15px; }
.details li:last-child { border-bottom: 0; }
.details span { color: var(--muted); }
.details strong { text-align: right; color: var(--navy); }
.details li.em { background: var(--yellow-soft); margin: 4px -20px; padding: 12px 20px; border-bottom: 0; }
.details li.em span { color: var(--navy); font-weight: 600; }
.result-actions { padding: 4px 20px 20px; }
.disclaimer { margin: 14px 2px 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.disclaimer strong { color: var(--text); font-weight: 600; }
.disclaimer.center { text-align: center; margin-top: 20px; }
.placeholder { background: var(--card); border: 1.5px dashed var(--line); border-radius: 18px; padding: 18px; color: var(--muted); font-size: 15px; text-align: center; }
.cross { display: block; margin-top: 18px; text-align: center; font-size: 15px; font-weight: 700; color: var(--blue); text-decoration: none; }

/* ---------- aviso ---------- */
.notice { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 26px 20px 20px; margin-top: 18px; text-align: center; }
.notice-icon { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%; background: var(--yellow-soft); color: var(--navy); display: grid; place-items: center; }
.notice-icon svg { width: 30px; height: 30px; }
.notice p { margin: 0 0 20px; font-size: 17px; line-height: 1.5; }

/* ---------- rodapé ---------- */
.footer { text-align: center; padding: 18px 16px 26px; font-size: 13px; color: var(--muted); }
.footer p { margin: 2px 0; }
.footer .muted { font-size: 12px; opacity: 0.85; }
