/* ─── RESET & BASE ─────────────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --ink:        #0e0e0e;
  --ink-mid:    #555;
  --ink-soft:   #999;
  --line:       #e8e8e8;
  --surface:    #f7f7f5;
  --white:      #ffffff;

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --radius-lg:   28px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html, body {
  height: 100%;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-body);
  -webkit-appearance: none;
  appearance: none;
}

/* ─── PAGE WRAPPER ──────────────────────────────────────────────────────────── */
#app {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
}

/* ─── VIEWS ─────────────────────────────────────────────────────────────────── */
.view {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.55s var(--ease-out), opacity 0.45s ease;
  will-change: transform, opacity;
  padding-bottom: 44px;
}

.view--hidden-right { transform: translateX(100%);  opacity: 0; pointer-events: none; }
.view--hidden-left  { transform: translateX(-15%);  opacity: 0; pointer-events: none; }
.view--visible      { transform: translateX(0);     opacity: 1; pointer-events: auto; }

/* ─── SHARED HEADER ─────────────────────────────────────────────────────────── */
.header, .form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px 0;
  padding-left:  calc(40px + env(safe-area-inset-left));
  padding-right: calc(40px + env(safe-area-inset-right));
  flex-shrink: 0;
}

.logo {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
}

.nav {
  display: flex;
  gap: 28px;
  font-size: 13px;
  color: var(--ink-mid);
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mid);
  transition: color 0.2s ease, transform 0.2s ease;
  padding: 8px 0;
  min-height: 44px;
}
.back-btn:hover  { color: var(--ink); transform: translateX(-3px); }
.back-btn:active { transform: translateX(-1px); }
.back-btn svg {
  width: 16px; height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ─── LANDING VIEW ───────────────────────────────────────────────────────────── */
#view-landing {
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}

.landing-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 40px;
  padding-left:  calc(40px + env(safe-area-inset-left));
  padding-right: calc(40px + env(safe-area-inset-right));
}

.hero {
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  width: fit-content;
}

.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.4); }
}

.typing-title {
  font-family: var(--font-display);
  font-size: 58px;
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-weight: 400;
  color: var(--ink);
}

.cursor {
  /* inline (não inline-block) mantém o cursor no fluxo de texto,
     evitando que quebre para a próxima linha em telas de 430 px */
  display: inline;
  animation: blink 1s infinite;
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--ink-mid);
}

@keyframes blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.subtitle {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-mid);
  max-width: 560px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.subtitle.show { opacity: 1; transform: translateY(0); }

.buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.55s ease 0.08s, transform 0.55s ease 0.08s;
}
.buttons.show { opacity: 1; transform: translateY(0); }

.btn-primary {
  flex: 1;
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius-pill);
  padding: 15px 28px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, transform 0.15s ease;
}
.btn-primary:hover  { background: #2a2a2a; }
.btn-primary:active { transform: scale(0.97); }

.tesouro-cta-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.5rem auto 3rem;
  padding: 0 24px;
}

.btn-primary.tesouro-cta {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  text-decoration: none;
  white-space: nowrap;
}

.btn-secondary {
  background: var(--white);
  color: var(--ink-mid);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 15px 26px;
  font-size: 14px;
  font-weight: 400;
  transition: background 0.2s ease, transform 0.15s ease;
}
.btn-secondary:hover  { background: var(--surface); }
.btn-secondary:active { transform: scale(0.97); }

.btn-sobre {
  flex: 1;
  background: var(--white);
  color: var(--ink-mid);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 15px 28px;
  font-size: 14px;
  font-weight: 400;
  transition: background 0.2s ease, transform 0.15s ease;
}
.btn-sobre:hover  { background: var(--surface); }
.btn-sobre:active { transform: scale(0.97); }

/* Panel */
.panel {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.panel.show { opacity: 1; transform: translateY(0); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0,0,0,0.04);
  padding: 28px;
}
.card.small {
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  padding: 20px 22px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
}

