@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
/* MarketMaster shared theme — matches the landing page (policies/index.html).
 * Use on every page. Mobile-first.
 */
:root {
  --bg: #070A12;
  --bg-2: #0E1426;
  --line: #1A2438;
  --line-strong: #28335A;
  --accent: #3FE89C;
  --accent-dim: rgba(63,232,156,0.15);
  --accent-glow: rgba(63,232,156,0.3);
  --text: #E6EFE9;
  --text-mute: #8CB5A1;
  --text-faint: #5A8270;
  --warn: #F59E0B;
  --error: #FF6B6B;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html { scroll-padding-top: 80px; }   /* keep anchor targets clear of the sticky header */

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  /* Ambient radial glow — adds depth without distracting */
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(63,232,156,0.10), transparent 60%),
    radial-gradient(820px 480px at 6% 2%, rgba(139,124,246,0.07), transparent 55%);
  background-attachment: fixed;
}
::selection { background: var(--accent-dim); color: var(--accent); }
/* Honor reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* mm-overflow-guard */ html, body { max-width: 100%; overflow-x: hidden; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 640px) { .container { padding: 0 32px; } }
/* mm-safe-area: keep nav content clear of the notch in landscape */
@media (max-width: 900px) and (orientation: landscape) {
  .container { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
}

/* ── Header / nav ── */
body > header {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 10, 18, 0.85);   /* var(--bg) @ 85% so content scrolls under */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-brand-logo {
  width: 32px; height: 32px;
  background: var(--bg-2); border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
}
.nav-brand-name { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.nav-links { display: none; gap: 18px; align-items: center; font-size: 14px; }
.nav-links a { color: var(--text-mute); }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--text); }
@media (min-width: 860px) { .nav-links { display: flex; } }
.nav-cta { font-size: 13px; padding: 9px 14px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 10px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .15s ease;
  min-height: 44px;
  width: 100%;
}
@media (min-width: 480px) {
  .btn { width: auto; }
}
.btn-primary {
  background: linear-gradient(180deg, #4DF0A8 0%, #3FE89C 100%);
  color: #0A1814;
  font-weight: 700;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.3) inset,
    0 6px 24px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.35) inset,
    0 12px 36px var(--accent-glow);
  text-decoration: none;
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.2) inset,
    0 4px 12px var(--accent-glow);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
/* Keep primary-button text readable when selected (global ::selection turns text accent-green). */
.btn-primary::selection { background: rgba(10,24,20,0.18); color: #0A1814; }
.btn-primary::-moz-selection { background: rgba(10,24,20,0.18); color: #0A1814; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-mute);
  font-weight: 500;
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.btn-google {
  background: #fff;
  color: #1f1f1f;
}
.btn-google:hover:not(:disabled) {
  background: #f3f3f3;
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-link {
  background: transparent;
  border: none;
  color: var(--text-mute);
  padding: 4px 0;
  width: auto;
  min-height: 0;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}
.btn-link:hover { color: var(--accent); }

/* ── Forms ── */
.field { display: block; margin-bottom: 18px; }
.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mute);
  letter-spacing: 0.01em;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 13px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.4;
  transition: border-color .15s ease, background .15s ease;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-faint);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: #0E1F17;
  box-shadow: 0 0 0 3px rgba(63,232,156,0.15);
}
.field input:hover:not(:focus),
.field textarea:hover:not(:focus),
.field select:hover:not(:focus) { border-color: var(--line-strong); }
.field textarea { resize: vertical; min-height: 110px; }
.field-hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

/* ── Password field with show/hide toggle ── */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 46px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s ease, background .15s ease;
  padding: 0;
}
.password-toggle:hover { color: var(--text-mute); background: rgba(255,255,255,0.04); }
.password-toggle:focus-visible {
  outline: none;
  color: var(--accent);
  box-shadow: 0 0 0 2px rgba(63,232,156,0.4);
}
.password-toggle svg { display: block; width: 20px; height: 20px; }
.password-toggle .icon-hide { display: none; }
.password-toggle[aria-pressed="true"] .icon-show { display: none; }
.password-toggle[aria-pressed="true"] .icon-hide { display: block; }
.password-toggle[aria-pressed="true"] { color: var(--text-mute); }

/* ── Cards / panels ── */
.card {
  background: linear-gradient(180deg, var(--bg-2) 0%, #0A0F1E 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.03) inset,
    0 20px 50px -20px rgba(0,0,0,0.35);
}
@media (min-width: 640px) { .card { padding: 30px; border-radius: 16px; } }
.card-tight { padding: 18px; }
.card-tight + .card-tight { margin-top: 14px; }

/* Section heading inside a card */
.card-eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}

