/* ═══════════════════════════════════════════
   FirstInvest.ai — Design System
   Light only. Font: Plus Jakarta Sans.
   Primary: Forest Green. Accent: Amber.
═══════════════════════════════════════════ */

:root {
  --font: 'Plus Jakarta Sans', sans-serif;

  --bg:        #F8F5F0;
  --nav-bg:    #FFFFFF;
  --surf:      #FFFFFF;
  --surf2:     #F0EBE2;
  --ticker-bg: #EDE8DD;
  --footer-bg: #0E2518;

  --border:   rgba(26,60,30,0.10);
  --border-s: rgba(26,60,30,0.22);

  --text:     #131A10;
  --text2:    #4A5A42;
  --text3:    #8A9A80;

  --primary:    #1B5E3C;
  --primary-l:  #247A4E;
  --primary-d:  #103A24;
  --primary-bg: rgba(27,94,60,0.08);

  --gold:     #8A6A00;
  --gold-l:   #6A5000;
  --gold-d:   #B08010;
  --gold-bg:  rgba(138,106,0,0.08);

  --green:        #0A5C1C;
  --green-bg:     rgba(10,92,28,0.09);
  --green-border: rgba(10,92,28,0.22);

  --red:        #B81C1C;
  --red-bg:     rgba(184,28,28,0.07);
  --red-border: rgba(184,28,28,0.18);

  --amber:        #8A6000;
  --amber-bg:     rgba(138,96,0,0.09);
  --amber-border: rgba(138,96,0,0.22);

  --shadow:      rgba(0,0,0,0.12);
  --shadow-s:    rgba(0,0,0,0.06);
  --shadow-card: 0 2px 16px rgba(20,50,20,0.09), 0 0 0 1px rgba(26,60,30,0.07);
}

/* ── Base resets ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
input, button, select, textarea { font-family: inherit; font-size: inherit; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
}

/* ── Shared nav ── */
.tbb-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  gap: 1rem;
  box-shadow: 0 1px 0 var(--border);
}
.tbb-logo {
  display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; flex-shrink: 0;
}
/* Logo image: full logo.png is square (mark + wordmark + tagline). For nav we show
   only the Fi monogram by clipping a square viewport to the top half of the asset. */
.tbb-logo-img {
  display: block;
  height: 44px;
  width: 44px;
  object-fit: cover;
  object-position: center 18%;
  border-radius: 6px;
}
.tbb-logo-wordmark {
  font-family: var(--font);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.015em;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
}
.tbb-logo-wordmark .invest { color: var(--primary); }

.tbb-beta {
  font-family: var(--font);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid var(--amber-border);
  background: var(--amber-bg);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  line-height: 1;
  flex-shrink: 0;
}
.nav-right { display: flex; align-items: center; gap: 0.6rem; }

.nav-link {
  color: var(--text2);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  transition: color 0.15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--primary); }

.btn-nav {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border-s);
  border-radius: 8px;
  padding: 0.38rem 0.9rem;
  font-family: var(--font);
  font-size: 0.8rem; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-nav:hover { border-color: var(--primary); color: var(--primary); }
.btn-nav.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-nav.primary:hover { background: var(--primary-l); border-color: var(--primary-l); }

/* ── Shared buttons ── */
.btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1.5rem;
  font-family: var(--font);
  font-size: 0.88rem; font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.4rem;
  box-shadow: 0 2px 12px rgba(27,94,60,0.22);
}
.btn:hover { background: var(--primary-l); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(27,94,60,0.30); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border-s);
  box-shadow: none;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); box-shadow: none; }

/* ── Universal CTA button — used across learn, stock, and app pages ── */
/* Any page that loads theme.css gets this for free. Per-page overrides must use var(--primary). */
.cta-btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s, transform 0.12s;
  cursor: pointer;
  border: none;
}
.cta-btn:hover { background: var(--primary-l); transform: translateY(-1px); }

/* ── Ticker ── */
.ticker-bar {
  overflow: hidden;
  background: var(--ticker-bg);
  border-bottom: 1px solid var(--border);
  padding: 0.46rem 0;
  cursor: default;
}
.ticker-bar:hover .ticker-track { animation-play-state: paused; }
.ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  width: max-content;
  will-change: transform;
}
@keyframes tscroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.t-item {
  font-family: var(--font); font-size: 0.72rem; color: var(--text2);
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0 1.1rem;
  border-right: 1px solid var(--border);
}
.t-item:last-child { border-right: none; }
.t-sym { color: var(--text); font-weight: 700; }
.t-price { color: var(--text2); }
.t-up  { color: var(--green); font-weight: 600; }
.t-dn  { color: var(--red);   font-weight: 600; }
.t-nil { font-size: 0.72rem; color: var(--text3); padding: 0 1rem; }

/* ── Shared inputs ── */
.field {
  width: 100%;
  background: var(--surf2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem; font-weight: 500;
  outline: none;
  transition: border-color 0.15s;
}
.field:focus { border-color: var(--primary); }
.field::placeholder { color: var(--text3); font-weight: 400; }
.field-err { display: none; font-size: 0.77rem; color: var(--red); margin-top: 0.45rem; font-weight: 600; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 1.75rem; left: 50%; transform: translateX(-50%);
  background: var(--green-bg); border: 1px solid var(--green-border);
  color: var(--green); padding: 0.72rem 1.3rem; border-radius: 100px;
  font-size: 0.82rem; font-weight: 700; z-index: 999;
  display: none; white-space: nowrap;
  box-shadow: 0 8px 24px var(--shadow);
}

@media (max-width: 768px) {
  .tbb-nav { padding: 0 1.1rem; }
  .btn-nav:not(.primary) { display: none; }
}
