/* Early Retirement Feasibility Calculator */
/* Scoped with .erf- to avoid theme collisions */

.erf-wrapper {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.erf-loading {
  font-size: 0.95rem;
  color: #555;
}

.erf-calculator {
  border: 1px solid #083141;
  border-radius: 16px;
  padding: 1.5rem;
  background: #f8fbfd;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.erf-step {
  border-radius: 12px;
  background: #ffffff;
  padding: 1.25rem 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid #e2e8f0;
}

.erf-step--results {
  border-style: dashed;
}

.erf-step-title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #083141;
}

.erf-step-help {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: #4b5563;
}

.erf-grid {
  display: grid;
  gap: 0.75rem 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 0.5rem;
}

.erf-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.erf-field-inline {
  margin-top: 0.75rem;
}

.erf-label {
  font-size: 0.85rem;
  color: #374151;
}

.erf-input {
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
}

.erf-input:focus {
  outline: none;
  border-color: #083141;
  box-shadow: 0 0 0 1px rgba(8, 49, 65, 0.15);
}

.erf-input--swr-custom,
.erf-input--returns-custom {
  margin-top: 0.5rem;
  max-width: 120px;
}

.erf-input--inline {
  display: inline-block;
  width: auto;
  min-width: 60px;
  max-width: 80px;
  padding: 0.3rem 0.5rem;
  margin: 0 0.25rem;
  font-size: 0.85rem;
}

/* Chips */

.erf-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.erf-chip {
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f9fafb;
  padding: 0.2rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.erf-chip:hover {
  background: #e5edf5;
}

.erf-chip--active {
  border-color: #083141;
  background: #083141;
  color: #ffffff;
}

.erf-chip--add {
  border-color: #16a34a;
  color: #16a34a;
}

.erf-chip--add:hover {
  background: #dcfce7;
  border-color: #15803d;
  color: #15803d;
}

.erf-chip--remove {
  border-color: #dc2626;
  color: #dc2626;
  padding: 0.2rem 0.5rem;
  min-width: 30px;
}

.erf-chip--remove:hover {
  background: #fee2e2;
  border-color: #b91c1c;
  color: #b91c1c;
}

/* Spending Taper Config */

.erf-taper-config {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
}

.erf-taper-help {
  font-size: 0.85rem;
  color: #0c4a6e;
  line-height: 1.6;
}

/* Other Income Section */

.erf-other-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.erf-other-row {
  display: grid;
  grid-template-columns: 1fr 1fr 120px 40px;
  gap: 0.75rem;
  align-items: end;
  padding: 0.75rem;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

@media (max-width: 768px) {
  .erf-other-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .erf-other-row .erf-chip--remove {
    justify-self: start;
    margin-top: 0.25rem;
  }
}

/* Results */

.erf-results {
  margin-top: 0.75rem;
}

.erf-btn-download {
  display: block;
  width: 100%;
  margin: 1rem 0;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  border: 1px solid #083141;
  background: #083141;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.erf-btn-download:hover {
  background: #0a3f56;
  border-color: #0a3f56;
  box-shadow: 0 2px 8px rgba(8, 49, 65, 0.2);
  transform: translateY(-1px);
}

.erf-btn-download:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(8, 49, 65, 0.2);
}

.erf-results-headline {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 800px) {
  .erf-results-headline {
    grid-template-columns: minmax(0, 1fr);
  }
}

.erf-results-card {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f9fafb;
  padding: 0.9rem 1rem;
}

.erf-results-card--fire {
  border: 2px solid #f97316;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
}

.erf-results-card--success {
  border: 2px solid #15803d;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.15);
}

.erf-results-card--fail {
  border-color: #b91c1c;
  background: #fef2f2;
}

.erf-results-card--warn {
  border-color: #d97706;
  background: #fffbeb;
  margin-bottom: 1rem;
}

.erf-fire-icon {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 1.4rem;
  vertical-align: middle;
}

.erf-stress-test-box {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 2px solid #0891b2;
  background: #ecfeff;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #164e63;
}

.erf-results-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.erf-results-value {
  font-size: 1.4rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
}

.erf-results-sub {
  font-size: 0.85rem;
  color: #4b5563;
}

/* Table */

.erf-table-wrapper {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.erf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.erf-table thead {
  background: #ebf2f4;
}

.erf-table th,
.erf-table td {
  padding: 0.4rem 0.5rem;
  text-align: right;
  white-space: nowrap;
}

.erf-table th:first-child,
.erf-table td:first-child,
.erf-table th:nth-child(2),
.erf-table td:nth-child(2) {
  text-align: left;
}

.erf-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

/* Responsiveness */

@media (max-width: 600px) {
  .erf-calculator {
    padding: 1rem;
  }
  .erf-step {
    padding: 1rem;
  }
}
