/* MarketMaster shared theme — matches the landing page (policies/index.html).
 * Use on every page. Mobile-first.
 */
:root {
  --bg: #0A1814;
  --bg-2: #0F2018;
  --line: #1A2D24;
  --line-strong: #2A4434;
  --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: 'Poppins', 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%; }
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(ellipse 60% 50% at 100% 80%, rgba(63,232,156,0.04), transparent 60%);
  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; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 640px) { .container { padding: 0 32px; } }

/* ── Header / nav ── */
header { padding: 16px 0; border-bottom: 1px solid var(--line); }
.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: 640px) { .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;
}
.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; }

/* ── Cards / panels ── */
.card {
  background: linear-gradient(180deg, var(--bg-2) 0%, rgba(15,32,24,0.85) 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(15,32,24,0.95) 0%, rgba(15,32,24,0.78) 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.015em; }
.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;
}
.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; }
@media (min-width: 640px) {
  .dash-hero { padding: 36px 0 28px; }
  .dash-hero h1 { font-size: 34px; }
}

/* 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; } }
