/* ============================================================
   Posit+EV — Design System
   web/static/styles.css
   ============================================================ */

/* ------------------------------------------------------------
   Brand palette
   ------------------------------------------------------------ */
:root {
  --brand-primary:  #534AB7;   /* purple — arc, CTA, links */
  --brand-dark:     #26215C;   /* deep indigo — headings, wordmark */
  --brand-light:    #EEEDFE;   /* lavender tint — card bg, hover fills */
  --brand-accent:   #FAC775;   /* gold — highlights, badges */
  --brand-success:  #0F6E56;   /* green — positive EV, success states */

  /* Derived */
  --brand-border:   #AFA9EC;
  --brand-muted:    #7F77DD;
  --brand-surface:  #F7F6FE;   /* page background */
  --text-primary:   #1A1733;
  --text-secondary: #555270;
  --text-muted:     #8E8BAA;

  /* Spacing scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;

  /* Shadow */
  --shadow-sm:  0 1px 3px rgba(83, 74, 183, 0.08);
  --shadow-md:  0 4px 16px rgba(83, 74, 183, 0.12);
  --shadow-lg:  0 8px 32px rgba(83, 74, 183, 0.16);
}

/* ------------------------------------------------------------
   Reset & base
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--brand-surface);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  color: var(--brand-dark);
  line-height: 1.25;
  margin: 0 0 var(--space-4);
}

h1 { font-size: 2rem;    font-weight: 700; }
h2 { font-size: 1.5rem;  font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 600; }

p { margin: 0 0 var(--space-4); color: var(--text-secondary); }

a {
  color: var(--brand-primary);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

img, svg { display: block; }

/* ------------------------------------------------------------
   Nav
   ------------------------------------------------------------ */
nav {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-6);
  background: #ffffff;
  border-bottom: 1px solid var(--brand-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-logo img {
  height: 52px;
  width: auto;
}

nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-1);
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

nav a:hover {
  color: var(--brand-primary);
  text-decoration: none;
}

/* ── Timezone picker ─────────────────────────────────────────────────── */
.tz-picker {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  padding: 3px;
  flex-shrink: 0;
}

.tz-btn {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 4px 8px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
  line-height: 1;
}
.tz-btn:hover { background: var(--brand-light); color: var(--brand-primary); }
.tz-btn.tz-btn-active {
  background: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(83,74,183,0.35);
}

/* ── Nav right-side group: TZ on top, auth buttons below ─────────────── */
.nav-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-left: auto;    /* push entire right group to far right */
}
.nav-auth {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-1);
  border-radius: var(--radius-sm);
  transition: color 0.15s;
  text-decoration: none;
}
.nav-link:hover { color: var(--brand-primary); text-decoration: none; }

.nav-btn {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 8px 18px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  /* reset globals that bleed into nav buttons */
  width: auto !important;
  margin-top: 0 !important;
}

.nav-btn-primary {
  background: var(--brand-primary) !important;
  color: #ffffff !important;
  border: 1.5px solid var(--brand-primary) !important;
}
.nav-btn-primary:hover {
  background: var(--brand-dark) !important;
  border-color: var(--brand-dark) !important;
  color: #ffffff !important;
}

/* Use high-specificity selector to beat button[type="submit"] global rule */
button.nav-btn-ghost,
.nav-btn-ghost {
  background: var(--brand-dark) !important;
  color: #ffffff !important;
  border: 1.5px solid var(--brand-dark) !important;
}
button.nav-btn-ghost:hover,
.nav-btn-ghost:hover {
  background: #0e0b2e !important;
  border-color: #0e0b2e !important;
  color: #ffffff !important;
}

/* ── Mobile nav ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  nav {
    padding: var(--space-2) var(--space-3);
    gap: 8px;
  }
  .nav-logo img {
    height: 36px;
  }
  /* Stack tz-picker + nav-auth tightly */
  .nav-right {
    gap: 4px;
  }
  /* Shrink tz buttons */
  .tz-picker {
    gap: 1px;
    padding: 2px;
  }
  .tz-btn {
    font-size: 0.62rem;
    padding: 3px 5px;
  }
  /* Tighten nav-auth links */
  .nav-auth {
    gap: 6px;
  }
  .nav-link {
    font-size: 0.8rem;
    padding: 4px 2px;
  }
  .nav-btn {
    font-size: 0.78rem;
    padding: 6px 10px;
  }
}

@media (max-width: 400px) {
  /* Hide tz picker on very small phones to give nav-auth room */
  .tz-picker { display: none; }
  .nav-auth { gap: 8px; }
  .nav-link { font-size: 0.82rem; }
}

/* ── Global mobile body/main fixes ──────────────────────────────────── */
@media (max-width: 640px) {
  body { overflow-x: hidden; }
  main { padding-top: var(--space-5); padding-bottom: var(--space-5); }
}

/* ── Premium Record Banner (top of landing + dashboard) ─────────────── */
.record-banner {
  background: linear-gradient(135deg, #0F0C2A 0%, #26215C 50%, #3D35A0 100%);
  padding: 28px 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-6);
  border-radius: var(--radius-lg);
}

