/* ═══════════════════════════════════════════════════════════════════
   Bold Mortgage Pipeline — shared design system
   Link this BEFORE any page-level <style> block so page styles can
   still override during migration:
     <link rel="stylesheet" href="/assets/theme.css">
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* ── Surfaces (slate scale) ── */
  --bg:          #0f172a;   /* page background */
  --bg-deep:     #0a0f1a;   /* recessed wells, code areas */
  --surface:     #1e293b;   /* cards, panels, modals */
  --surface-2:   #253347;   /* hover state of surface */
  --border:      #334155;   /* default border */
  --border-soft: #1e293b;   /* hairline dividers on bg */

  /* ── Text ── */
  --text-bright: #f1f5f9;   /* headings, stat values */
  --text:        #e2e8f0;   /* body */
  --text-muted:  #94a3b8;   /* secondary */
  --text-dim:    #64748b;   /* labels, captions */
  --text-faint:  #475569;   /* placeholders, disabled */

  /* ── Accents ── */
  --blue:        #3b82f6;
  --blue-light:  #60a5fa;
  --blue-deep:   #2563eb;
  --violet:      #8b5cf6;
  --green:       #22c55e;
  --green-deep:  #16a34a;
  --teal:        #10b981;
  --red:         #ef4444;
  --red-light:   #f87171;
  --amber:       #f59e0b;
  --orange:      #f97316;
  --cyan:        #67e8f9;
  --pink:        #ec4899;
  --gold:        #c9a84c;   /* partner-facing brand accent */

  /* ── Tinted fills (badges, chips, alerts) ── */
  --blue-tint:   rgba(59, 130, 246, 0.10);
  --green-tint:  rgba(34, 197, 94, 0.10);
  --red-tint:    rgba(239, 68, 68, 0.10);
  --amber-tint:  rgba(245, 158, 11, 0.10);
  --slate-tint:  rgba(100, 116, 139, 0.15);

  /* ── Brand gradient ── */
  --brand-gradient: linear-gradient(135deg, var(--blue), var(--violet));

  /* ── Shape ── */
  --radius-sm:   8px;       /* chips, small buttons, inputs */
  --radius:      10px;      /* buttons, search boxes */
  --radius-lg:   12px;      /* cards */
  --radius-xl:   16px;      /* modals, login panel */

  /* ── Elevation ── */
  --shadow-sm:   0 2px 10px rgba(59, 130, 246, 0.30);   /* brand glow */
  --shadow-md:   0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg:   0 20px 60px rgba(0, 0, 0, 0.50);       /* modals */

  /* ── Type scale ── */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --fs-xs:   11px;   /* captions, badges */
  --fs-sm:   13px;   /* buttons, secondary text */
  --fs-base: 14px;   /* body, inputs */
  --fs-md:   15px;
  --fs-lg:   20px;   /* page titles */
  --fs-xl:   26px;   /* stat values */

  color-scheme: dark;
}

/* ── Base (gentle: pages may override) ─────────────────────────── */
.theme-base {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── Icons (used by /assets/icons.js) ──────────────────────────── */
.icon {
  display: inline-block;
  vertical-align: -0.155em;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px;
  border: none; border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit; font-size: var(--fs-sm); font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); color: #fff; }
.btn-brand { background: var(--brand-gradient); color: #fff; }
.btn-brand:hover { filter: brightness(1.1); color: #fff; }
.btn-success { background: var(--green-tint); color: var(--green); }
.btn-success:hover { background: rgba(34, 197, 94, 0.18); color: var(--green); }
.btn-danger { background: var(--red-tint); color: var(--red-light); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.18); color: var(--red-light); }
.btn-outline { background: transparent; border: 1px solid var(--border); }
.btn-outline:hover { background: var(--surface); border-color: var(--text-faint); }
.btn-sm { padding: 6px 12px; font-size: var(--fs-xs); border-radius: var(--radius-sm); }

/* ── Icon-only square button (close ✕, settings, eye) ──────────── */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 16px; cursor: pointer;
  transition: all 0.15s;
}
.btn-icon:hover { color: var(--text); border-color: var(--text-faint); }

/* ── Inputs ────────────────────────────────────────────────────── */
.input, .select, .textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text);
  font-family: inherit; font-size: var(--fs-base);
  outline: none;
  transition: border-color 0.2s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.card-bordered { border: 1px solid var(--border); }

/* ── Badges / chips ────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: var(--radius);
  font-size: var(--fs-xs); font-weight: 700;
}
.chip-green { background: var(--green-tint); color: var(--green); }
.chip-blue  { background: var(--blue-tint);  color: var(--blue-light); }
.chip-red   { background: var(--red-tint);   color: var(--red-light); }
.chip-amber { background: var(--amber-tint); color: var(--amber); }
.chip-slate { background: var(--slate-tint); color: var(--text-dim); }

/* ── Brand logo block (header / login) ─────────────────────────── */
.brand-mark {
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-gradient);
  border-radius: var(--radius);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
