/* ============================================================
   WiseIQ — Shared Calculator Design System
   Applies to all calculator pages. Requires premium.css + style.css loaded first.
   ============================================================ */

/* ── Layout ── */
.calc-page-hero {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 100%);
  padding: 100px 0 48px;
  color: #fff;
}
.calc-page-hero .breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.calc-page-hero .breadcrumb a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color 0.15s;
}
.calc-page-hero .breadcrumb a:hover { color: #fff; }
.calc-page-hero .breadcrumb-sep { opacity: 0.4; }
.calc-page-hero .page-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  margin-bottom: 16px;
}
.calc-page-hero h1 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 900;
  color: #fff;
  line-height: 1.15;
  margin: 0 0 12px;
}
.calc-page-hero p {
  font-size: 16px;
  color: rgba(255,255,255,0.7);
  max-width: 560px;
  line-height: 1.6;
  margin: 0;
}

/* ── Main calc area ── */
.calc-body {
  background: #F8FAFC;
  padding: 40px 0 64px;
}
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) {
  .calc-grid { grid-template-columns: 1fr; }
}

/* ── Cards ── */
.calc-panel {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.calc-panel-title {
  font-size: 15px;
  font-weight: 800;
  color: #0F172A;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #F1F5F9;
}

/* ── Form fields ── */
.calc-field {
  margin-bottom: 18px;
}
.calc-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 7px;
}
.calc-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.calc-input-wrap .prefix,
.calc-input-wrap .suffix {
  position: absolute;
  font-size: 14px;
  font-weight: 600;
  color: #94A3B8;
  pointer-events: none;
}
.calc-input-wrap .prefix { left: 13px; }
.calc-input-wrap .suffix { right: 13px; }
.calc-input-wrap input {
  width: 100%;
  height: 46px;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #0F172A;
  background: #F8FAFC;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.calc-input-wrap.has-prefix input { padding-left: 28px; }
.calc-input-wrap.has-suffix input { padding-right: 32px; }
.calc-input-wrap:not(.has-prefix):not(.has-suffix) input { padding: 0 14px; }
.calc-input-wrap input:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  background: #fff;
}
.calc-input-wrap input::-webkit-inner-spin-button,
.calc-input-wrap input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.calc-input-wrap input[type=number] { -moz-appearance: textfield; }

/* Select */
.calc-select-wrap select {
  width: 100%;
  height: 46px;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #0F172A;
  background: #F8FAFC url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  -webkit-appearance: none;
  appearance: none;
  padding: 0 36px 0 14px;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
}
.calc-select-wrap select:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Segment toggle (payment vs months) */
.calc-toggle {
  display: flex;
  background: #F1F5F9;
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
}
.calc-toggle-btn {
  flex: 1;
  padding: 9px 12px;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #64748B;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.calc-toggle-btn.active {
  background: #fff;
  color: #1E40AF;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* Primary calculate button */
.calc-btn-primary {
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, #1E40AF 0%, #2563EB 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.15s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.calc-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.35);
}
.calc-btn-primary:active { transform: translateY(0); }

/* ── Results panel ── */
.calc-results-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  text-align: center;
  color: #94A3B8;
  gap: 12px;
}
.calc-results-empty svg { opacity: 0.35; }
.calc-results-empty p { font-size: 14px; margin: 0; }

.calc-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.calc-stat {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px 16px;
}
.calc-stat.highlight {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border-color: #BFDBFE;
}
.calc-stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94A3B8;
  margin-bottom: 4px;
}
.calc-stat.highlight .calc-stat-label { color: #3B82F6; }
.calc-stat-value {
  font-size: 22px;
  font-weight: 900;
  color: #0F172A;
  line-height: 1.1;
}
.calc-stat.highlight .calc-stat-value { color: #1E40AF; }
.calc-stat-sub {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 2px;
}

/* Bar chart (principal vs interest) */
.calc-bar-chart {
  margin: 16px 0;
}
.calc-bar-chart-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  margin-bottom: 6px;
}
.calc-bar-track {
  display: flex;
  height: 10px;
  border-radius: 100px;
  overflow: hidden;
  background: #E2E8F0;
}
.calc-bar-principal {
  background: #2563EB;
  transition: width 0.5s ease;
  border-radius: 100px 0 0 100px;
}
.calc-bar-interest {
  background: #F59E0B;
  transition: width 0.5s ease;
  flex: 1;
  border-radius: 0 100px 100px 0;
}
.calc-bar-legend {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}
.calc-bar-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748B;
}
.calc-bar-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* DTI meter */
.dti-meter-wrap { margin: 16px 0; }
.dti-meter-track {
  height: 12px;
  background: #E2E8F0;
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}
.dti-meter-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.6s ease, background 0.3s;
}
.dti-meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94A3B8;
  margin-top: 5px;
}
.dti-big-score {
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
  margin: 0 0 4px;
}
.dti-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
}