.eyebrow {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.main-title {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
}

.pill {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-mid);
  white-space: nowrap;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-box {
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 16px;
}

.stat-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.stat-value { margin-top: 8px; font-size: 14px; font-weight: 600; }

.rec-title { font-size: 16px; font-weight: 500; margin-bottom: 6px; }
.rec-tag {
  display: inline-block;
  background: var(--surface);
  color: var(--ink-mid);
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  font-size: 11px;
  margin-bottom: 10px;
}
.rec-detail { color: var(--ink-mid); font-size: 13.5px; line-height: 1.6; }

/* ─── LOADING VIEW ───────────────────────────────────────────────────────────── */
.loading-dots { display: flex; gap: 10px; }
.loading-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink); display: inline-block;
  animation: dotBounce 1.2s infinite ease-in-out;
}
.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(.7); opacity: .4; }
  40%           { transform: scale(1);  opacity: 1;  }
}

.loading-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 40px 24px;
}

#loadingMsg {
  font-size: 15px;
  color: var(--ink-mid);
  text-align: center;
  max-width: 340px;
  line-height: 1.75;
}

/* ─── RESULTS VIEW ───────────────────────────────────────────────────────────── */
.results-header {
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 10;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.results-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 24px 0;
}

.perfil-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  margin-bottom: 36px;
  font-size: 13px;
  color: var(--ink-mid);
}

/* ─── MARKDOWN RESULTADOS ────────────────────────────────────────────────────── */
#relatorioContent {
  font-family: var(--font-body);
}
#relatorioContent h1, #relatorioContent h2,
#relatorioContent h3, #relatorioContent h4,
#relatorioContent h5, #relatorioContent h6 {
  font-family: var(--font-body);
  color: var(--ink);
}
#relatorioContent h2 {
  font-size: 26px; font-weight: 600;
  margin: 40px 0 14px; line-height: 1.2;
}
#relatorioContent h3 {
  font-size: 20px; font-weight: 500;
  margin: 28px 0 10px;
}
#relatorioContent p      { margin: 0 0 14px; color: var(--ink-mid); font-size: 15px; line-height: 1.75; }
#relatorioContent li     { color: var(--ink-mid); font-size: 15px; margin-bottom: 8px; line-height: 1.7; }
#relatorioContent ul,
#relatorioContent ol     { padding-left: 22px; margin-bottom: 14px; }
#relatorioContent strong { color: var(--ink); font-weight: 600; }
#relatorioContent hr     { border: none; border-top: 1px solid var(--line); margin: 28px 0; }
#relatorioContent blockquote {
  border-left: 3px solid var(--line); margin: 0 0 14px;
  padding: 8px 16px; color: var(--ink-soft); font-style: italic;
}

/* ─── GRÁFICO DE PROJEÇÃO (único, centralizado) ──────────────────────────────── */
/* Container externo: limita a largura a 900px para evitar que o gráfico estique
   excessivamente em monitores ultrawide e o centraliza horizontalmente. */
.results-charts-outer {
  width: 100%;
  max-width: 900px;
  margin: 48px auto 32px;
  padding: 0 24px;
}

/* Wrapper do canvas Chart.js: container relativo com altura fixa é o padrão
   recomendado para responsive:true + maintainAspectRatio:false. */
.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 460px;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 20px 16px 12px;
}

.chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

@media (max-width: 720px) {
  .chart-canvas-wrap { height: 360px; padding: 14px 8px 6px; }
}

.grafico-label {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 12px;
  text-align: center;
}

/* Oculto por padrão; JS define style.display = "flex" para exibir */
#wrapProjecao {
  display: none;
  flex-direction: column;
}