/* ── Auth layout (centered card) ── */
.auth-shell {
  min-height: calc(100vh - 65px - 100px);   /* header + footer */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px 64px;
}
@media (min-width: 640px) {
  .auth-shell { padding: 64px 24px; align-items: center; }
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, rgba(14,20,38,0.95) 0%, rgba(14,20,38,0.80) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 22px;
  position: relative;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 30px 60px -20px rgba(0,0,0,0.4),
    0 0 0 1px rgba(63,232,156,0.02);
  animation: card-in .4s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (min-width: 480px) {
  .auth-card { padding: 40px 36px; }
}
.auth-card-mark {
  width: 44px; height: 44px;
  margin: 0 0 18px;
  border-radius: 11px;
  background: var(--bg);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.auth-card h1 {
  margin: 0 0 6px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.15;
}
.auth-card .auth-sub {
  margin: 0 0 26px;
  color: var(--text-mute);
  font-size: 14px;
  line-height: 1.55;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-faint);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth-footer-row {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--text-mute);
}
.auth-footer-row a { color: var(--accent); }

/* ── Status pills ── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-mute);
}
.pill-active { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-dim); }
.pill-warn   { color: var(--warn); border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.1); }
.pill-error  { color: var(--error); border-color: rgba(255,107,107,0.3); background: rgba(255,107,107,0.1); }

/* ── Alerts (inline messages) ── */
.alert {
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}
.alert-info  { color: var(--text); background: var(--bg-2); border-color: var(--line-strong); }
.alert-error { color: var(--error); background: rgba(255,107,107,0.06); border-color: rgba(255,107,107,0.3); }
.alert-ok    { color: var(--accent); background: var(--accent-dim); border-color: var(--accent); }
.alert-hidden { display: none; }

/* ── Spinner ── */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ── */
footer {
  padding: 32px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 13px;
  margin-top: 60px;
}
.footer-row { display: flex; flex-direction: column; gap: 14px; text-align: center; }
@media (min-width: 640px) {
  .footer-row { flex-direction: row; justify-content: space-between; text-align: left; align-items: center; }
}
.footer-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.footer-links a { color: var(--text-mute); }

/* ── Typography helpers ── */
h1, h2, h3, h4 { letter-spacing: -0.025em; }
.text-mute { color: var(--text-mute); }
.text-faint { color: var(--text-faint); }
.text-mono  { font-family: var(--mono); font-size: 12px; }
.text-small { font-size: 13px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }

/* Visually-hidden but accessible to screen readers */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Dashboard hero (top of /dashboard) ── */
.dash-hero {
  padding: 28px 0 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
  display: flex; align-items: center; gap: 18px;
}
.dash-hero h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.15;
}
.dash-hero .dash-hero-sub { margin: 0; color: var(--text-mute); font-size: 14px; }
.dash-hero-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3FE89C 0%, #2BC082 100%);
  color: #0A1814;
  font-weight: 700;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--line);
}
.dash-hero-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 640px) {
  .dash-hero { padding: 36px 0 28px; gap: 22px; }
  .dash-hero h1 { font-size: 34px; }
  .dash-hero-avatar { width: 68px; height: 68px; font-size: 28px; }
}

/* Animated entrance for content blocks below the header */
.fade-in {
  animation: fade-in .45s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Skeleton shimmer for loading states */
.skeleton-shimmer {
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--line) 50%, var(--bg-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 6px;
  color: transparent;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Account widget (top-right of nav) ── */
.account-slot { display: flex; align-items: center; gap: 12px; }
.account-slot .account-loggedout-link {
  color: var(--text-mute);
  font-size: 14px;
  font-weight: 500;
}
.account-slot .account-loggedout-link:hover { color: var(--text); text-decoration: none; }
.account-slot .account-loggedout-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #4DF0A8 0%, #3FE89C 100%);
  color: #0A1814;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.3) inset,
    0 4px 14px var(--accent-glow);
  transition: transform .15s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.account-slot .account-loggedout-cta:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.35) inset,
    0 8px 22px var(--accent-glow);
  text-decoration: none;
}
.account-wrap { position: relative; }
.account-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  color: var(--text-mute);
  cursor: pointer;
  font-family: var(--sans);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.account-btn:hover { border-color: var(--line-strong); color: var(--text); }
.account-btn[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--text);
  background: #0E1F17;
}
.account-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(63,232,156,0.25);
  border-color: var(--accent);
}
.account-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3FE89C 0%, #2BC082 100%);
  color: #0A1814;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.account-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.account-caret { transition: transform .15s ease; opacity: .8; }
