/* Supreme Finance Calculators — calculators.css */

:root {
  --sfc-primary: #1a3a6b;
  --sfc-accent: #f59e0b;
  --sfc-accent-hover: #d97706;
  --sfc-text: #1f2937;
  --sfc-muted: #6b7280;
  --sfc-border: #e5e7eb;
  --sfc-bg: #ffffff;
  --sfc-bg-light: #f9fafb;
  --sfc-bg-hover: #f3f4f6;
  --sfc-success: #22c55e;
  --sfc-danger: #ef4444;
  --sfc-radius: 12px;
  --sfc-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* Base */
.sfc-calculator,
.sfc-hub {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--sfc-text);
  box-sizing: border-box;
}

.sfc-calculator *,
.sfc-hub * {
  box-sizing: border-box;
}

/* Single Calculator Card */
.sfc-calculator {
  background: var(--sfc-bg);
  border: 1px solid var(--sfc-border);
  border-radius: var(--sfc-radius);
  padding: 32px;
  max-width: 640px;
  margin: 0 auto 24px;
  box-shadow: var(--sfc-shadow);
}

.sfc-calc-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--sfc-primary);
  margin: 0 0 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--sfc-accent);
  display: inline-block;
}

/* Form */
.sfc-form { display: flex; flex-direction: column; gap: 16px; }

.sfc-field { display: flex; flex-direction: column; gap: 6px; }
.sfc-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sfc-text);
}
.sfc-field-group {
  border: 1px solid var(--sfc-border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--sfc-bg-light);
}
.sfc-group-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sfc-primary);
}
.sfc-field-inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
.sfc-field-inline label { margin-bottom: 0; }

/* Inputs */
.sfc-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.sfc-prefix, .sfc-suffix {
  position: absolute;
  font-weight: 600;
  color: var(--sfc-muted);
  font-size: 0.9rem;
  pointer-events: none;
  user-select: none;
}
.sfc-prefix { left: 12px; }
.sfc-suffix { right: 12px; }
.sfc-input-wrap input { padding-left: 26px; }
.sfc-input-wrap input:has(~ .sfc-suffix) { padding-right: 36px; }

input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--sfc-border);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--sfc-text);
  background: var(--sfc-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--sfc-primary);
  box-shadow: 0 0 0 3px rgba(26,58,107,0.1);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
/* Remove number input spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; }
input[type=number] { -moz-appearance: textfield; }

/* Button */
.sfc-btn {
  padding: 13px 28px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.01em;
  margin-top: 8px;
}
.sfc-calculate-btn {
  background: var(--sfc-primary);
  color: #fff;
}
.sfc-calculate-btn:hover {
  background: #0f2548;
  transform: translateY(-1px);
}
.sfc-calculate-btn:active { transform: translateY(0); }
.sfc-calculate-btn.sfc-loading {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Results */
.sfc-results { margin-top: 28px; }
.sfc-result-hero {
  background: linear-gradient(135deg, var(--sfc-primary) 0%, #2c5282 100%);
  color: #fff;
  border-radius: 10px;
  padding: 24px 28px;
  text-align: center;
  margin-bottom: 16px;
}
.sfc-result-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
  margin-bottom: 6px;
}
.sfc-result-value {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.1;
}
.sfc-result-sub {
  display: block;
  font-size: 0.85rem;
  opacity: 0.75;
  margin-top: 4px;
  text-transform: capitalize;
}
.sfc-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.sfc-result-card {
  background: var(--sfc-bg-light);
  border: 1px solid var(--sfc-border);
  border-radius: 8px;
  padding: 14px 16px;
}
.sfc-result-card span {
  display: block;
  font-size: 0.78rem;
  color: var(--sfc-muted);
  font-weight: 500;
  margin-bottom: 4px;
}
.sfc-result-card strong {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--sfc-primary);
}
.sfc-result-card.sfc-highlight {
  border-color: var(--sfc-accent);
  background: #fffbeb;
}
.sfc-result-card.sfc-highlight strong { color: #92400e; }

.sfc-disclaimer {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--sfc-muted);
  line-height: 1.5;
  border-top: 1px solid var(--sfc-border);
  padding-top: 12px;
}
.sfc-note {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Error */
.sfc-error {
  margin-top: 16px;
  padding: 12px 16px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Credit Score */
.sfc-score-hero { position: relative; overflow: hidden; }
.sfc-score-display { font-size: 3rem !important; }
.sfc-score-band {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 4px;
  opacity: 0.95;
}
.sfc-score-bar {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,0.25);
  border-radius: 99px;
  margin-top: 14px;
  overflow: hidden;
}
.sfc-score-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--sfc-accent);
  transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 0%;
}
.sfc-score-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  opacity: 0.7;
  margin-top: 4px;
}
.sfc-tips-section {
  margin-top: 16px;
  padding: 14px 16px;
  background: #eff6ff;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
}
.sfc-tips-section strong {
  display: block;
  color: #1e40af;
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.sfc-tips-list { margin: 0; padding-left: 18px; }
.sfc-tips-list li {
  font-size: 0.875rem;
  color: #1e3a8a;
  margin-bottom: 4px;
  line-height: 1.4;
}

/* Hub Tabs */
.sfc-hub { max-width: 720px; margin: 0 auto; }
.sfc-hub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--sfc-bg-light);
  border: 1px solid var(--sfc-border);
  border-radius: var(--sfc-radius) var(--sfc-radius) 0 0;
  padding: 8px 8px 0;
  border-bottom: none;
}
.sfc-tab {
  padding: 8px 14px;
  border: none;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--sfc-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.sfc-tab:hover { background: var(--sfc-bg-hover); color: var(--sfc-primary); }
.sfc-tab.active {
  background: var(--sfc-bg);
  color: var(--sfc-primary);
  border: 1px solid var(--sfc-border);
  border-bottom: 1px solid var(--sfc-bg);
  margin-bottom: -1px;
}
.sfc-tab-panels {
  border: 1px solid var(--sfc-border);
  border-radius: 0 var(--sfc-radius) var(--sfc-radius) var(--sfc-radius);
  background: var(--sfc-bg);
}
.sfc-panel { display: none; }
.sfc-panel.active { display: block; }
/* In hub, remove card shadow/border from inner calculators */
.sfc-hub .sfc-calculator {
  box-shadow: none;
  border: none;
  border-radius: 0;
  max-width: 100%;
  margin: 0;
}

/* FHOG special */
.sfc-grant-eligible .sfc-result-value { color: #bbf7d0; }

/* Responsive */
@media (max-width: 600px) {
  .sfc-calculator { padding: 20px 16px; }
  .sfc-result-grid { grid-template-columns: 1fr 1fr; }
  .sfc-result-value { font-size: 1.7rem; }
  .sfc-hub-tabs { gap: 2px; }
  .sfc-tab { padding: 7px 9px; font-size: 0.75rem; }
}
@media (max-width: 420px) {
  .sfc-result-grid { grid-template-columns: 1fr; }
  .sfc-tab { font-size: 0.7rem; padding: 6px 7px; }
}

/* Loading spinner */
@keyframes sfc-spin {
  to { transform: rotate(360deg); }
}
.sfc-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sfc-spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

/* ── v2 additions ── */

/* Hub header */
.sfc-hub-header {
  padding: 28px 28px 0;
  border-bottom: none;
}
.sfc-hub-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--sfc-primary);
  margin: 0 0 4px;
}
.sfc-hub-subtitle {
  font-size: 0.9rem;
  color: var(--sfc-muted);
  margin: 0 0 16px;
}

