/* ════════════════════════════════════════════════════════════
   TradingAgents — Login
   Terminal theme tokens (mirrors style.css :root, standalone page)
   ════════════════════════════════════════════════════════════ */

:root {
  --bg:          #06080e;
  --bg2:         #0b0f1a;
  --bg3:         #101525;
  --border:      rgba(78,140,255,0.10);
  --border2:     rgba(78,140,255,0.20);
  --accent:      #4e8cff;
  --accent-bright: #6fa8ff;
  --accent-glow: rgba(78,140,255,0.20);
  --teal:        #00ddb3;
  --danger:      #ff4d6a;
  --text:        #e8edf8;
  --text2:       #8694b8;
  --text3:       #3e4e72;
  --font:        'Inter', -apple-system, sans-serif;
  --mono:        'JetBrains Mono', 'Cascadia Code', monospace;
  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 45% at 50% 0%, rgba(78,140,255,0.07), transparent 70%),
    linear-gradient(rgba(78,140,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(78,140,255,0.03) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.scene {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

/* ─── Card ─── */
.card {
  width: 100%;
  max-width: 360px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 32px 28px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 24px 64px rgba(0,0,0,0.55);
  animation: card-in 240ms var(--ease-out) both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ─── Signature motif ─── */
.motif {
  display: block;
  width: 100%;
  height: 48px;
  margin-bottom: 20px;
  opacity: 0.9;
}
.motif .c-up   { fill: rgba(0,221,179,0.55); }
.motif .w-up   { stroke: rgba(0,221,179,0.40); stroke-width: 1.2; }
.motif .c-down { fill: rgba(78,140,255,0.28); }
.motif .w-down { stroke: rgba(78,140,255,0.22); stroke-width: 1.2; }
.motif .spark {
  stroke: var(--accent-bright);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 0 6px rgba(78,140,255,0.45));
  animation: spark-draw 900ms var(--ease-out) 150ms forwards;
}
.motif .spark-dot {
  fill: var(--accent-bright);
  opacity: 0;
  animation: dot-in 200ms var(--ease-out) 1050ms forwards,
             dot-pulse 2.8s ease-in-out 1.3s infinite;
}

@keyframes spark-draw { to { stroke-dashoffset: 0; } }
@keyframes dot-in     { to { opacity: 1; } }
@keyframes dot-pulse  { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ─── Brand ─── */
.brand { text-align: center; margin-bottom: 24px; }
.wordmark {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--accent-bright), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tagline {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text3);
}

/* ─── Error ─── */
.error {
  margin-bottom: 16px;
  padding: 9px 12px;
  border: 1px solid rgba(255,77,106,0.28);
  border-radius: 8px;
  background: rgba(255,77,106,0.08);
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 500;
  animation: card-in 180ms var(--ease-out) both;
}

/* ─── Form ─── */
.form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text2);
}
.field input {
  background: var(--bg2);           /* inset: darker than the card */
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 150ms var(--ease-out),
              box-shadow 150ms var(--ease-out);
}
.field input::placeholder { color: var(--text3); }
.field input:hover { border-color: var(--border2); }
.field input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.submit {
  margin-top: 4px;
  background: linear-gradient(135deg, var(--accent), #3a6fd8);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 11px 16px;
  color: #fff;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 120ms var(--ease-out),
              box-shadow 150ms var(--ease-out),
              filter 150ms var(--ease-out);
}
.submit:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 20px rgba(78,140,255,0.30);
}
.submit:active { transform: scale(0.97); }
.submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ─── Meta line ─── */
.meta {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  color: var(--text3);
  font-variant-numeric: tabular-nums;
}
.meta-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 6px rgba(0,221,179,0.6);
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  .card, .error { animation: none; }
  .motif .spark { animation: none; stroke-dashoffset: 0; }
  .motif .spark-dot { animation: none; opacity: 1; }
  .submit, .field input { transition: none; }
}