.account-btn[aria-expanded="true"] .account-caret { transform: rotate(180deg); }

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: linear-gradient(180deg, rgba(14,20,38,0.98) 0%, rgba(14,20,38,0.94) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 8px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 20px 40px -12px rgba(0,0,0,0.55),
    0 0 0 1px rgba(63,232,156,0.04);
  z-index: 100;
  animation: account-menu-in .14s ease-out;
}
@keyframes account-menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.account-menu-head {
  padding: 8px 10px 10px;
}
.account-menu-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  word-break: break-word;
}
.account-menu-email {
  color: var(--text-faint);
  font-size: 12px;
  font-family: var(--mono);
  margin-top: 2px;
  word-break: break-all;
}
.account-menu-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}
.account-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-mute);
  font-family: var(--sans);
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.account-menu-item svg { color: var(--text-faint); flex-shrink: 0; transition: color .12s ease; }
.account-menu-item:hover,
.account-menu-item:focus-visible {
  background: rgba(63,232,156,0.08);
  color: var(--text);
  text-decoration: none;
  outline: none;
}
.account-menu-item:hover svg,
.account-menu-item:focus-visible svg { color: var(--accent); }
.account-menu-item.is-current {
  color: var(--accent);
  background: var(--accent-dim);
}
.account-menu-item.is-current svg { color: var(--accent); }
.account-menu-signout {
  color: var(--text-mute);
}
.account-menu-signout:hover,
.account-menu-signout:focus-visible {
  background: rgba(255,107,107,0.08);
  color: var(--error);
}
.account-menu-signout:hover svg,
.account-menu-signout:focus-visible svg { color: var(--error); }
.account-menu-signout:disabled { opacity: 0.6; cursor: wait; }

/* Mobile-only hamburger menu button (logged-out state) */
.account-mobile-menu-btn {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-mute);
  cursor: pointer;
  padding: 0;
  transition: border-color .15s ease, color .15s ease;
}
.account-mobile-menu-btn:hover { border-color: var(--line-strong); color: var(--text); }
.account-mobile-menu-btn[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--text);
  background: #0E1F17;
}

/* Mobile-only CTA item in dropdown */
.account-menu-item.account-menu-cta {
  background: linear-gradient(180deg, #4DF0A8 0%, #3FE89C 100%);
  color: #0A1814;
  font-weight: 700;
  margin-top: 4px;
}
.account-menu-item.account-menu-cta:hover { color: #0A1814; background: linear-gradient(180deg, #5DF5B0 0%, #4FEDA8 100%); }

/* Show/hide helpers used by the dropdown to add mobile nav links */
.account-show-mobile { display: none; }
@media (max-width: 859px) {
  .account-hide-mobile { display: none !important; }
  .account-mobile-menu-btn { display: inline-flex; }
  .account-show-mobile { display: flex; }
  .account-menu-sep.account-show-mobile { display: block; }
}


/* ── Auth split-screen ── */
.auth-split { width:100%; max-width:1000px; display:grid; grid-template-columns:1fr; gap:28px; align-items:center; }
@media (min-width:900px){ .auth-split{ grid-template-columns:1.05fr 440px; gap:52px; } }
.auth-aside{ display:none; }
@media (min-width:900px){ .auth-aside{ display:block; } }
.auth-aside-eyebrow{ font-family:var(--mono); font-size:12px; color:var(--accent); margin-bottom:18px; letter-spacing:.3px; }
.auth-aside h2{ font-size:34px; line-height:1.08; letter-spacing:-.03em; font-weight:800; margin:0 0 20px; }
.auth-aside-list{ list-style:none; padding:0; margin:0 0 26px; display:flex; flex-direction:column; gap:13px; }
.auth-aside-list li{ color:var(--text-mute); font-size:15px; }
.auth-aside-list li b{ color:var(--accent); font-weight:700; margin-right:7px; }
.auth-aside-mock{ border:1px solid var(--line); border-radius:14px; background:linear-gradient(180deg,var(--bg-2),#0A0F1E); padding:8px 12px; box-shadow:0 26px 60px -30px rgba(0,0,0,.7); }
.auth-mock-row{ display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px 6px; font-size:12.5px; border-top:1px solid var(--line); }
.auth-mock-row:first-child{ border-top:none; }
.auth-mock-row .mk{ color:var(--text-mute); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.auth-mock-row .ev{ font-family:var(--mono); color:var(--accent); font-weight:600; }