/* ─── SOUND LAYER & BUTTON ───────────────────────────────────────────────────── */
/*
 * Por que o padrão "sound-layer"?
 * As .view têm will-change:transform + overflow-y:auto. Em telas altas
 * (≥ 844 px lógicos: iPhone XR/12/14 Pro Max, Pixel 7, S20 Ultra, A51/A71)
 * o browser cria compositing layers separadas para cada view e as pinta
 * APÓS os elementos fixed do mesmo contexto de empilhamento, ocultando o
 * botão mesmo com z-index alto. A solução é um wrapper com position:fixed +
 * inset:0 + z-index:2147483647 (INT_MAX de 32 bits), que garante ocupar o
 * topo absoluto da pilha antes de qualquer layer de composição das views.
 * O botão usa position:absolute dentro dessa camada.
 */
.sound-layer {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  pointer-events: none;
}

.sound-btn {
  position: absolute;
  left:   calc(24px + env(safe-area-inset-left));
  bottom: calc(38px + env(safe-area-inset-bottom));
  pointer-events: auto;
  width: auto;
  min-width: 52px;
  height: 52px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: width 0.2s ease, padding 0.2s ease, border-radius 0.2s ease, box-shadow 0.2s ease, opacity 0.15s ease;
}
.sound-btn.is-compact {
  width: 52px;
  padding: 0;
  border-radius: 50%;
  gap: 0;
}
.sound-btn:hover  { box-shadow: 0 10px 35px rgba(0,0,0,0.12); }
.sound-btn:active { opacity: 0.7; }
.sound-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.sound-label {
  max-width: 140px;
  overflow: hidden;
  opacity: 1;
  transition: max-width 0.2s ease, opacity 0.15s ease;
}
.sound-btn.is-compact .sound-label {
  max-width: 0;
  opacity: 0;
}

/* ─── FORM VIEWS ─────────────────────────────────────────────────────────────── */
.form-view {
  padding-bottom: calc(48px + env(safe-area-inset-bottom));
}

.form-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px 40px;
  padding-left:  calc(40px + env(safe-area-inset-left));
  padding-right: calc(40px + env(safe-area-inset-right));
}

.form-card {
  width: 100%;
  max-width: 540px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.form-card.entered { opacity: 1; transform: translateY(0); }

.form-step {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.form-question {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 400;
  line-height: 1.12;
  color: var(--ink);
  margin-bottom: 36px;
}

/* Currency input */
.input-wrapper {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  gap: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input-wrapper:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(14,14,14,0.06);
}

.currency-label {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--ink-soft);
  flex-shrink: 0;
  user-select: none;
  line-height: 1;
}

.money-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1;
  width: 100%;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}
.money-input::placeholder { color: #d0d0d0; }
.money-input::-webkit-inner-spin-button,
.money-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.input-hint {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 10px;
  margin-bottom: 28px;
  padding-left: 4px;
  line-height: 1.55;
}

/* ─── HORIZONTE DE INVESTIMENTO (Passo 4) — Toggle Meses/Anos ───────────────── */
/* Substituiu o <select> nativo, que herdava a estética do browser (cantos
   serrilhados, dropdown quadrado) e quebrava o padrão arredondado do form.
   O toggle é dois botões pill lado a lado: o ativo ganha fundo sólido (ink),
   o inativo fica só com contorno fino. JS alterna a classe .active e o valor
   do <input type="hidden"> que vai no payload. */
.unit-toggle {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 16px 0 8px;
}
.unit-toggle-btn {
  padding: 9px 24px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}
.unit-toggle-btn:hover {
  border-color: var(--ink-soft);
  color: var(--ink);
}
.unit-toggle-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}
.unit-toggle-btn:focus-visible {
  outline: 2px solid rgba(14, 14, 14, 0.18);
  outline-offset: 2px;
}

/* Chips – pill (value suggestions) */
.chips-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}

/* Chips – block (radio-style) */
.chips-block {
  flex-direction: column;
  gap: 12px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mid);
  background: var(--white);
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-align: left;
}
.chip:hover  { border-color: var(--ink); color: var(--ink); }
.chip:active { opacity: 0.8; }

