/* RTGEO — Design System & Estilos do Módulo de Simuladores Avançados */

.simulator-container {
  height: 100%;
  overflow-y: auto;
  padding: 24px 32px;
  background: var(--bg-app);
}

.simulator-subnav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(226, 232, 240, 0.6);
  padding: 4px;
  border-radius: var(--radius-full);
  margin-bottom: 24px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.sim-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sim-tab-btn:hover {
  color: var(--text-main);
}

.sim-tab-btn.active {
  color: var(--primary);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.sim-module-view {
  display: none;
}

.sim-module-view.active {
  display: block;
}

/* 2-Column Responsive Layout */
.sim-grid {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1100px) {
  .sim-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Containers */
.sim-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

.sim-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Range Sliders com Estilo Institucional RT */
.range-group {
  margin-bottom: 18px;
}

.range-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.range-header label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.range-val-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 10px;
  border-radius: var(--radius-sm);
}

.custom-range {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  outline: none;
  transition: background 0.2s;
  cursor: pointer;
}

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(39, 76, 138, 0.35);
  transition: transform 0.1s ease;
}

.custom-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--primary-bright);
}

/* Presets rápidos */
.preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.preset-btn {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-app);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  background: var(--surface);
  border-color: var(--primary);
  color: var(--primary);
}

/* Result Cards & Grids */
.results-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 680px) {
  .results-grid-2 {
    grid-template-columns: 1fr;
  }
}

.system-result-box {
  background: #fafcff;
  border: 1px solid #dbeafe;
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.system-result-box.highlight {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.system-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.system-result-header b {
  font-size: 14px;
  color: var(--primary);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 6px;
}

.stat-row span {
  color: var(--text-muted);
}

.stat-row b {
  font-family: var(--font-mono);
  color: var(--text-main);
}

/* Highlight Banner */
.savings-banner {
  background: linear-gradient(135deg, #26a25c, #1b7a43);
  color: white;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 14px rgba(38, 162, 92, 0.25);
}

.savings-banner b {
  font-size: 16px;
  font-family: var(--font-mono);
}

/* Charts Box */
.chart-container-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.chart-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.canvas-wrapper {
  position: relative;
  height: 260px;
  width: 100%;
}

/* WhatsApp Copy Button */
.btn-whatsapp-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: #25D366;
  color: white;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
  transition: all 0.15s ease;
  margin-top: 12px;
}

.btn-whatsapp-copy:hover {
  background: #1fb355;
  transform: translateY(-1px);
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 600;
  color: var(--text-main);
  background-color: var(--surface);
  outline: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(39, 76, 138, 0.12);
}

/* Calculadora completa de fechamento */
.calculator-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #f7fbff, #eef5ff);
  border: 1px solid #dbeafe;
  border-radius: var(--radius-lg);
}

.calculator-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--primary-bright);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.calculator-intro h3 {
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 18px;
}

.calculator-intro p {
  max-width: 760px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.calculator-status {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.calculator-status.local {
  background: #fff7ed;
  color: #9a3412;
}

.calculator-status.official {
  background: #dcfce7;
  color: #166534;
}

.calculator-status.loading {
  background: #e0f2fe;
  color: #075985;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-hint {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.35;
}

.calculator-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.calculator-divider::after {
  flex: 1;
  height: 1px;
  background: var(--border);
  content: "";
}

.calculator-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.calculator-actions .pill-btn {
  min-height: 36px;
  padding: 8px 14px;
}

.calculator-print-btn {
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
}

.calculator-print-btn:hover {
  background: var(--bg-app);
  border-color: var(--primary);
}

.calculator-notice {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.calculator-notice.error {
  color: #b91c1c;
}

.calculator-notice.success {
  color: #166534;
}

.cost-hero-kicker {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.cost-hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  text-align: right;
}

.cost-hero-side small {
  color: var(--text-muted);
  font-size: 10.5px;
}

.cost-summary-meta {
  padding: 10px 0 2px;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.official-breakdown {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.official-breakdown-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
}

.official-breakdown-list {
  margin-top: 6px;
}

.official-breakdown-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 11px;
}

.official-breakdown-line span:last-child {
  color: var(--text-main);
  font-family: var(--font-mono);
  font-weight: 700;
  white-space: nowrap;
}

.calculator-notes {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.calculator-notes p {
  margin-top: 4px;
}

@media (max-width: 620px) {
  .calculator-intro {
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .cost-hero-side {
    align-items: flex-start;
    text-align: left;
  }
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23274c8a' height='18' viewBox='0 0 24 24' width='18' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 36px;
  cursor: pointer;
}

/* Toggle Buttons for State and Payment Mode */
.btn-group-toggle {
  display: flex;
  background: rgba(226, 232, 240, 0.7);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
  width: 100%;
}

.btn-toggle {
  flex: 1;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.btn-toggle:hover {
  color: var(--text-main);
}

.btn-toggle.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

/* SFH Benefit Card */
.sfh-benefit-card {
  background: #edf8f2;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.sfh-benefit-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--oportunidade);
  cursor: pointer;
  margin-top: 2px;
}

.sfh-text h5 {
  font-size: 12.5px;
  font-weight: 700;
  color: #14532d;
  margin-bottom: 2px;
}

.sfh-text p {
  font-size: 11.5px;
  color: #166534;
  line-height: 1.4;
}

/* Big Hero Card for Total Closing Costs */
.cost-hero-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 2px solid var(--primary-light);
  padding: 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

.cost-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}

.cost-hero-total {
  font-size: 34px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--primary);
  line-height: 1.1;
  margin-top: 4px;
}

.cost-hero-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* Itemized Cost Breakdown Rows */
.itemized-cost-list {
  display: flex;
  flex-direction: column;
  divide-y: divide-y;
  margin-top: 14px;
}

.itemized-cost-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 16px;
}

.itemized-cost-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.itemized-cost-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.itemized-cost-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: #eef3fb;
  color: var(--primary);
}

.itemized-cost-tag.success {
  background: #dcfce7;
  color: #15803d;
}

.itemized-cost-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

.itemized-cost-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
  text-align: right;
  white-space: nowrap;
}

.itemized-cost-value.green {
  color: var(--oportunidade);
}

/* STJ Legal Shield Box */
.stj-shield-box {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.stj-shield-icon {
  width: 28px;
  height: 28px;
  background: #f59e0b;
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.stj-shield-content h5 {
  font-size: 13px;
  font-weight: 700;
  color: #78350f;
  margin-bottom: 3px;
}

.stj-shield-content p {
  font-size: 11.5px;
  color: #92400e;
  line-height: 1.5;
}

/* Toast Feedback */
.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-popup);
  z-index: 9999;
  display: none;
  align-items: center;
  gap: 8px;
}

.toast-msg.show {
  display: flex;
  animation: slideUpToast 0.3s ease;
}

@keyframes slideUpToast {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
