/* ==========================================================================
   ARGUS — Login (login.html)
   Reuses the core ARGUS design tokens (see /docs/brandbook.md). Kept as its
   own stylesheet since the login screen is a standalone full-bleed hero, not
   part of the mission-control grid in argus.css.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg-void: #05070a;
  --bg-panel-raised: #10151c;
  --bg-glass: rgba(16, 21, 28, 0.72);
  --border-hairline: rgba(255, 255, 255, 0.06);
  --border-hairline-strong: rgba(255, 255, 255, 0.12);

  --accent: #e8a03d;
  --accent-bright: #ffc766;
  --accent-dim: rgba(232, 160, 61, 0.14);

  --text-primary: #eef1f4;
  --text-secondary: #9aa4b1;
  --text-tertiary: #5b6472;
  --negative: #ff5c5c;
  --negative-dim: rgba(255, 92, 92, 0.14);

  --font-ui: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;

  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-ui);
  overflow: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

::selection { background: var(--accent-dim); color: var(--accent-bright); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ==========================================================================
   Cinematic backdrop — concentric radar rings + a large breathing iris mark
   + a few slow drifting particles. Pure CSS, respects reduced-motion.
   ========================================================================== */
#login-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 1400px 900px at 50% 30%, rgba(232, 160, 61, 0.06), transparent 60%),
    radial-gradient(ellipse 1000px 700px at 80% 90%, rgba(61, 150, 220, 0.03), transparent 60%),
    var(--bg-void);
}

#backdrop-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 720px;
  height: 720px;
  max-width: none;
  transform: translate(-50%, -50%) scale(0.98);
  opacity: 0.05;
  filter: drop-shadow(0 0 60px rgba(232, 160, 61, 0.25));
  animation: backdrop-breathe 8s ease-in-out infinite;
}
@keyframes backdrop-breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(0.98); opacity: 0.045; }
  50% { transform: translate(-50%, -50%) scale(1.03); opacity: 0.08; }
}

.radar-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(232, 160, 61, 0.14);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: radar-expand 9s ease-out infinite;
}
.ring-1 { width: 200px; height: 200px; animation-delay: 0s; }
.ring-2 { width: 200px; height: 200px; animation-delay: 3s; }
.ring-3 { width: 200px; height: 200px; animation-delay: 6s; }
@keyframes radar-expand {
  0% { width: 200px; height: 200px; opacity: 0; }
  10% { opacity: 0.5; }
  100% { width: 1400px; height: 1400px; opacity: 0; }
}

.particles {
  position: absolute;
  inset: 0;
}
.particles span {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.25;
  animation: particle-drift linear infinite;
}
.particles span:nth-child(1) { left: 8%; top: 20%; animation-duration: 22s; animation-delay: -1s; }
.particles span:nth-child(2) { left: 22%; top: 70%; animation-duration: 28s; animation-delay: -6s; }
.particles span:nth-child(3) { left: 40%; top: 15%; animation-duration: 25s; animation-delay: -12s; }
.particles span:nth-child(4) { left: 58%; top: 85%; animation-duration: 30s; animation-delay: -3s; }
.particles span:nth-child(5) { left: 72%; top: 30%; animation-duration: 20s; animation-delay: -9s; }
.particles span:nth-child(6) { left: 85%; top: 60%; animation-duration: 26s; animation-delay: -14s; }
.particles span:nth-child(7) { left: 15%; top: 50%; animation-duration: 24s; animation-delay: -4s; }
.particles span:nth-child(8) { left: 65%; top: 10%; animation-duration: 32s; animation-delay: -18s; }
.particles span:nth-child(9) { left: 92%; top: 82%; animation-duration: 27s; animation-delay: -8s; }
.particles span:nth-child(10) { left: 48%; top: 55%; animation-duration: 23s; animation-delay: -16s; }
@keyframes particle-drift {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 0.3; }
  90% { opacity: 0.3; }
  100% { transform: translateY(-120px) translateX(20px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #backdrop-mark { animation: none; opacity: 0.05; transform: translate(-50%, -50%); }
  .radar-ring { animation: none; opacity: 0; }
  .particles span { animation: none; opacity: 0; }
}

/* ==========================================================================
   Stage / brand / card
   ========================================================================== */
#login-stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 24px;
}

#login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

#login-mark {
  display: block;
  border-radius: 50%;
  filter: drop-shadow(0 0 6px rgba(232, 160, 61, 0.4));
  animation: login-mark-breathe 4s ease-in-out infinite;
}
@keyframes login-mark-breathe {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(232, 160, 61, 0.4)); transform: scale(0.99); }
  50% { filter: drop-shadow(0 0 14px rgba(232, 160, 61, 0.7)); transform: scale(1.03); }
}
@media (prefers-reduced-motion: reduce) {
  #login-mark { animation: none; }
}

.login-wordmark {
  font-weight: 800;
  font-size: 34px;
  letter-spacing: 0.16em;
  color: var(--text-primary);
}
.login-wordmark span { color: var(--accent); }

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#login-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-hairline-strong);
  border-radius: var(--radius-lg);
  padding: 28px 26px 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

#login-card.shake { animation: login-shake 0.42s ease; }
@keyframes login-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  #login-card.shake { animation: none; }
}

#login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--negative-dim);
  border: 1px solid rgba(255, 92, 92, 0.3);
  color: #ffb3b3;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 9px 12px;
  margin-bottom: 16px;
}
#login-error svg { flex-shrink: 0; color: var(--negative); }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  background: var(--bg-void);
  border: 1px solid var(--border-hairline-strong);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.password-wrap { position: relative; }
.password-wrap input { padding-right: 42px; }
#toggle-password {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: color 0.15s ease;
}
#toggle-password:hover { color: var(--text-secondary); }
#toggle-password[aria-pressed="true"] { color: var(--accent-bright); }

#login-submit {
  width: 100%;
  margin-top: 6px;
  background: var(--accent);
  color: #1a1305;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
#login-submit:hover { background: var(--accent-bright); }
#login-submit:active { transform: translateY(1px); }

#login-footnote {
  margin: 18px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

@media (max-width: 420px) {
  #login-card { padding: 22px 18px 18px; }
  .login-wordmark { font-size: 28px; }
}