/* Pill chips: dark fill when selected */
.chip:not(.chip-block).selected {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

/* Block chips: light fill when selected */
.chip.chip-block {
  width: 100%;
  border-radius: 16px;
  padding: 18px 20px;
  justify-content: space-between;
  align-items: center;
}
.chip.chip-block.selected {
  background: var(--surface);
  border-color: var(--ink);
  color: var(--ink);
}

.chip-label {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
}
.chip-label span {
  display: block;
  font-weight: 400;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 3px;
}

/* Radio indicator dot */
.chip-radio {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line);
  flex-shrink: 0;
  margin-left: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease;
}
.chip-radio::after {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.chip.chip-block.selected .chip-radio { border-color: var(--ink); }
.chip.chip-block.selected .chip-radio::after { opacity: 1; transform: scale(1); }

/* Continue button */
.btn-continue {
  width: 100%;
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius-pill);
  padding: 18px 28px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  line-height: 1.25;
  white-space: normal;
  transition: background 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
  min-height: 54px;
}
.btn-continue:hover  { background: #222; }
.btn-continue:active { transform: scale(0.98); }
.btn-continue:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.btn-continue svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}
.btn-continue:not(:disabled):hover svg { transform: translateX(4px); }

/* ─── PÁGINA SOBRE ───────────────────────────────────────────────────────────── */
.sobre-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 40px 60px;
  padding-left:  calc(40px + env(safe-area-inset-left));
  padding-right: calc(40px + env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.sobre-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sobre-heading {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
}

.sobre-text {
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink-mid);
}
.sobre-text strong { color: var(--ink); }
.sobre-text a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s ease;
}
.sobre-text a:hover { border-bottom-color: var(--ink); }

.tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tech-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mid);
  background: var(--surface);
}

.sobre-disclaimer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: 12px;
  padding: 28px 32px;
}

/* ─── SITE FOOTER ────────────────────────────────────────────────────────────── */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px; /* <- ADICIONADO: cria o espaço automático entre o span e o a */
  background: var(--white);
  border-top: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
}

.site-footer span {
  line-height: 1;
  border-bottom: 1px solid transparent;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  line-height: 1; /* <- ADICIONADO: garante que a borda inferior não desloque o texto */
}

.site-footer a:hover {
  color: var(--ink-mid);
  border-bottom-color: currentColor;
}

/* ─── RESPONSIVIDADE ─────────────────────────────────────────────────────────── */

/* ── Desktop largo ≥ 1025 px ────────────────────────────────────────────────── */
@media (min-width: 1025px) {
  .hero-content { gap: 18px; }
}

/* ── Tier 1: Tablets e foldables abertos ≤ 1024 px ──────────────────────────── */
@media (max-width: 1024px) {
  .typing-title { font-size: 46px; }
  .hero         { gap: 40px; }
  .hero-content { gap: 20px; }
  .nav          { gap: 20px; font-size: 12px; }
}

/* ── Tier 2: Phablets, iPads pequenos, landscape de celular ≤ 768 px ─────────── */
@media (max-width: 768px) {
  .header, .form-header {
    padding: 22px 24px 0;
    padding-left:  calc(24px + env(safe-area-inset-left));
    padding-right: calc(24px + env(safe-area-inset-right));
  }

  .nav { display: none; }

  .landing-body {
    padding: 28px 24px 24px;
    padding-left:  calc(24px + env(safe-area-inset-left));
    padding-right: calc(24px + env(safe-area-inset-right));
    align-items: flex-start;
  }

  .hero         { gap: 32px; }
  .hero-content { gap: 28px; }
  .typing-title { font-size: 38px; }

  .buttons       { width: 100%; flex-direction: column; }
  .btn-primary   { width: 100%; padding: 17px 24px; font-size: 15px; min-height: 50px; }
  .btn-secondary { display: none; }
  .btn-sobre     { width: 100%; padding: 17px 24px; font-size: 15px; min-height: 50px; }

  .stats { grid-template-columns: 1fr; }
  .card  { border-radius: 20px; }
  .card.small { border-left: 3px solid var(--line); border-radius: 0 16px 16px 0; }

  .form-body {
    padding: 30px 24px 24px;
    padding-left:  calc(24px + env(safe-area-inset-left));
    padding-right: calc(24px + env(safe-area-inset-right));
    justify-content: flex-start;
  }

  .form-question  { font-size: 32px; margin-bottom: 28px; }
  .money-input    { font-size: 30px; }
  .currency-label { font-size: 24px; }
  .input-wrapper  { padding: 18px 20px; }

  .chip.chip-block { padding: 16px 18px; }
  .chip-label      { font-size: 14px; }

  .results-charts-outer { padding: 0 18px; margin: 36px auto 96px; }

  .sobre-body    { padding: 32px 24px 48px; gap: 36px; }
  .sobre-heading { font-size: 24px; }
  .sobre-disclaimer { padding: 22px 24px; }
}

