/* ============================================================
   STYLE.CSS — Visual escuro/premium, mobile-first
   ============================================================ */

:root {
  --bg-1: #050813;
  --bg-2: #0b1224;
  --card-bg: #121b33;
  --card-bg-hover: #182545;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-selected: #2f6bff;
  --blue: #2f6bff;
  --blue-light: #5b8bff;
  --text: #f5f7ff;
  --text-muted: #98a2c3;
  --info-grad: linear-gradient(155deg, #142046 0%, #0d1730 60%, #0b1224 100%);
  --radius-lg: 22px;
  --radius-md: 16px;
  --danger: #ff5d6c;
  --success: #33d18f;
  --whatsapp: #25d366;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(ellipse at top, var(--bg-2) 0%, var(--bg-1) 65%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

#app {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------------- Barra de progresso ---------------- */

.progress-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  z-index: 30;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue-light) 100%);
  transition: width 0.4s ease;
}

/* ---------------- Topo fixo: voltar + logo ---------------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 25;
  /* Fundo sólido com desfoque para o conteúdo passar por baixo sem
     "sujar" a logo quando a tela rola. */
  background: rgba(5, 8, 19, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.back-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: rgba(18, 27, 51, 0.85);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.back-btn:active {
  transform: scale(0.92);
}

.back-btn.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Logo Porto Bank no topo direito.
   Para deixar a logo maior ou menor, mude só a altura abaixo. */
.brand-logo {
  margin-left: auto;
  height: 21px;
  width: auto;
  opacity: 0.92;
}

/* ---------------- Container de telas ---------------- */

.screen-container {
  flex: 1;
  position: relative;
  display: flex;
  min-height: 100dvh;
}

.screen {
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  padding: 88px 24px 32px;
  gap: 18px;
  animation: slideIn 0.35s ease;
}

/* Telas com imagem/conteúdo alto: alinham ao topo e podem rolar */
.screen.tall {
  justify-content: flex-start;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ---------------- Imagem de destaque (hero) ---------------- */

.hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  flex-shrink: 0;
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Selo sobre a imagem (ex.: "⚠️ Alerta: financiamento") */
.hero-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 168, 38, 0.95);
  color: #241503;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Legenda no rodapé da imagem */
.hero-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 34px 16px 13px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, rgba(5, 8, 19, 0) 0%, rgba(5, 8, 19, 0.85) 100%);
}

/* ---------------- Tela de pergunta ---------------- */

.screen-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.screen-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.option-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.option-card:active {
  transform: scale(0.98);
}

.option-card:hover {
  background: var(--card-bg-hover);
}

.option-card.selected {
  border-color: var(--card-border-selected);
  background: var(--card-bg-hover);
}

.option-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.option-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.option-label {
  font-size: 17px;
  font-weight: 600;
}

.option-sublabel {
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------------- Tela de informação ---------------- */

.screen.info {
  background: var(--info-grad);
}

.info-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  margin: 0;
}

.info-title em {
  font-style: normal;
  color: var(--blue-light);
}

.info-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  font-size: 17px;
  line-height: 1.55;
  color: #dfe5f7;
}

/* ---------------- Botões primários ---------------- */

.btn-primary {
  appearance: none;
  border: none;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  padding: 17px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  transition: opacity 0.15s ease, transform 0.1s ease;
  box-shadow: 0 8px 24px rgba(47, 107, 255, 0.35);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary.loading {
  position: relative;
  color: transparent;
}

.btn-primary.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Botão WhatsApp da tela de resultado */
.btn-whatsapp {
  display: block;
  text-align: center;
  text-decoration: none;
  background: var(--whatsapp);
  color: #042a13;
  font-size: 17px;
  font-weight: 800;
  padding: 17px 24px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.32);
  transition: transform 0.1s ease;
}

.btn-whatsapp:active {
  transform: scale(0.98);
}

/* ---------------- Abertura ---------------- */

.screen.opening {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 22px;
}

.opening-selo {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(47, 107, 255, 0.16);
  border: 1px solid rgba(91, 139, 255, 0.35);
  color: var(--blue-light);
  font-size: 13px;
  font-weight: 700;
}

.opening-title {
  font-size: 27px;
  font-weight: 800;
  line-height: 1.35;
  margin: 0;
}

/* ---------------- Formulário de captura ---------------- */

.capture-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(51, 209, 143, 0.14);
  border: 1px solid rgba(51, 209, 143, 0.4);
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-field input {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  font-size: 16px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-field input:focus {
  border-color: var(--blue);
}

.form-field input.invalid {
  border-color: var(--danger);
}

.field-error {
  font-size: 12px;
  color: var(--danger);
  min-height: 14px;
}

.form-error-banner {
  background: rgba(255, 93, 108, 0.12);
  border: 1px solid rgba(255, 93, 108, 0.4);
  color: #ffb0b8;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
}

.form-footnote {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

/* ---------------- Tela de resultado ---------------- */

.result-greeting {
  text-align: center;
  font-size: 15px;
  color: var(--text-muted);
  margin: 0;
}

.result-profile {
  text-align: center;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
  color: var(--blue-light);
}

.result-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.compat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.compat-label {
  font-size: 15px;
  font-weight: 600;
}

.compat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--success);
}

.compat-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.compat-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--success) 0%, #4fe3d0 100%);
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Card de destaque (descrição do perfil) */
.result-highlight {
  background: linear-gradient(140deg, rgba(47, 107, 255, 0.18) 0%, rgba(51, 209, 143, 0.12) 100%);
  border: 1px solid rgba(91, 139, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  font-size: 16px;
  line-height: 1.55;
}

/* Card verde de "economia"/parcela */
.result-economy {
  background: rgba(51, 209, 143, 0.1);
  border: 1px solid rgba(51, 209, 143, 0.3);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

.result-economy .eco-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.result-economy .eco-value {
  font-size: 21px;
  font-weight: 800;
  color: var(--success);
}

/* Tabela de resumo do perfil */
.summary-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--card-border);
  font-size: 15px;
}

.summary-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.summary-row dt {
  color: var(--text-muted);
  margin: 0;
  flex-shrink: 0;
}

.summary-row dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.result-notice {
  background: rgba(255, 168, 38, 0.1);
  border: 1px solid rgba(255, 168, 38, 0.32);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #ffd08a;
  text-align: center;
}

@media (min-width: 480px) {
  .screen {
    max-width: 480px;
    margin: 0 auto;
  }
  .topbar {
    max-width: 512px;
    margin: 0 auto;
  }
}
