/* Financial Calculators — light ff-* design system (Inter, white panels). */

.fc-shell {
  --ff-bg: #f7f9fc;
  --ff-panel: #ffffff;
  --ff-border: #e5eaf1;
  --ff-text: #0f172a;
  --ff-muted: #64748b;
  --ff-blue: #2563eb;
  --ff-blue-soft: #eff6ff;
  --ff-green: #16a34a;
  --ff-green-soft: #f0fdf4;
  --ff-red: #dc2626;
  --ff-red-soft: #fef2f2;
  --ff-amber: #d97706;
  --ff-amber-soft: #fffbeb;
  --ff-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 16px rgba(15, 23, 42, 0.06);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  color: var(--ff-text);
  line-height: 1.55;
}

.fc-shell h1, .fc-shell h2, .fc-shell h3 { line-height: 1.25; }

/* ── Hero (hub) ─────────────────────────────────────────────── */
.fc-hero {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid var(--ff-border);
  border-radius: 16px;
  padding: 28px 26px;
  margin-bottom: 22px;
}
.fc-hero h1 { font-size: 1.65rem; font-weight: 800; margin-bottom: 8px; }
.fc-hero-sub { color: #334155; max-width: 860px; margin-bottom: 14px; font-size: 0.98rem; }
.fc-search-wrap input {
  width: 100%;
  max-width: 460px;
  padding: 11px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  outline: none;
}
.fc-search-wrap input:focus { border-color: var(--ff-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.fc-updated { margin-top: 10px; font-size: 0.78rem; color: var(--ff-muted); }

/* ── Category sections + cards grid ─────────────────────────── */
.fc-cat { margin-bottom: 26px; }
.fc-cat h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 12px; }
.fc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(255px, 100%), 1fr));
  gap: 12px;
}
.fc-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--ff-panel);
  border: 1px solid var(--ff-border);
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--ff-text);
  box-shadow: var(--ff-shadow);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.fc-card:hover { transform: translateY(-2px); border-color: #bfdbfe; }
.fc-card-icon { font-size: 1.5rem; line-height: 1; margin-top: 2px; }
.fc-card-title { font-weight: 700; font-size: 0.93rem; margin-bottom: 3px; }
.fc-card-blurb { font-size: 0.8rem; color: var(--ff-muted); }
.fc-noresults { text-align: center; color: var(--ff-muted); padding: 30px 0; }

/* ── Generic panel ──────────────────────────────────────────── */
.fc-panel {
  background: var(--ff-panel);
  border: 1px solid var(--ff-border);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--ff-shadow);
}
.fc-panel h2 { font-size: 1.08rem; font-weight: 700; margin-bottom: 12px; }
.fc-formula { font-size: 0.9rem; color: #334155; }

.fc-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.fc-fact h3 { font-size: 0.95rem; margin-bottom: 6px; }
.fc-fact p { font-size: 0.85rem; color: #334155; }

.fc-faq details {
  border-bottom: 1px solid var(--ff-border);
  padding: 10px 0;
}
.fc-faq details:last-child { border-bottom: none; }
.fc-faq summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; }
.fc-faq p { margin-top: 8px; font-size: 0.87rem; color: #334155; }

/* ── Calculator page layout ─────────────────────────────────── */
.fc-breadcrumb { font-size: 0.8rem; color: var(--ff-muted); margin-bottom: 12px; }
.fc-breadcrumb a { color: var(--ff-blue); text-decoration: none; }
.fc-breadcrumb span { margin: 0 5px; }
.fc-page-head { margin-bottom: 16px; }
.fc-page-head h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.fc-intro { color: #334155; max-width: 900px; font-size: 0.95rem; }

.fc-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}
@media (max-width: 860px) {
  .fc-layout { grid-template-columns: 1fr; }
}

.fc-inputs-panel, .fc-results-panel {
  background: var(--ff-panel);
  border: 1px solid var(--ff-border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--ff-shadow);
}
.fc-panel-title { font-size: 1rem; font-weight: 700; margin-bottom: 14px; }

/* ── Form fields (JS-generated) ─────────────────────────────── */
.fld { margin-bottom: 16px; }
.fld-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.83rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
  gap: 8px;
}
.fld-help { font-weight: 400; font-size: 0.72rem; color: var(--ff-muted); text-align: right; }
.fld-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
}
.fld-input-wrap:focus-within { border-color: var(--ff-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.fld-affix {
  padding: 8px 10px;
  background: #f8fafc;
  color: var(--ff-muted);
  font-size: 0.85rem;
  font-weight: 600;
  border-right: 1px solid var(--ff-border);
  white-space: nowrap;
}
.fld-affix.suffix { border-right: none; border-left: 1px solid var(--ff-border); }
.fld-input-wrap input[type="number"] {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  padding: 9px 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--ff-text);
  background: transparent;
}
/* Hide spinners for a cleaner money field */
.fld-input-wrap input[type="number"]::-webkit-outer-spin-button,
.fld-input-wrap input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fld-input-wrap input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.fld input[type="range"] {
  width: 100%;
  margin-top: 8px;
  accent-color: var(--ff-blue);
  cursor: pointer;
}
.fld-inwords { font-size: 0.72rem; color: var(--ff-blue); margin-top: 4px; font-weight: 600; min-height: 1em; }

.fld select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--ff-text);
  background: #fff;
  outline: none;
}
.fld select:focus { border-color: var(--ff-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }

.seg { display: flex; gap: 0; border: 1px solid #cbd5e1; border-radius: 9px; overflow: hidden; }
.seg button {
  flex: 1;
  padding: 9px 8px;
  border: none;
  background: #fff;
  font-size: 0.83rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--ff-muted);
  cursor: pointer;
  border-right: 1px solid var(--ff-border);
}
.seg button:last-child { border-right: none; }
.seg button.active { background: var(--ff-blue); color: #fff; }

.fld-group-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ff-muted);
  margin: 18px 0 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--ff-border);
}

