/* ============================================================
   JAG INSIGHTS — Core Design System
   Dark financial-education aesthetic
   Fonts: Clash Display (headings) + Satoshi (body) + DM Mono (data)
   ============================================================ */

@import url('https://api.fontshare.com/v2/css?f[]=clash-display@400,500,600,700&f[]=satoshi@400,500,600,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&display=swap');

/* ---- TOKENS ---- */
:root {
  --bg:        #080a0c;
  --bg2:       #0e1114;
  --surface:   #13171c;
  --surface2:  #1a1f26;
  --border:    rgba(255,255,255,.07);
  --border2:   rgba(255,255,255,.13);

  --lime:      #3b82f6;
  --lime-dim:  rgba(59,130,246,.12);
  --lime-glow: rgba(59,130,246,.25);
  --blue:      #4f8aff;
  --blue-dim:  rgba(79,138,255,.1);
  --red:       #ff5656;
  --red-dim:   rgba(255,86,86,.1);
  --gold:      #ffc84a;
  --gold-dim:  rgba(255,200,74,.1);
  --purple:    #9f7aea;
  --purple-dim:rgba(159,122,234,.1);

  --text:      #f0f2f5;
  --text-2:    #8b95a3;
  --text-3:    #4a5260;

  --font-display: 'Clash Display', sans-serif;
  --font-body:    'Satoshi', sans-serif;
  --font-mono:    'DM Mono', monospace;

  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --header-h:  60px;

  --shadow:    0 4px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.6);
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-body); }
input, textarea, select { font-family: var(--font-body); }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }

/* ---- HEADER ---- */
.jag-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  background: rgba(8,10,12,.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.jag-logo {
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 700; letter-spacing: .04em;
  color: var(--text);
}
.jag-logo .accent { color: var(--lime); }
.jag-nav { display: flex; align-items: center; gap: 2px; }
.jag-nav a {
  font-size: .82rem; font-weight: 500; color: var(--text-2);
  padding: 6px 14px; border-radius: 8px; transition: all .15s;
}
.jag-nav a:hover { color: var(--text); background: var(--surface); }
.jag-nav a.active { color: var(--text); background: var(--surface); }
.jag-header-right { display: flex; align-items: center; gap: 10px; }
.jag-avatar {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--lime-dim); border: 1px solid rgba(59,130,246,.25);
  color: var(--lime); font-weight: 700; font-size: .82rem;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); cursor: pointer;
}

/* ---- PAGE WRAPPER ---- */
.jag-page {
  max-width: 1160px; margin: 0 auto;
  padding: calc(var(--header-h) + 36px) 24px 64px;
}
.jag-page-wide {
  max-width: 1400px; margin: 0 auto;
  padding: calc(var(--header-h) + 36px) 24px 64px;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; border-radius: var(--radius);
  font-weight: 600; font-size: .88rem; letter-spacing: .02em;
  border: none; transition: all .15s; cursor: pointer;
}
.btn-lime  { background: var(--lime); color: var(--bg); }
.btn-lime:hover { opacity: .88; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border2); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-3); }
.btn-surface { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-surface:hover { border-color: var(--border2); }
.btn-lg { padding: 13px 28px; font-size: .96rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 7px 14px; font-size: .78rem; }

/* ---- CARDS ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:hover { border-color: var(--border2); }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

/* ---- INPUTS ---- */
.jag-input {
  width: 100%; padding: 11px 14px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: .9rem;
  outline: none; transition: border-color .15s;
}
.jag-input:focus { border-color: var(--lime); }
.jag-input::placeholder { color: var(--text-3); }
.input-label {
  display: block; font-size: .72rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 6px;
}

/* ---- BADGES / PILLS ---- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 100px; font-size: .7rem;
  font-weight: 600; letter-spacing: .04em;
}
.pill-lime   { background: var(--lime-dim); color: var(--lime); border: 1px solid rgba(59,130,246,.25); }
.pill-blue   { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(79,138,255,.2); }
.pill-gold   { background: var(--gold-dim); color: var(--gold); border: 1px solid rgba(255,200,74,.2); }
.pill-purple { background: var(--purple-dim); color: var(--purple); border: 1px solid rgba(159,122,234,.2); }
.pill-red    { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,86,86,.2); }
.pill-dot    { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ---- PROGRESS BAR ---- */
.progress-bar { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: var(--lime); transition: width .5s ease; }

/* ---- EYEBROW / SECTION LABELS ---- */
.eyebrow {
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--lime); margin-bottom: 8px; display: block;
}
.section-title {
  font-family: var(--font-display); font-size: clamp(1.8rem,3.5vw,2.6rem);
  letter-spacing: .02em; line-height: 1.05; font-weight: 600;
}

/* ---- DIVIDER ---- */
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ---- TOAST ---- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); padding: 12px 24px;
  font-size: .85rem; z-index: 9999; transition: transform .3s ease;
  pointer-events: none; white-space: nowrap; box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(59,130,246,.35); color: var(--lime); }
.toast.error   { border-color: rgba(255,86,86,.35); color: var(--red); }

/* ---- LOADING SPINNER ---- */
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border2);
  border-top-color: var(--lime); border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- ANIMATIONS ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.anim-fade-up { animation: fadeUp .5s ease both; }
.anim-fade-in { animation: fadeIn .4s ease both; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .jag-nav { display: none; }
  .jag-header { padding: 0 16px; }
  .jag-page, .jag-page-wide { padding-left: 16px; padding-right: 16px; }
}
