/* ── DEBT-FREE TOOL ── */

/* View toggle */
.debt-input-view { display: block; }
.debt-results-view { display: none; }
.debt-results-view.active { display: block; animation: fadeUp 0.5s ease forwards; }

/* Plain input (no currency/% prefix) */
.field-input.no-currency { padding-left: 16px; }
.field-optional { color: var(--olive-mid); font-weight: 400; font-size: 11px; letter-spacing: 0; }

/* Debt list */
.debt-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.debt-list:empty { margin-bottom: 0; }

.debt-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center; gap: 14px;
  background: var(--cream); border: 0.5px solid var(--cream-border);
  border-radius: var(--radius-md); padding: 14px 18px;
  transition: border-color 0.2s, transform 0.15s;
}
.debt-row:hover { border-color: var(--olive-light); }

.debt-row-rank {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(74,94,56,0.08); border: 0.5px solid var(--olive-light);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 14px; color: var(--olive-text);
  flex-shrink: 0;
}
.debt-row-main { min-width: 0; }
.debt-row-title { font-size: 14px; font-weight: 500; color: var(--olive-text); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.debt-row-meta { font-size: 11px; color: var(--olive-mid); line-height: 1.5; }
.debt-row-meta strong { color: var(--olive-text); font-weight: 500; }
.debt-row-balance {
  font-family: var(--font-display); font-size: 20px; font-weight: 300;
  color: var(--olive-text); line-height: 1; white-space: nowrap;
}
.debt-row-delete {
  width: 30px; height: 30px; border-radius: 50%;
  background: none; border: 0.5px solid var(--cream-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--olive-mid); cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.debt-row-delete:hover { color: #A8432A; border-color: #A8432A; background: rgba(168,67,42,0.06); }

/* Empty state */
.debt-empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 28px 20px; background: var(--cream);
  border: 0.5px dashed var(--cream-border); border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.debt-empty-icon {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(74,94,56,0.05); color: var(--olive-light);
  display: flex; align-items: center; justify-content: center;
}
.debt-empty-text { font-size: 13px; color: var(--olive-mid); text-align: center; line-height: 1.6; }
.debt-list:not(:empty) ~ .debt-empty { display: none; }

/* Add button */
.debt-add-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  color: var(--olive); background: rgba(74,94,56,0.06);
  border: 0.5px solid var(--olive-light); padding: 11px 20px;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.debt-add-btn:hover { background: rgba(74,94,56,0.1); border-color: var(--olive); color: var(--olive-text); }

/* Add form (inline, collapsible) */
.debt-add-form {
  margin-top: 20px; padding: 24px; background: var(--cream);
  border: 0.5px solid var(--olive-light); border-radius: var(--radius-md);
  animation: fadeUp 0.3s ease forwards;
}
.debt-add-form[hidden] { display: none; }
.debt-add-form-title { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; }
.debt-add-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; gap: 12px; }
.debt-add-actions .btn-next { margin-left: auto; }

/* Margin card */
#debt-margin-card { margin-top: 20px; }

/* Warning banner */
.debt-warning {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px; margin-bottom: 20px;
  background: rgba(200,168,106,0.08); border: 0.5px solid var(--gold);
  border-radius: var(--radius-md);
  font-size: 13px; color: var(--olive-text); line-height: 1.6;
}
.debt-warning[hidden] { display: none; }
.debt-warning svg { color: var(--gold); flex-shrink: 0; margin-top: 1px; }

/* Results */
.debt-results-header { text-align: center; padding: 16px 0 32px; }
.debt-results-header .step-num { margin-bottom: 12px; }
.debt-results-header .step-question em { font-style: italic; color: var(--olive); }
.debt-results-header .step-hint { max-width: 520px; margin: 16px auto 0; }

.debt-metrics { margin-bottom: 40px; }

/* Chart */
.debt-chart-wrap {
  background: var(--cream-dark); border: 0.5px solid var(--cream-border);
  border-radius: var(--radius-lg); padding: 28px 28px 20px;
  margin-bottom: 40px;
}
.debt-chart-header { margin-bottom: 18px; }
.debt-chart-header .resultado-section-title { margin-bottom: 0; }
.debt-chart-svg { width: 100%; overflow: hidden; }
.debt-chart-svg svg { display: block; width: 100%; height: auto; }
.debt-chart-svg .chart-grid { stroke: var(--cream-border); stroke-width: 0.5; }
.debt-chart-svg .chart-axis-label { font-family: var(--font-body); font-size: 10px; fill: var(--olive-mid); }
.debt-chart-svg .chart-line { fill: none; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.debt-chart-svg .chart-line-total { stroke-width: 2.2; }
.debt-chart-svg .chart-area { opacity: 0.12; }

.debt-chart-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 18px; padding-top: 16px;
  border-top: 0.5px solid var(--cream-border);
}
.debt-chart-legend-item { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--olive-mid); }
.debt-chart-legend-swatch { width: 14px; height: 2px; border-radius: 2px; flex-shrink: 0; }

/* Timeline list */
.debt-timeline-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 40px; }
.debt-timeline-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px;
  align-items: center; padding: 16px 20px;
  background: var(--cream-dark); border: 0.5px solid var(--cream-border);
  border-radius: var(--radius-md);
}
.debt-timeline-rank {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--olive); color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 16px; font-weight: 300;
  flex-shrink: 0;
}
.debt-timeline-info { min-width: 0; }
.debt-timeline-title { font-size: 14px; font-weight: 500; color: var(--olive-text); margin-bottom: 2px; }
.debt-timeline-sub { font-size: 12px; color: var(--olive-mid); }
.debt-timeline-when {
  font-family: var(--font-display); font-size: 15px; color: var(--olive);
  white-space: nowrap; text-align: right;
}
.debt-timeline-when strong { display: block; font-size: 20px; color: var(--olive-text); font-weight: 300; line-height: 1.2; }

/* Results actions */
.debt-results-actions { margin-top: 16px; }

/* Contact card inside results */
.debt-contact-card { margin-top: 40px; margin-bottom: 16px; }
.debt-contact-card .step-question em { font-style: italic; color: var(--olive); }
.debt-contact-form { margin-top: 8px; }
#debt-contact-submit[data-sending="true"] { opacity: 0.7; pointer-events: none; }

.debt-contact-success {
  margin-top: 40px; margin-bottom: 16px;
  text-align: center; padding: 48px 40px;
  animation: fadeUp 0.5s ease forwards;
}
.debt-contact-success[hidden] { display: none; }
.debt-contact-success .contact-success-icon { margin: 0 auto 20px; width: 56px; height: 56px; }
.debt-contact-success .contact-success-title { font-size: 28px; margin-bottom: 12px; }
.debt-contact-success .contact-success-text { margin-bottom: 0; }