/* Gold glow orb — top right */
.record-banner::before {
  content: '';
  position: absolute;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(250,199,117,0.12) 0%, transparent 70%);
  top: -120px;
  right: -80px;
  pointer-events: none;
}

/* Purple glow orb — bottom left */
.record-banner::after {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(83,74,183,0.35) 0%, transparent 70%);
  bottom: -100px;
  left: -60px;
  pointer-events: none;
}

.record-banner-eyebrow {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--brand-accent);
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.record-banner-stats {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.rb-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 32px 8px;
  position: relative;
}

/* Vertical dividers between stats */
.rb-stat + .rb-stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 1px;
  background: rgba(255,255,255,0.1);
}

.rb-val {
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}

.rb-lbl {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.38);
  margin-top: 7px;
}

.rb-win  .rb-val { color: #4ADE80; }
.rb-loss .rb-val { color: #F87171; }
.rb-push .rb-val { color: rgba(255,255,255,0.45); }
.rb-positive { color: #4ADE80 !important; }
.rb-negative { color: #F87171 !important; }

/* Make ROI/Profit slightly larger for emphasis */
.rb-roi .rb-val  { font-size: 2.8rem; }
.rb-profit .rb-val { font-size: 2.2rem; }

.record-banner-disclaimer {
  font-size: 0.58rem;
  color: rgba(255,255,255,0.22);
  margin-top: 16px;
  letter-spacing: 0.3px;
  position: relative;
  z-index: 1;
}

@media (max-width: 640px) {
  .record-banner { padding: 22px 16px 16px; border-radius: var(--radius-md); }
  .rb-stat { padding: 4px 18px 6px; }
  .rb-val { font-size: 1.7rem; letter-spacing: -0.5px; }
  .rb-roi .rb-val { font-size: 1.9rem; }
  .rb-profit .rb-val { font-size: 1.5rem; }
  .rb-lbl { font-size: 0.52rem; }
}

@media (max-width: 400px) {
  .rb-stat { padding: 4px 12px 6px; }
  .rb-val { font-size: 1.4rem; }
  .rb-roi .rb-val { font-size: 1.6rem; }
}

/* ── Nav center record pill ──────────────────────────────────────────── */
.nav-record {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-light);
  border: 1px solid var(--brand-border);
  border-radius: 20px;
  padding: 5px 14px;
  margin: 0 auto;       /* flex auto margin: centers between logo and nav-right */
  white-space: nowrap;
  pointer-events: none; /* purely informational */
}

.nr-wlp {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: 0.2px;
}

.nr-divider {
  width: 1px;
  height: 12px;
  background: var(--brand-border);
}

.nr-roi {
  font-size: 0.78rem;
  font-weight: 700;
}

.nr-positive { color: #15803D; }
.nr-negative { color: #C53030; }

@media (max-width: 640px) {
  .nav-record {
    padding: 4px 10px;
    gap: 6px;
  }
  .nr-wlp, .nr-roi { font-size: 0.68rem; }
}

@media (max-width: 480px) {
  /* On very small screens hide the record pill to avoid nav overflow */
  .nav-record { display: none; }
}

/* ------------------------------------------------------------
   Main content wrapper
   ------------------------------------------------------------ */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-5);
}

/* ------------------------------------------------------------
   Hero (landing page)
   ------------------------------------------------------------ */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-8) var(--space-5);
  gap: var(--space-5);
}

.hero-logo {
  max-width: 320px;
  width: 100%;
  height: auto;
}

.hero p {
  max-width: 480px;
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, box-shadow 0.15s;
  text-decoration: none;
}

.btn:hover { opacity: 0.88; text-decoration: none; }

.btn-primary {
  background: var(--brand-primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: var(--brand-light);
  color: var(--brand-dark);
  border: 1px solid var(--brand-border);
}

button.btn-primary,
button[type="submit"] {
  background: var(--brand-primary);
  color: #ffffff;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  width: 100%;
  margin-top: var(--space-4);
  transition: opacity 0.15s;
}

button[type="submit"]:hover { opacity: 0.88; }

/* ------------------------------------------------------------
   Cards
   ------------------------------------------------------------ */
.card {
  background: #ffffff;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------
   Forms
   ------------------------------------------------------------ */
.form-card {
  max-width: 420px;
  margin: 0 auto;
}

form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: #ffffff;
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(83, 74, 183, 0.12);
}

/* ------------------------------------------------------------
   Alerts
   ------------------------------------------------------------ */
.error {
  background: #FFF0F0;
  border: 1px solid #FFBDBD;
  color: #C0392B;
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  margin-bottom: var(--space-2);
}

/* ------------------------------------------------------------
   EV badges
   ------------------------------------------------------------ */
.ev-high   { color: var(--brand-primary); font-weight: 700; }
.ev-medium { color: var(--brand-success);  font-weight: 600; }
.ev-low    { color: var(--brand-accent);   font-weight: 600; }

/* ------------------------------------------------------------
   Footer / tagline
   ------------------------------------------------------------ */
.tagline {
  color: var(--brand-muted);
  font-size: 0.85rem;
  text-align: center;
  margin-top: var(--space-7);
}