/* Savings progress */
.savings-progress-wrap { margin: 16px 0; }
.savings-progress-track {
  height: 10px;
  background: #E2E8F0;
  border-radius: 100px;
  overflow: hidden;
}
.savings-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563EB, #10B981);
  border-radius: 100px;
  transition: width 0.6s ease;
}
.savings-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94A3B8;
  margin-top: 5px;
}

/* HYSA comparison box */
.calc-hysa-box {
  background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
  border: 1px solid #BBF7D0;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}
.calc-hysa-box-title {
  font-size: 13px;
  font-weight: 700;
  color: #15803D;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.calc-hysa-box p {
  font-size: 13px;
  color: #166534;
  line-height: 1.5;
  margin: 0;
}

/* CTA box inside results */
.calc-cta-box {
  background: linear-gradient(135deg, #1E40AF 0%, #2563EB 100%);
  border-radius: 14px;
  padding: 20px;
  margin-top: 20px;
  text-align: center;
  color: #fff;
}
.calc-cta-box h3 {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
}
.calc-cta-box p {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  margin: 0 0 14px;
  line-height: 1.5;
}
.calc-cta-btn {
  display: inline-block;
  background: #fff;
  color: #1E40AF;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 22px;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.15s;
}
.calc-cta-btn:hover {
  background: #EFF6FF;
  transform: translateY(-1px);
}
.calc-cta-disclaimer {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 8px;
}

/* Debt consolidation — multi-debt rows */
.debt-row {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
}
.debt-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.debt-row-label {
  font-size: 13px;
  font-weight: 700;
  color: #1E40AF;
}
.debt-row-remove {
  background: none;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  transition: color 0.15s;
}
.debt-row-remove:hover { color: #EF4444; }
.debt-row-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
@media (max-width: 600px) {
  .debt-row-fields { grid-template-columns: 1fr; }
}
.add-debt-btn {
  width: 100%;
  height: 42px;
  background: #F1F5F9;
  border: 1.5px dashed #CBD5E1;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.add-debt-btn:hover {
  background: #EFF6FF;
  border-color: #93C5FD;
  color: #1E40AF;
}

/* Before/after comparison */
.calc-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.calc-compare-col {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 12px 14px;
}
.calc-compare-col.after {
  background: #EFF6FF;
  border-color: #BFDBFE;
}
.calc-compare-col-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94A3B8;
  margin-bottom: 8px;
}
.calc-compare-col.after .calc-compare-col-label { color: #3B82F6; }
.calc-compare-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #F1F5F9;
  font-size: 13px;
}
.calc-compare-row:last-child { border-bottom: none; }
.calc-compare-row-label { color: #64748B; }
.calc-compare-row-value { font-weight: 700; color: #0F172A; }
.calc-compare-col.after .calc-compare-row-value { color: #1E40AF; }

/* Savings badge */
.calc-savings-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
  border: 1px solid #BBF7D0;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
  text-align: center;
}
.calc-savings-badge-amount {
  font-size: 28px;
  font-weight: 900;
  color: #15803D;
}
.calc-savings-badge-label {
  font-size: 13px;
  color: #166534;
  font-weight: 600;
}

/* Amortization table */
.calc-amort-wrap {
  margin-top: 16px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
}
.calc-amort-title {
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  padding: 12px 16px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}
.calc-amort-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.calc-amort-table th {
  background: #F1F5F9;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748B;
  padding: 8px 12px;
  text-align: right;
}
.calc-amort-table th:first-child { text-align: left; }
.calc-amort-table td {
  padding: 8px 12px;
  color: #334155;
  text-align: right;
  border-top: 1px solid #F1F5F9;
}
.calc-amort-table td:first-child { text-align: left; font-weight: 600; }
.calc-amort-table tr:hover td { background: #F8FAFC; }

/* Editorial section below calculator */
.calc-editorial {
  background: #fff;
  padding: 56px 0;
  border-top: 1px solid #F1F5F9;
}
.calc-editorial h2 {
  font-size: 22px;
  font-weight: 800;
  color: #0F172A;
  margin: 0 0 14px;
}
.calc-editorial h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
  margin: 24px 0 8px;
}
.calc-editorial p {
  font-size: 15px;
  color: #475569;
  line-height: 1.75;
  margin: 0 0 14px;
}
.calc-editorial ul {
  padding-left: 20px;
  margin: 0 0 16px;
}
.calc-editorial ul li {
  font-size: 15px;
  color: #475569;
  line-height: 1.7;
  margin-bottom: 6px;
}
.calc-tip-box {
  background: #EFF6FF;
  border-left: 4px solid #2563EB;
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  margin: 20px 0;
}
.calc-tip-box strong {
  font-size: 13px;
  font-weight: 700;
  color: #1E40AF;
  display: block;
  margin-bottom: 4px;
}
.calc-tip-box p {
  font-size: 13px;
  color: #1E40AF;
  margin: 0;
  line-height: 1.5;
}

/* FAQ */
.calc-faq { margin-top: 40px; }
.calc-faq h2 {
  font-size: 20px;
  font-weight: 800;
  color: #0F172A;
  margin: 0 0 20px;
}
.calc-faq-item {
  border-bottom: 1px solid #F1F5F9;
  padding: 16px 0;
}
.calc-faq-item:last-child { border-bottom: none; }
.calc-faq-q {
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 6px;
}
.calc-faq-a {
  font-size: 14px;
  color: #475569;
  line-height: 1.65;
  margin: 0;
}

/* Disclosure */
.calc-disclosure {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: #1E40AF;
  line-height: 1.6;
  margin-bottom: 24px;
}
.calc-disclosure a { color: #1E40AF; font-weight: 700; }

/* Responsive */
@media (max-width: 640px) {
  .calc-stat-grid { grid-template-columns: 1fr 1fr; }
  .calc-compare-grid { grid-template-columns: 1fr; }
  .calc-panel { padding: 20px; }
  .calc-page-hero { padding: 88px 0 36px; }
}

/* ── Secondary button (add debt) ── */
.calc-btn-secondary {
  width: 100%;
  height: 42px;
  background: #F1F5F9;
  border: 1.5px dashed #CBD5E1;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.calc-btn-secondary:hover {
  background: #EFF6FF;
  border-color: #93C5FD;
  color: #1E40AF;
}

/* ── Debt row remove button (text style) ── */
.debt-row-remove {
  background: none;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  transition: color 0.15s;
  font-family: inherit;
}
.debt-row-remove:hover { color: #EF4444; }

/* ── Debt consolidation compare table ── */
.calc-compare-table {
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.calc-compare-table .calc-compare-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  padding: 10px 14px;
  border-bottom: 1px solid #F1F5F9;
  font-size: 13px;
  align-items: center;
}
.calc-compare-table .calc-compare-row:last-child { border-bottom: none; }
.calc-compare-table .calc-compare-row.header {
  background: #F8FAFC;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94A3B8;
}
.calc-compare-table .calc-compare-row > div:not(:first-child) {
  text-align: right;
  font-weight: 700;
  color: #0F172A;
}
.calc-compare-table .calc-compare-row > div:first-child { color: #64748B; }
.calc-compare-table .calc-compare-row .highlight-val { color: #1E40AF; }

/* ── Savings banner (consolidation) ── */
.calc-savings-banner {
  border: 1px solid #BBF7D0;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.calc-savings-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94A3B8;
  margin-bottom: 4px;
}
.calc-savings-amount {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 4px;
}
.calc-savings-sub {
  font-size: 12px;
  color: #64748B;
}

/* ── HYSA comparison (savings calc) ── */
.calc-hysa-compare {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 12px;
  padding: 14px;
  margin-top: 16px;
}
.calc-hysa-compare-title {
  font-size: 13px;
  font-weight: 700;
  color: #15803D;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Field hint text ── */
.calc-field-hint {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 5px;
  line-height: 1.4;
}
