/* =============================================
   financiamento-imobiliario.css
   ============================================= */

.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--text-hint);
  text-decoration: none;
  margin-bottom: 20px;
  transition: color .2s;
}
.back-link:hover { color: var(--text-primary); }

/* ===== FORMULÁRIO ===== */
.fi-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  max-width: 860px;
}

.fi-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 32px;
  margin-bottom: 28px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.label-opt {
  font-size: 11px;
  color: var(--text-hint);
  font-weight: 400;
}

.input-hint {
  font-size: 12px;
  color: var(--text-hint);
}

.input-wrap {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .2s;
}
.input-wrap:focus-within { border-color: var(--c1); }

.input-prefix,
.input-suffix {
  padding: 0 12px;
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  align-self: stretch;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.input-prefix { border-right: 1px solid var(--border); }
.input-suffix  { border-left:  1px solid var(--border); }

.input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  padding: 12px 14px;
  width: 100%;
}
.input-wrap input::placeholder { color: var(--text-placeholder); }

.input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.flex1 { flex: 1; }
.input-unit {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.input-group select {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  padding: 12px 16px;
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
}
.input-group select:focus { border-color: var(--c1); }

.fi-form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-calcular {
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 15px;
  padding: 14px 40px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 0 24px rgba(108,58,255,0.35);
}
.btn-calcular:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 32px rgba(108,58,255,0.55);
}

.btn-limpar {
  background: transparent;
  color: var(--text-hint);
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: color .2s;
  padding: 14px 8px;
}
.btn-limpar:hover { color: var(--text-primary); }

/* ===== ALERTA RENDA ===== */
.alerta {
  border-radius: 16px;
  padding: 18px 24px;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid;
}
.alerta.ok       { background: rgba(58,255,163,0.08);  border-color: rgba(58,255,163,0.25);  color: var(--c5); }
.alerta.atencao  { background: rgba(255,179,71,0.08);  border-color: rgba(255,179,71,0.25);  color: var(--c4); }
.alerta.perigo   { background: rgba(255,94,143,0.08);  border-color: rgba(255,94,143,0.25);  color: var(--c3); }
.alerta strong   { font-weight: 600; }

/* ===== COMPARATIVO SAC vs PRICE ===== */
.comparativo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.sistema-card {
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color .3s;
}

.sistema-card.melhor { border-color: var(--c2); }

.sistema-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sistema-header.sac   { background: rgba(108,58,255,0.15); }
.sistema-header.price { background: rgba(0,210,200,0.12); }

.sistema-header h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.sistema-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  padding: 3px 10px;
}

.sistema-body { padding: 8px 0; background: var(--card); }

.sistema-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 14px;
}
.sistema-row:last-child { border-bottom: none; }
.sistema-row span  { color: var(--text-secondary); }
.sistema-row strong { color: var(--text-primary); font-weight: 500; }
.sistema-row.destaque strong { color: var(--c2); font-size: 15px; }

/* ===== RECOMENDAÇÃO ===== */
.recomendacao {
  border-radius: 16px;
  padding: 20px 24px;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid rgba(108,58,255,0.3);
  background: rgba(108,58,255,0.08);
  color: var(--text-primary);
}
.recomendacao strong { color: var(--text-primary); font-weight: 600; }

/* ===== GRÁFICO ===== */
.chart-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.chart-header .table-title { margin: 0; }

.chart-toggle {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}

.toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-hint);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.toggle-btn.active { background: var(--c1); color: #fff; }

.chart-legend {
  display: flex;
  gap: 20px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.chart-container {
  padding: 20px 24px 24px;
  height: 320px;
}

/* ===== TABELAS ===== */
.tabelas-toggle {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  width: fit-content;
  margin-bottom: 20px;
}

.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}

.table-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.table-scroll {
  overflow-x: auto;
  max-height: 480px;
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(20,20,32,0.98);
}

thead th {
  padding: 13px 18px;
  text-align: right;
  font-weight: 500;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
thead th:first-child { text-align: center; }

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background .15s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.03); }

tbody td {
  padding: 12px 18px;
  text-align: right;
  color: var(--text-secondary);
  white-space: nowrap;
}
tbody td:first-child {
  text-align: center;
  color: var(--text-hint);
  font-size: 13px;
}

tbody td.juros-col      { color: var(--c3); }
tbody td.amort-col      { color: var(--c2); }
tbody td.saldo-col      { font-weight: 500; color: var(--text-primary); }
tbody td.correcao-col   { color: var(--c4); }

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
  .fi-form-grid     { grid-template-columns: 1fr; }
  .comparativo-grid { grid-template-columns: 1fr; }
}

/* ===== CONTEÚDO EDITORIAL SEO ===== */
.seo-content,
.seo-faq {
  max-width: 900px;
}

.seo-content h2,
.seo-faq h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 24px;
  font-weight: 700;
  margin: 40px 0 14px;
  color: var(--text-primary);
}

.seo-content h2:first-child { margin-top: 0; }

.seo-content p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.seo-content strong { color: var(--text-primary); }

.formula-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--c1);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 16px 0;
  font-size: 18px;
  text-align: center;
}

.formula-box p {
  font-size: 13px;
  margin-top: 10px;
  margin-bottom: 0;
  text-align: center;
  color: var(--text-secondary);
}

.seo-list {
  padding-left: 20px;
  margin-bottom: 16px;
}

.seo-list li {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.seo-list li strong { color: var(--text-primary); }

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.faq-item h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.faq-item p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
}