/* Hot / New badges */
.sfc-badge-hot {
  display: inline-block;
  background: #ef4444;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.4;
}
.sfc-badge-new {
  display: inline-block;
  background: #22c55e;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.4;
}

/* Assessor verdict hero */
.sfc-assessor-verdict {
  background: linear-gradient(135deg, var(--sfc-primary) 0%, #2c5282 100%);
  color: #fff;
  border-radius: 10px;
  padding: 24px 28px;
  text-align: center;
}
.sfc-feasibility-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  margin: 6px 0 0;
}

/* Costs breakdown table */
.sfc-costs-breakdown { margin-top: 16px; }
.sfc-cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--sfc-border);
  font-size: 0.9rem;
}
.sfc-cost-row span { color: var(--sfc-text); }
.sfc-cost-row strong { color: var(--sfc-primary); font-weight: 700; }
.sfc-cost-row.sfc-cost-total {
  border-top: 2px solid var(--sfc-primary);
  border-bottom: none;
  font-weight: 700;
  font-size: 1rem;
  margin-top: 4px;
  padding-top: 12px;
}
.sfc-cost-total span { color: var(--sfc-primary); font-weight: 700; }
.sfc-cost-total strong { font-size: 1.15rem; }

/* Buy vs Save recommendation */
.sfc-recommendation-box {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* RBA scenarios table */
.sfc-rba-scenarios {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.sfc-rba-scenario-card {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px 14px;
  text-align: center;
}
.sfc-rba-scenario-card .sfc-sc-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1e40af;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.sfc-rba-scenario-card .sfc-sc-rate {
  display: block;
  font-size: 0.9rem;
  color: #374151;
  margin-bottom: 2px;
}
.sfc-rba-scenario-card .sfc-sc-repayment {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--sfc-primary);
}
.sfc-rba-scenario-card .sfc-sc-saving {
  display: block;
  font-size: 0.8rem;
  color: #22c55e;
  font-weight: 600;
  margin-top: 2px;
}

/* Responsive hub tabs for 17 items */
@media (max-width: 768px) {
  .sfc-hub-tabs { gap: 3px; padding: 6px 6px 0; }
  .sfc-tab { font-size: 0.7rem; padding: 6px 8px; }
  .sfc-badge-hot, .sfc-badge-new { display: none; }
}
@media (max-width: 480px) {
  .sfc-tab { font-size: 0.65rem; padding: 5px 6px; }
}