/* ── Tier 3: Celulares modernos em retrato ≤ 430 px ─────────────────────────── */
@media (max-width: 430px) {
  .header, .form-header {
    padding: 18px 18px 0;
    padding-left:  calc(18px + env(safe-area-inset-left));
    padding-right: calc(18px + env(safe-area-inset-right));
  }

  .landing-body {
    padding: 22px 18px 20px;
    padding-left:  calc(18px + env(safe-area-inset-left));
    padding-right: calc(18px + env(safe-area-inset-right));
  }

  .hero         { gap: 24px; }
  .hero-content { gap: 24px; }
  .typing-title { font-size: 32px; }

  .btn-primary { padding: 16px 20px; font-size: 16px; }
  .btn-sobre   { padding: 16px 20px; font-size: 16px; }

  .form-body {
    padding: 22px 18px 20px;
    padding-left:  calc(18px + env(safe-area-inset-left));
    padding-right: calc(18px + env(safe-area-inset-right));
  }

  .form-question  { font-size: 28px; margin-bottom: 20px; }
  .money-input    { font-size: 26px; }
  .currency-label { font-size: 20px; }
  .input-wrapper  { padding: 14px 16px; }

  .chips { gap: 6px; margin-bottom: 28px; }
  .chip  { padding: 8px 14px; font-size: 12px; }
  .chip.chip-block { padding: 14px 16px; }

  .sound-btn.is-compact { width: 46px; height: 46px; min-width: 46px; }

  .sobre-body    { padding: 24px 18px 40px; gap: 28px; }
  .sobre-heading { font-size: 22px; }
  .sobre-text    { font-size: 15px; }
  .sobre-disclaimer { padding: 18px 20px; }
}

/* ─── TOAST / SNACKBAR ──────────────────────────────────────────────────────────
   Notificação flutuante, minimalista, canto inferior direito.
   Acionada quando o backend sinaliza alerta_limite.excedido (prazo do usuário
   > vencimento máximo disponível no Tesouro). Slide-in suave, auto-dismiss
   após 8s, botão "×" para fechar manualmente. Glassmorphism leve com leve
   blur de fundo para destacar sem brigar com o conteúdo principal. */
.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 280px;
  max-width: 380px;
  padding: 14px 16px;
  background: rgba(20, 20, 20, 0.94);
  color: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  box-shadow: 0 12px 36px -8px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.005em;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;
}
.toast.show {
  transform: translateX(0);
  opacity: 1;
}
.toast-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(240, 181, 69, 0.18);
  color: #f0b545;
  font-weight: 700;
  font-size: 13px;
  margin-top: 1px;
  user-select: none;
}
.toast-body { flex: 1; min-width: 0; }
.toast-title {
  font-weight: 600;
  margin-bottom: 2px;
  color: #ffffff;
}
.toast-msg { color: #d6d6d6; }
.toast-close {
  flex-shrink: 0;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #888;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.toast-close:hover { color: #ffffff; background-color: rgba(255, 255, 255, 0.08); }

@media (max-width: 640px) {
  .toast-stack { right: 12px; left: 12px; bottom: 12px; }
  .toast { min-width: 0; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .toast { transition: opacity 0.15s ease; transform: none; }
}