/* ── Results ────────────────────────────────────────────────── */
.fc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.fc-rescard {
  border: 1px solid var(--ff-border);
  border-radius: 11px;
  padding: 12px 14px;
  background: #fbfcfe;
}
.fc-rescard .label { font-size: 0.72rem; font-weight: 600; color: var(--ff-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.fc-rescard .value { font-size: 1.25rem; font-weight: 800; margin-top: 3px; word-break: break-word; }
.fc-rescard .sub { font-size: 0.72rem; color: var(--ff-muted); margin-top: 2px; }
.fc-rescard.accent { background: var(--ff-blue-soft); border-color: #bfdbfe; }
.fc-rescard.accent .value { color: var(--ff-blue); }
.fc-rescard.good { background: var(--ff-green-soft); border-color: #bbf7d0; }
.fc-rescard.good .value { color: var(--ff-green); }
.fc-rescard.bad { background: var(--ff-red-soft); border-color: #fecaca; }
.fc-rescard.bad .value { color: var(--ff-red); }
.fc-rescard.warn { background: var(--ff-amber-soft); border-color: #fde68a; }
.fc-rescard.warn .value { color: var(--ff-amber); }

.fc-note {
  font-size: 0.82rem;
  color: #92400e;
  background: var(--ff-amber-soft);
  border: 1px solid #fde68a;
  border-radius: 9px;
  padding: 10px 13px;
  margin-bottom: 14px;
}

.fc-chart { position: relative; height: 300px; margin-bottom: 16px; }
.fc-chart.donut { height: 240px; }
@media (max-width: 640px) { .fc-chart { height: 240px; } }

.fc-table-wrap summary { cursor: pointer; font-weight: 700; font-size: 0.9rem; margin-bottom: 8px; }
.fc-table-scroll { overflow-x: auto; }
#calc_table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
#calc_table th {
  text-align: right;
  padding: 8px 10px;
  background: #f8fafc;
  border-bottom: 2px solid var(--ff-border);
  color: var(--ff-muted);
  font-weight: 700;
  white-space: nowrap;
}
#calc_table th:first-child, #calc_table td:first-child { text-align: left; }
#calc_table td { padding: 7px 10px; border-bottom: 1px solid #f1f5f9; text-align: right; white-space: nowrap; }
#calc_table tr:hover td { background: #f8fafc; }
#calc_table td.pos { color: var(--ff-green); font-weight: 600; }
#calc_table td.neg { color: var(--ff-red); font-weight: 600; }

.fc-disclaimer {
  font-size: 0.8rem;
  color: #92400e;
  background: var(--ff-amber-soft);
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
}

.fc-grid.related { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
