/* Compatibilidade e cache busting */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
*, *::before, *::after {
  box-sizing: border-box;
}
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
body {
  min-width: 320px;
}
img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}
input, select, button, textarea {
  font: inherit;
}
.card, .result-card, .simulator-card, .metric-grid, .grid-2, .choice-grid, .recommendation-grid, .actions {
  min-width: 0;
}
.total-box strong,
.metric-card strong,
.mini-metric strong,
#monthlyCost,
#incomePercent {
  overflow-wrap: anywhere;
  word-break: normal;
}
@supports not ((backdrop-filter: blur(6px)) or (-webkit-backdrop-filter: blur(6px))) {
  .topbar, .card, .advice-card, .manual-box {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

:root {
  --bg: #f5f7f6;
  --card: #ffffff;
  --soft: #f3f5f7;
  --line: #dde3e8;
  --text: #11161c;
  --muted: #667183;
  --green: #1fa84f;
  --green-dark: #14853c;
  --green-soft: #eef9f1;
  --blue-soft: #eef3ff;
  --blue-text: #5471aa;
  --shadow: 0 14px 34px rgba(17, 22, 28, 0.06);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fbfcfb 0%, var(--bg) 100%);
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.hidden { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 252, 251, 0.94);
  border-bottom: 1px solid rgba(221, 227, 232, 0.8);
}
.topbar-inner {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-logo { height: 42px; width: auto; display: block; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.topbar-badge,
.tag,
.step-kicker,
.empty-badge,
.fit-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.topbar-badge,
.tag,
.empty-badge { background: var(--soft); color: var(--muted); }
.tag-blue { background: var(--blue-soft); color: var(--blue-text); }
.step-kicker { background: var(--soft); color: var(--muted); }

.page {
  width: min(1180px, calc(100% - 28px));
  margin: 22px auto 44px;
}
.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  gap: 18px;
  align-items: start;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}
.simulator-card,
.result-card { padding: 28px; }

.section-head h1 {
  margin: 14px 0 10px;
  font-size: clamp(36px, 6vw, 58px);
  line-height: 0.95;
  letter-spacing: -0.06em;
}
.section-head p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.6;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  margin-bottom: 14px;
}
.field label {
  font-size: 14px;
  font-weight: 800;
}
.field label span {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}
.field input,
.field select,
.manual-toggle,
.segmented-btn,
.choice-card,
.metric,
.mini-card,
.advice-card,
.step-card,
.search-item,
.empty-state,
.total-box,
.cta-box,
.recommend-item {
  border: 1px solid var(--line);
}
.field input,
.field select {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--text);
  outline: none;
}
.field input::placeholder { color: #9aa5b1; }
.field input:focus,
.field select:focus {
  border-color: rgba(31, 168, 79, 0.35);
  box-shadow: 0 0 0 4px rgba(31, 168, 79, 0.08);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
  z-index: 20;
  padding: 8px;
}
.search-item {
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 800;
}
.search-item + .search-item { margin-top: 8px; }
.search-item:hover { background: var(--soft); }
.search-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 600;
}
.segmented,
.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.segmented-btn,
.choice-card {
  background: #fff;
  border-radius: var(--radius-lg);
  min-height: 98px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
}
.segmented-btn strong,
.choice-card strong {
  display: block;
  font-size: 16px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.segmented-btn span,
.choice-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.segmented-btn.active,
.choice-card.active {
  border-color: rgba(31, 168, 79, 0.35);
  background: var(--green-soft);
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.actions-main { margin-top: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 800;
  border: 0;
  cursor: pointer;
}
.btn-primary {
  background: #101317;
  color: #fff;
}
.btn-secondary {
  background: var(--soft);
  color: var(--text);
}
.btn-whatsapp {
  background: var(--green);
  color: #fff;
}
.btn-topbar { min-height: 46px; padding: 0 16px; }
.btn-block { flex: 1 1 260px; }

.manual-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.manual-toggle {
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}
.manual-fields {
  margin-top: 14px;
  padding: 18px;
  border-radius: 20px;
  background: #fbfcfd;
  border: 1px solid var(--line);
}
.manual-intro {
  margin-bottom: 12px;
}
.manual-intro p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.empty-state {
  min-height: 100%;
  border-radius: 20px;
  background: #fafbfc;
  padding: 24px;
}
.empty-state h2,
.result-header h2,
.recommend-head h3 {
  margin: 12px 0 10px;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}
.empty-state p,
.result-header p,
.recommend-head p,
.advice-card p,
.step-card p,
.mini-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.fit-tag {
  background: #eaf8ef;
  color: #187a3b;
}
.fit-apertado { background: #fff5e7; color: #9a5a00; }
.fit-nao-cabe { background: #fdecec; color: #9c2828; }
.total-box {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, #12171e 0%, #1d2d47 100%);
  color: #fff;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.meta-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.84;
  margin-bottom: 8px;
}
.total-box strong {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1;
  letter-spacing: -0.06em;
}
.advice-card {
  margin-top: 14px;
  border-radius: 18px;
  background: #f3f7fd;
  padding: 18px;
}
.advice-card h3 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -0.05em;
}
.metric-grid,
.mini-grid,
.recommend-grid,
.next-step-box {
  display: grid;
  gap: 12px;
}
.metric-grid {
  margin-top: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.metric,
.mini-card,
.recommend-item,
.step-card,
.cta-box {
  min-width: 0;
  background: #fff;
  border-radius: 18px;
  padding: 18px;
}
.metric span,
.mini-card span,
.recommend-meta,
.recommend-kicker {
  display: block;
  color: #7a8698;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}
.metric strong,
.mini-card strong {
  display: block;
  max-width: 100%;
  line-height: 1.02;
  letter-spacing: -0.05em;
}
.metric strong {
  font-size: clamp(22px, 2.5vw, 34px);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.mini-card strong {
  font-size: clamp(16px, 2.05vw, 24px);
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
.metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}
.mini-grid {
  margin-top: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.mini-card p { margin-top: 8px; }

.recommend-wrap { margin-top: 18px; }
.recommend-head {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 12px;
}
.recommend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.recommend-item { min-height: 100%; }
.recommend-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.recommend-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #ebf8ef;
  color: #187a3b;
  margin: 0;
}
.recommend-item h4 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.recommend-item p { margin: 10px 0 0; color: var(--muted); line-height: 1.55; }
.recommend-empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 18px;
}
.next-step-box {
  margin-top: 16px;
  grid-template-columns: 1fr;
}
.step-card strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.05em;
}
.step-card p { margin-top: 10px; }
.cta-box { margin-top: 16px; background: #f3faf5; }
.cta-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.cta-actions .btn-block {
  width: 100%;
  flex: 0 0 auto;
  min-height: 54px;
}

.floating-wa {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 45;
  min-height: 54px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(31, 168, 79, 0.28);
}

@media (max-width: 1080px) {
  .app-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .mini-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .topbar-inner,
  .page { width: min(100% - 20px, 1180px); }
  .topbar-inner { min-height: auto; padding: 12px 0; flex-direction: column; align-items: flex-start; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .simulator-card,
  .result-card { padding: 20px; }
  .grid-2,
  .recommend-head { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .recommend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segmented,
  .choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .total-box { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-head h1 { font-size: 52px; }
}
@media (max-width: 560px) {
  .brand-logo { height: 34px; }
  .section-head h1 { font-size: 34px; }
  .empty-state h2,
  .result-header h2,
  .recommend-head h3,
  .advice-card h3,
  .step-card strong { font-size: 18px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mini-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .recommend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segmented,
  .choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .total-box { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .total-box strong { font-size: 22px; }
  .metric strong { font-size: 16px; }
  .mini-card strong { font-size: 13px; }
  .metric,
  .mini-card,
  .recommend-item,
  .step-card,
  .cta-box { padding: 14px; }
  .metric span,
  .mini-card span,
  .recommend-meta,
  .recommend-kicker { font-size: 11px; margin-bottom: 6px; }
  .mini-card p,
  .metric small,
  .recommend-item p,
  .result-header p,
  .advice-card p,
  .step-card p,
  .empty-state p { font-size: 13px; line-height: 1.45; }
  .cta-actions .btn-block { min-height: 50px; }
  .segmented-btn,
  .choice-card { min-height: auto; padding: 14px 10px; }
  .segmented-btn strong,
  .choice-card strong { font-size: 15px; }
  .segmented-btn span,
  .choice-card span { font-size: 11px; line-height: 1.35; }
  .btn,
  .field input,
  .field select { min-height: 52px; }
  .floating-wa { right: 12px; bottom: 12px; min-height: 50px; }
}
@media (max-width: 420px) {
  .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mini-card:last-child { grid-column: 1 / -1; }
  .mini-card { padding: 12px; }
  .mini-card strong { font-size: 12px; line-height: 1.05; }
  .metric strong { font-size: 14px; }
  .total-box strong { font-size: 20px; }
}
