/* ============================================
   DEBT PAYOFF CALCULATOR
   ============================================ */

.dp-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 3rem;
  align-items: start;
}

.dp-results {
  position: relative;
}

.dp-input-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.dp-field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ---- Debt entry cards ---- */

.dp-debt-entry {
  background: var(--surface);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  position: relative;
}

.dp-debt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.dp-debt-name-input {
  background: none;
  border: none;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
  padding: 0;
  width: 70%;
  outline: none;
}

.dp-debt-name-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.dp-debt-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.15s;
}

.dp-debt-remove:hover {
  color: var(--red);
  background: rgba(239, 68, 68, 0.1);
}

.dp-debt-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}

.dp-debt-field label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.dp-debt-field input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--surface-alt);
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.2s;
}

.dp-debt-field input:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Add button */
.dp-add-btn {
  width: 100%;
  padding: 0.75rem;
  border: 2px dashed var(--surface-alt);
  border-radius: 12px;
  background: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.25rem;
}

.dp-add-btn:hover {
  border-color: var(--emerald);
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.05);
}

/* ---- Winner banner ---- */

.dp-winner-banner {
  background: var(--navy);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  text-align: center;
}

.dp-winner-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--emerald);
  margin-bottom: 0.5rem;
}

.dp-winner-savings {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--white);
}

/* ---- Strategy comparison ---- */

.dp-compare-card {
  background: var(--white);
  border: 1px solid var(--surface-alt);
  border-radius: 16px;
  padding: 1.5rem;
}

.dp-strategy-cols {
  display: flex;
  align-items: stretch;
  gap: 1rem;
}

.dp-strategy {
  flex: 1;
  text-align: center;
}

.dp-strategy-header {
  margin-bottom: 1rem;
}

.dp-strategy-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.dp-avalanche .dp-strategy-icon { color: #EF4444; }
.dp-snowball .dp-strategy-icon { color: #3B82F6; }

.dp-strategy h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0;
}

.dp-strategy-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.dp-vs {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 2px;
}

.dp-strategy-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dp-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.75rem;
  background: var(--surface);
  border-radius: 8px;
  font-size: 0.8rem;
}

.dp-stat-label {
  color: var(--text-muted);
}

.dp-stat-val {
  font-weight: 700;
  color: var(--navy);
}

.dp-stat-interest {
  color: var(--red);
}

/* Highlight winner stat */
.dp-stat-winner {
  background: rgba(16, 185, 129, 0.1);
}

.dp-stat-winner .dp-stat-val {
  color: var(--emerald);
}

/* ---- Payoff timeline ---- */

.dp-timeline-card {
  background: var(--white);
  border: 1px solid var(--surface-alt);
  border-radius: 16px;
  padding: 1.5rem;
}

.dp-timeline-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.dp-timeline-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.dp-timeline-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dp-timeline-name {
  width: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dp-timeline-bars {
  flex: 1;
  position: relative;
  height: 28px;
}

.dp-timeline-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 14px;
  border-radius: 4px;
  transition: width 0.6s var(--ease-out);
  font-size: 0;
}

.dp-timeline-bar-av {
  top: 0;
  background: #EF4444;
  opacity: 0.8;
}

.dp-timeline-bar-sn {
  top: 14px;
  background: #3B82F6;
  opacity: 0.8;
}

.dp-timeline-month-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.dp-timeline-legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--surface-alt);
}

.dp-timeline-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dp-timeline-legend-swatch {
  width: 12px;
  height: 8px;
  border-radius: 2px;
}

/* ---- Schedule table ---- */

.dp-schedule-card {
  background: var(--white);
  border: 1px solid var(--surface-alt);
  border-radius: 16px;
  padding: 1.5rem;
}

.dp-schedule-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1rem;
}

.dp-schedule-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.dp-toggle-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--surface-alt);
  border-radius: 8px;
  background: var(--white);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.dp-toggle-btn:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.dp-toggle-active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.dp-toggle-active:hover {
  color: var(--white);
}

.dp-schedule-table-wrap {
  max-height: 400px;
  overflow-y: auto;
}

.dp-schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.dp-schedule-table th {
  text-align: left;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 0.5rem 0.5rem;
  border-bottom: 2px solid var(--surface-alt);
  position: sticky;
  top: 0;
  background: var(--white);
}

.dp-schedule-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--surface-alt);
  color: var(--text);
}

.dp-schedule-table tr:last-child td {
  border-bottom: none;
}

.dp-schedule-highlight {
  background: rgba(16, 185, 129, 0.05);
  font-weight: 600;
}

/* ---- RESPONSIVE ---- */

@media (max-width: 1024px) {
  .dp-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .fc-results-sticky {
    position: static;
  }
}

@media (max-width: 768px) {
  .dp-strategy-cols {
    flex-direction: column;
    gap: 0.75rem;
  }

  .dp-vs {
    justify-content: center;
  }

  .dp-debt-fields {
    grid-template-columns: 1fr;
  }

  .dp-winner-savings {
    font-size: 1.25rem;
  }

  .dp-timeline-name {
    width: 70px;
    font-size: 0.7rem;
  }
}
