/* Budget Calculator Styles */

/* Hero */
.budget-hero {
  background: linear-gradient(135deg, #1E3A5F 0%, #1E88E5 50%, #059669 100%);
  color: white;
  padding: 80px 0 60px;
  text-align: center;
}

.budget-hero h1 {
  font-size: 2.6rem;
  font-weight: 900;
  margin-bottom: 20px;
  line-height: 1.2;
}

.budget-hero .lead {
  font-size: 1.15rem;
  opacity: 0.92;
  margin-bottom: 32px;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.budget-hero-badges {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 0;
}

.budget-hero-badge {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 24px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Calculator Section */
.budget-calculator-section {
  padding: 48px 0;
  background: #f8faff;
}

/* Calculator Card */
.budget-card {
  background: white;
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.budget-card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.budget-card-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.budget-card-subtitle {
  color: #6b7280;
  font-size: 0.9rem;
}

/* Section headers inside form */
.budget-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1E3A5F;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 8px;
}

.budget-section-title:first-of-type {
  margin-top: 0;
}

/* Form Groups */
.budget-form-group {
  margin-bottom: 1.25rem;
}

.budget-form-label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  display: block;
  font-size: 0.95rem;
}

.budget-form-input {
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
  width: 100%;
  font-family: 'Inter', sans-serif;
}

.budget-form-input:focus {
  outline: none;
  border-color: #1E88E5;
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.12);
}

.budget-form-hint {
  font-size: 0.82rem;
  color: #9ca3af;
  margin-top: 4px;
}

/* Slider row */
.budget-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.budget-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  outline: none;
}

.budget-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E88E5, #1565C0);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
}

.budget-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E88E5, #1565C0);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
}

.budget-value-display {
  min-width: 100px;
  text-align: right;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1E3A5F;
  white-space: nowrap;
}

/* Two column grid for expense inputs */
.budget-expense-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Submit button */
.btn-budget-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 18px 24px;
  background: linear-gradient(135deg, #1E88E5, #1565C0);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  margin-top: 1.5rem;
}

.btn-budget-primary:hover {
  background: linear-gradient(135deg, #1565C0, #0D47A1);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 136, 229, 0.3);
}

/* Result card */
.budget-result-card {
  margin-top: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 100%);
  border-radius: 20px;
  border: 1px solid #e0e7ff;
}

.budget-result-big {
  text-align: center;
  font-size: 2.4rem;
  font-weight: 900;
  color: #059669;
  margin-bottom: 4px;
}

.budget-result-subtitle {
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* Stats grid */
.budget-result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: center;
  margin-bottom: 24px;
}

.budget-result-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1E3A5F;
}

.budget-result-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-top: 2px;
  font-weight: 600;
}

/* Budget distribution bar */
.budget-dist-bar {
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  height: 32px;
  margin-bottom: 8px;
}

.budget-dist-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  transition: width 0.5s ease;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.budget-dist-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  justify-content: center;
}

.budget-dist-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #374151;
}

.budget-dist-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Breakdown table */
.budget-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.budget-breakdown-table td {
  padding: 10px 12px;
  font-size: 0.9rem;
  border-bottom: 1px solid #f3f4f6;
}

.budget-breakdown-table td:first-child {
  color: #6b7280;
}

.budget-breakdown-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: #1f2937;
}

.budget-breakdown-table tr.budget-row-total td {
  border-top: 2px solid #1E88E5;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1E3A5F;
}

.budget-breakdown-table tr.budget-row-highlight td {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.06), rgba(30, 136, 229, 0.06));
  font-weight: 700;
  color: #059669;
}

/* 50/30/20 breakdown */
.budget-rule-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 20px;
  border: 1px solid #e5e7eb;
}

.budget-rule-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1E3A5F;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.budget-rule-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}

.budget-rule-row:last-child {
  border-bottom: none;
}

.budget-rule-label {
  font-size: 0.9rem;
  color: #374151;
}

.budget-rule-values {
  display: flex;
  align-items: center;
  gap: 12px;
}

.budget-rule-percent {
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  min-width: 42px;
  text-align: center;
}

.budget-rule-amount {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1E3A5F;
  min-width: 100px;
  text-align: right;
}

