/* MomentumScore - design tokens and components.
   Bootstrap 5.3 does grid, forms and modals; this file is the look. */

:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --text: #0f1330;
  --text-2: #4a5073;
  --muted: #7c82a3;
  --line: #e6e8f2;
  --line-2: #d9dcea;
  --hover: #f1f2fa;

  --brand: #5b4cf0;
  --brand-2: #8b5cf6;
  --brand-soft: #eeecfe;
  --brand-ink: #3b2fc4;
  --accent: #f59e0b;

  --up: #0f9f6e;
  --up-soft: #e3f7ef;
  --down: #e0435b;
  --down-soft: #fdecef;
  --warn: #b7791f;
  --warn-soft: #fdf4e3;

  --side-bg: #0e1030;
  --side-2: #171a45;
  --side-text: #aab0d6;
  --side-muted: #6d73a1;
  --side-active: #ffffff;

  --shadow-sm: 0 1px 2px rgba(15, 19, 48, .05);
  --shadow: 0 1px 2px rgba(15, 19, 48, .05), 0 6px 24px rgba(15, 19, 48, .06);
  --shadow-lg: 0 10px 40px rgba(15, 19, 48, .12);
  --radius: 14px;
  --radius-sm: 10px;
  --side-w: 248px;
}

:root[data-theme="dark"] {
  --bg: #0b0d22;
  --surface: #13163a;
  --surface-2: #181b45;
  --text: #eef0ff;
  --text-2: #b9bde0;
  --muted: #8a8fbb;
  --line: #252a5c;
  --line-2: #2f356d;
  --hover: #1b1f4d;
  --brand: #8b7cff;
  --brand-2: #b18cff;
  --brand-soft: #262a66;
  --brand-ink: #c4bbff;
  --up: #34d399;
  --up-soft: #0f3a33;
  --down: #fb7185;
  --down-soft: #3d1830;
  --warn: #fbbf24;
  --warn-soft: #3a2f14;
  --side-bg: #070919;
  --side-2: #12153a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 28px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 44px rgba(0, 0, 0, .5);
}

/* names the page scripts and inline styles were written against */
:root, :root[data-theme="dark"] {
  --grid: var(--line); --text-muted: var(--muted); --text-primary: var(--text); --text-secondary: var(--text-2);
  --surface-1: var(--surface); --plane: var(--bg); --hairline: var(--line);
  --pass-bg: var(--up-soft); --fail-bg: var(--down-soft);
}

html, body { background: var(--bg); }
body {
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); }
::selection { background: var(--brand-soft); }

/* ── shell ─────────────────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.side {
  width: var(--side-w); flex: 0 0 var(--side-w);
  background: var(--side-bg);
  color: var(--side-text);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 18px 14px;
}
.side .logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; color: #fff; text-decoration: none; }
.side .logo b { font-size: 17px; letter-spacing: -.02em; font-weight: 750; }
.side .logo small { display: block; font-size: 10.5px; color: var(--side-muted); font-weight: 500; letter-spacing: .02em; }
.side .grp { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--side-muted); font-weight: 650; margin: 18px 10px 6px; }
.side .nav-i {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 10px;
  color: var(--side-text); font-weight: 520; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.side .nav-i i { font-size: 16px; width: 18px; text-align: center; opacity: .9; }
.side .nav-i:hover { background: var(--side-2); color: #fff; }
.side .nav-i.active {
  background: linear-gradient(90deg, rgba(139, 124, 255, .28), rgba(139, 124, 255, .08));
  color: var(--side-active);
  box-shadow: inset 3px 0 0 #a495ff;
}
.side .foot { margin-top: auto; padding-top: 18px; }
.side .plan-card {
  background: linear-gradient(135deg, #2a2477, #1a1c52);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px; padding: 12px; color: #dfe1ff; font-size: 12px;
}
.side .plan-card b { color: #fff; font-size: 13px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; display: flex; align-items: center; gap: 12px;
  padding: 0 28px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.topbar .crumb { color: var(--muted); font-size: 12.5px; }
.topbar .tb-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  height: 36px; min-width: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px;
}
.topbar .tb-btn:hover { background: var(--hover); color: var(--text); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px;
}
.content { padding: 26px 28px 40px; max-width: 1480px; width: 100%; }
.topbar .menu-toggle { display: none; }

@media (max-width: 991px) {
  .side { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .topbar .menu-toggle { display: inline-flex; }
  .content { padding: 18px 16px 32px; }
  .topbar { padding: 0 16px; }
}

/* ── page header ───────────────────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .t { font-size: 24px; font-weight: 760; letter-spacing: -.025em; margin: 0; line-height: 1.15; }
.page-head .s { color: var(--text-2); margin: 4px 0 0; font-size: 13.5px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.page-title { font-size: 22px; font-weight: 760; letter-spacing: -.02em; margin: 0; }

/* ── cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); color: var(--text);
}
.card-header {
  background: transparent; border-bottom: 1px solid var(--line);
  padding: 14px 18px; font-weight: 650; font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.card-body { padding: 18px; }
.card.lift { transition: transform .15s, box-shadow .15s, border-color .15s; }
.card.lift:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }

.stat { padding: 16px 18px; }
.stat .k { font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-size: clamp(19px, 1.75vw, 26px); white-space: nowrap; font-weight: 780; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 4px; line-height: 1.15; }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 2px; }

.pass { background: color-mix(in srgb, var(--up-soft) 60%, transparent) !important; }
.fail { background: color-mix(in srgb, var(--down-soft) 60%, transparent) !important; }

/* ── tables ────────────────────────────────────────────────────────────── */
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); color: var(--text); margin: 0; }
.table > thead th {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line); padding: 11px 12px; white-space: nowrap; background: var(--surface-2);
}
.table > tbody td { border-color: var(--line); padding: 10px 12px; vertical-align: middle; }
.table-hover > tbody > tr:hover > * { background: var(--hover); --bs-table-accent-bg: transparent; }
.table-sm > tbody td, .table-sm > thead th { padding: 7px 10px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.up { color: var(--up); font-weight: 600; }
.down { color: var(--down); font-weight: 600; }
.muted { color: var(--muted); }
.text-muted { color: var(--muted) !important; }

/* ── controls ──────────────────────────────────────────────────────────── */
.btn { border-radius: 10px; font-weight: 600; font-size: 13.5px; padding: 8px 14px; }
.btn-sm { border-radius: 8px; font-size: 12.5px; padding: 5px 10px; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); border: 0; color: #fff;
  box-shadow: 0 4px 14px rgba(91, 76, 240, .28);
}
.btn-primary:hover, .btn-primary:focus { filter: brightness(1.07); color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.btn-outline-secondary { border-color: var(--line-2); color: var(--text-2); background: var(--surface); }
.btn-outline-secondary:hover { background: var(--hover); color: var(--text); border-color: var(--line-2); }
.btn-outline-primary { border-color: var(--brand); color: var(--brand); }
.btn-outline-primary:hover, .btn-check:checked + .btn-outline-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); border: 0; }
.btn-soft:hover { filter: brightness(.97); color: var(--brand-ink); }
.form-label { font-size: 11.5px; font-weight: 650; color: var(--text-2); margin-bottom: 5px; letter-spacing: .01em; }
.form-control, .form-select {
  background-color: var(--surface); color: var(--text); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 8px 12px; font-size: 13.5px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); background-color: var(--surface); color: var(--text);
}
.form-text { color: var(--muted); font-size: 12px; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.formula { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
textarea.formula { color: var(--text); }

/* ── chips & notes ─────────────────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 999px; line-height: 1.4; }
.chip-buy, .chip-low { background: var(--up-soft); color: var(--up); }
.chip-hold, .chip-brand { background: var(--brand-soft); color: var(--brand-ink); }
.chip-sell, .chip-high { background: var(--down-soft); color: var(--down); }
.chip-medium { background: var(--warn-soft); color: var(--warn); }
.chip-ghost { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.warn-note { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); padding: 10px 14px; border-radius: 10px; font-size: 13px; color: var(--text-2); }
.alert { border-radius: 12px; border: 1px solid var(--line); }

/* ── strategy cards (ready strategies) ─────────────────────────────────── */
.sc { display: flex; flex-direction: column; height: 100%; padding: 18px; position: relative; overflow: hidden; }
.sc::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--stripe, var(--brand)); }
.sc .n { font-size: 11px; color: var(--muted); font-weight: 650; }
.sc h3 { font-size: 16.5px; font-weight: 720; letter-spacing: -.01em; margin: 8px 0 4px; }
.sc .d { color: var(--text-2); font-size: 13px; min-height: 38px; }
.sc .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 14px 0; font-size: 12.5px; }
.sc .facts span { display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.sc .facts b { font-weight: 620; }
.sc .res { display: flex; gap: 10px; margin-bottom: 14px; }
.sc .res > div { flex: 1; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.sc .res span { display: block; font-size: 10.5px; color: var(--muted); font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.sc .res b { font-size: 17px; font-variant-numeric: tabular-nums; }
.sc .actions { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sc .actions .btn-primary { grid-column: 1 / -1; }

.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 2px; }
.seg a { padding: 7px 16px; border-radius: 9px; color: var(--text-2); font-weight: 600; font-size: 13px; }
.seg a.on { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }

/* ── auth & landing ────────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth .art {
  background: radial-gradient(1200px 600px at 10% 10%, #3b2fc4 0%, transparent 60%),
              radial-gradient(900px 500px at 90% 90%, #8b5cf6 0%, transparent 55%), #0b0d22;
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth .art h2 { font-size: 34px; font-weight: 780; letter-spacing: -.03em; line-height: 1.15; max-width: 460px; }
.auth .art p { color: #c3c6ee; max-width: 440px; }
.auth .form-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth .box { width: 100%; max-width: 380px; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth .art { display: none; } }

.land-nav { display: flex; align-items: center; gap: 18px; padding: 18px 0; }
.hero { padding: 72px 0 56px; }
.hero h1 { font-size: clamp(34px, 5vw, 58px); font-weight: 800; letter-spacing: -.04em; line-height: 1.04; }
.hero .grad { background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--text-2); font-size: 18px; max-width: 620px; }
.feature { padding: 22px; height: 100%; }
.feature .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 12px; }
.feature h4 { font-size: 16px; font-weight: 700; }
.feature p { color: var(--text-2); font-size: 13.5px; margin: 0; }
.steps { counter-reset: s; }
.steps .st { position: relative; padding-left: 44px; margin-bottom: 18px; }
.steps .st::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.modal-content { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 16px; }
.modal-header, .modal-footer { border-color: var(--line); }
.dropdown-menu { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.dropdown-item { border-radius: 8px; color: var(--text); font-size: 13.5px; padding: 7px 10px; }
.dropdown-item:hover { background: var(--hover); color: var(--text); }
pre, code { color: var(--brand-ink); }
.foot-note { color: var(--muted); font-size: 11.5px; text-align: center; padding: 18px 0 6px; }

/* MomentumScore wordmark: MOMENTUM over S C O R E, same width */
.wm { display: inline-flex; flex-direction: column; line-height: .98; font-weight: 900; text-transform: uppercase; letter-spacing: .01em; vertical-align: middle; }
.wm-1 { white-space: nowrap; }
.wm-2 { display: flex; justify-content: space-between; margin-top: .06em;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wm-2 i { font-style: normal; }
.side .wm-1, .art .wm-1 { color: #fff; }
.side .wm-2, .art .wm-2 { background-image: linear-gradient(90deg, #a5b4fc, #c4b5fd); }
.side .logo .wm { font-size: 15px; }