/* DTI warning/info */
.budget-dti-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  margin-top: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.budget-dti-info.safe {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.budget-dti-info.warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
}

.budget-dti-info.danger {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

/* Save / Compare row */
.budget-save-row {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.btn-budget-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: white;
  color: #374151;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.btn-budget-secondary:hover {
  border-color: #1E88E5;
  color: #1E88E5;
  background: #f0f4ff;
}

/* Disclaimer */
.budget-disclaimer {
  margin-top: 24px;
  padding: 16px;
  background: #fefce8;
  border: 1px solid #fef08a;
  border-radius: 12px;
  font-size: 0.82rem;
  color: #854d0e;
  line-height: 1.6;
}

/* Educational Section */
.budget-edu-section {
  padding: 64px 0;
  background: white;
}

.budget-edu-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #1E3A5F;
  margin-bottom: 24px;
  line-height: 1.3;
}

.budget-edu-definition {
  font-size: 1.02rem;
  line-height: 1.8;
  color: #374151;
  padding: 20px;
  border-left: 4px solid #1E88E5;
  background: #f8faff;
  border-radius: 0 12px 12px 0;
  margin-bottom: 32px;
}

/* Steps */
.budget-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.budget-step-card {
  background: #f8faff;
  border: 1px solid #e0e7ff;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.budget-step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E88E5, #1565C0);
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.budget-step-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #1E3A5F;
  margin-bottom: 8px;
}

.budget-step-card p {
  font-size: 0.88rem;
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
}

/* FAQ Section */
.budget-faq-section {
  padding: 64px 0;
  background: #f8faff;
}

.budget-faq-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #1E3A5F;
  margin-bottom: 8px;
}

.budget-faq-lead {
  color: #6b7280;
  font-size: 1rem;
  margin-bottom: 32px;
}

.budget-faq-item {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.budget-faq-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.budget-faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  cursor: pointer;
  font-weight: 600;
  color: #1E3A5F;
  font-size: 0.95rem;
  user-select: none;
}

.budget-faq-question:hover {
  color: #1E88E5;
}

.budget-faq-chevron {
  transition: transform 0.3s;
  flex-shrink: 0;
  color: #9ca3af;
}

.budget-faq-item.open .budget-faq-chevron {
  transform: rotate(180deg);
}

.budget-faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.budget-faq-item.open .budget-faq-answer {
  max-height: 600px;
  padding: 0 20px 18px;
}

.budget-faq-answer p {
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 0 0 8px;
}

.budget-faq-answer p:last-child {
  margin-bottom: 0;
}

/* CTA Section */
.budget-final-cta {
  background: linear-gradient(135deg, #1E3A5F 0%, #1E88E5 100%);
  padding: 64px 0;
  text-align: center;
  color: white;
}

.budget-final-cta h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.budget-final-cta p {
  opacity: 0.9;
  font-size: 1.05rem;
  margin-bottom: 28px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.budget-cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-budget-cta-white {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  background: white;
  color: #1E3A5F;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-budget-cta-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  color: #1E3A5F;
}

.btn-budget-cta-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-budget-cta-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
  color: white;
}

/* Toast notification */
.budget-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
}

.budget-toast-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.budget-toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: #1E3A5F;
  color: white;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
  .budget-hero {
    padding: 60px 0 40px;
  }

  .budget-hero h1 {
    font-size: 1.8rem;
  }

  .budget-hero .lead {
    font-size: 1rem;
  }

  .budget-card {
    padding: 1.5rem;
  }

  .budget-expense-grid {
    grid-template-columns: 1fr;
  }

  .budget-result-stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .budget-result-big {
    font-size: 1.8rem;
  }

  .budget-steps {
    grid-template-columns: 1fr;
  }

  .budget-hero-badges {
    gap: 8px;
  }

  .budget-hero-badge {
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  .budget-dist-bar {
    height: 24px;
  }

  .budget-dist-segment {
    font-size: 0.65rem;
  }

  .budget-rule-values {
    gap: 8px;
  }

  .budget-rule-amount {
    min-width: 80px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .budget-hero h1 {
    font-size: 1.5rem;
  }

  .budget-slider-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .budget-value-display {
    text-align: center;
  }
}
