/* ── LOGIN V3 — MLRO COPILOT ──────────────────────────────────────────────── */

#loginOverlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 99999; display: block;
  --lv3-green:        #015441;
  --lv3-green-deep:   #013a2d;
  --lv3-green-darker: #002a20;
  --lv3-green-glow:   #7fd1ad;
  --lv3-teal:         #00c471;
  --lv3-paper:        #f7f8fa;
  --lv3-ink-900:      #0d1418;
  --lv3-ink-700:      #2c3338;
  --lv3-ink-600:      #4a5258;
  --lv3-ink-500:      #666666;
  --lv3-ink-400:      #8b9298;
  --lv3-ink-300:      #9aa1a8;
  --lv3-ink-200:      #e5e7eb;
  --lv3-ink-150:      #eef0f2;
  --lv3-ink-100:      #f3f4f6;
  --lv3-ink-50:       #f9fafb;
  --lv3-crimson:      #b23a3a;
  --lv3-amber:        #b87a17;
  --lv3-radius:       6px;
}
#loginOverlay.hidden { display: none !important; }
body.login-active { overflow: hidden; }
body.login-active .sidebar,
body.login-active .main { visibility: hidden; }

/* Stage */
.lv3-stage {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px; line-height: 1.5;
  color: var(--lv3-ink-900);
  -webkit-font-smoothing: antialiased;
}

/* ── LEFT TOWER ── */
.lv3-tower {
  position: relative;
  background:
    radial-gradient(900px 600px at 0% 0%, rgba(127,209,173,0.06) 0%, transparent 60%),
    radial-gradient(800px 600px at 100% 100%, rgba(0,196,113,0.04) 0%, transparent 60%),
    linear-gradient(180deg, #015441 0%, #002a20 100%);
  color: #fff;
  padding: 32px clamp(28px, 3.2vw, 44px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  overflow: hidden;
  min-width: 0;
}
.lv3-tower::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 30%, black 30%, transparent 80%);
          mask-image: radial-gradient(ellipse at 30% 30%, black 30%, transparent 80%);
}
.lv3-tower > * { position: relative; }

.lv3-tower-top {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.lv3-logo-row { display: flex; align-items: center; gap: 12px; }
.lv3-logo-mark {
  width: 38px; height: 38px; border-radius: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  display: grid; place-items: center; color: #fff; flex-shrink: 0;
}
.lv3-logo-name {
  font-family: 'Sora', sans-serif; font-weight: 700;
  font-size: 17px; letter-spacing: -0.005em; line-height: 1; color: #fff;
}
.lv3-logo-sub {
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.55); margin-top: 6px;
}
.lv3-clock {
  display: flex; align-items: center; gap: 14px;
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 11px; letter-spacing: 0.06em; color: rgba(255,255,255,0.7);
}
.lv3-time { font-size: 13px; font-weight: 600; color: #fff; }
.lv3-sep { opacity: 0.3; }
.lv3-pulse {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; background: var(--lv3-green-glow);
  animation: lv3-pulse 2s ease-in-out infinite;
}
@keyframes lv3-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(127,209,173,0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(127,209,173,0); }
  100% { box-shadow: 0 0 0 0 rgba(127,209,173,0); }
}

.lv3-tower-mid {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; gap: 32px; max-width: 620px; width: 100%;
}
.lv3-eyebrow {
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  display: inline-flex; align-items: center; gap: 12px;
}
.lv3-eyebrow::before {
  content: ''; display: inline-block; width: 24px; height: 1px;
  background: rgba(255,255,255,0.4);
}
.lv3-headline {
  font-family: 'Sora', sans-serif;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.1; letter-spacing: -0.02em;
  font-weight: 700; margin: 16px 0 0; text-wrap: balance;
}
.lv3-accent { color: var(--lv3-green-glow); }
.lv3-headline-sub {
  margin: 16px 0 0; max-width: 520px;
  font-size: 15px; line-height: 1.55;
  color: rgba(255,255,255,0.66);
}

/* Ticker */
.lv3-ticker {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.02);
  border-radius: 8px; overflow: hidden;
}
.lv3-ticker-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.lv3-live {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--lv3-green-glow); font-weight: 500;
}
.lv3-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--lv3-green-glow);
  animation: lv3-pulse 1.6s ease-in-out infinite;
}
.lv3-ticker-rows { height: 132px; overflow: hidden; position: relative; }
.lv3-ticker-rows::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 32px;
  background: linear-gradient(180deg, transparent, rgba(0,42,32,0.95));
  pointer-events: none;
}
.lv3-ticker-stream {
  display: flex; flex-direction: column;
  animation: lv3-ticker-scroll 22s linear infinite;
}
@keyframes lv3-ticker-scroll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}
.lv3-ticker-row {
  display: grid;
  grid-template-columns: 64px 80px 1fr auto;
  gap: 14px; align-items: center;
  padding: 9px 14px;
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 11.5px; line-height: 1.4;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.78);
}
.lv3-ticker-row .lv3-t { color: rgba(255,255,255,0.45); letter-spacing: 0.04em; }
.lv3-ticker-row .lv3-tag {
  display: inline-block; padding: 2px 7px; border-radius: 3px;
  font-size: 9.5px; letter-spacing: 0.10em; text-transform: uppercase; font-weight: 600;
}
.lv3-tag-scan   { background: rgba(127,209,173,0.10); color: var(--lv3-green-glow); border: 1px solid rgba(127,209,173,0.25); }
.lv3-tag-match  { background: rgba(184,122,23,0.14);  color: #f0c264; border: 1px solid rgba(184,122,23,0.30); }
.lv3-tag-update { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.75); border: 1px solid rgba(255,255,255,0.14); }
.lv3-tag-alert  { background: rgba(178,58,58,0.18);   color: #ef9090; border: 1px solid rgba(178,58,58,0.35); }
.lv3-ticker-row .lv3-tbody {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: rgba(255,255,255,0.85);
}
.lv3-ticker-row .lv3-tbody em { font-style: normal; color: var(--lv3-green-glow); font-weight: 500; }
.lv3-ticker-row .lv3-ref { color: rgba(255,255,255,0.4); }

/* Metrics */
.lv3-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.lv3-metric {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.02);
  border-radius: 8px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.lv3-lbl {
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.lv3-val {
  font-family: 'Sora', sans-serif;
  font-size: 26px; font-weight: 600; line-height: 1;
  letter-spacing: -0.02em; color: #fff;
}
.lv3-delta {
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 11px; color: var(--lv3-green-glow);
  display: inline-flex; align-items: center; gap: 5px;
}
.lv3-delta.lv3-warn { color: #f0c264; line-height: 1.5; }
.lv3-spark { width: 100%; height: 28px; display: block; margin-top: 2px; }

/* Tower bottom */
.lv3-tower-bot {
  border-top: 1px solid rgba(255,255,255,0.10);
  padding-top: 18px;
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center;
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.06em; color: rgba(255,255,255,0.6);
}
.lv3-sources-label { color: rgba(255,255,255,0.5); margin-right: 4px; }
.lv3-reg {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 9px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
}
.lv3-indicator { width: 6px; height: 6px; border-radius: 50%; background: var(--lv3-green-glow); }
.lv3-reg.lv3-stale .lv3-indicator { background: #f0c264; }
.lv3-reg-name { color: rgba(255,255,255,0.85); font-weight: 500; }

/* ── RIGHT PANE ── */
.lv3-return-pane {
  background: var(--lv3-paper);
  display: flex; flex-direction: column;
  padding: clamp(28px, 4vw, 56px);
  position: relative; min-width: 0;
}
.lv3-return-top {
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 11px; letter-spacing: 0.06em; color: var(--lv3-ink-500);
}
.lv3-session { display: inline-flex; align-items: center; gap: 8px; }
.lv3-session::before {
  content: ''; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%; background: var(--lv3-teal);
}
.lv3-help-top {
  color: var(--lv3-ink-700); text-decoration: none; font-size: 11px;
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace; letter-spacing: 0.06em;
}
.lv3-help-top:hover { color: var(--lv3-green); }

.lv3-return-body {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 0;
}
.lv3-pane-wrapper { width: 100%; max-width: 420px; }
.lv3-form-shell { display: flex; flex-direction: column; gap: 28px; }

/* Greeting */
.lv3-greet { display: flex; flex-direction: column; gap: 10px; }
.lv3-greet-eyebrow {
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--lv3-green); font-weight: 600;
}
.lv3-greet-h2 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(26px, 2.4vw, 32px);
  line-height: 1.1; letter-spacing: -0.02em;
  font-weight: 700; margin: 0; color: var(--lv3-ink-900);
}

/* Briefing */
.lv3-briefing {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--lv3-ink-200);
  border-radius: 8px; background: #fff; overflow: hidden;
}
.lv3-brief-col {
  padding: 14px 16px;
  border-right: 1px solid var(--lv3-ink-150);
  display: flex; flex-direction: column; gap: 6px;
}
.lv3-brief-col:last-child { border-right: 0; }
.lv3-brief-lbl {
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--lv3-ink-500);
}
.lv3-brief-val {
  font-family: 'Sora', sans-serif;
  font-size: 22px; font-weight: 600; line-height: 1;
  letter-spacing: -0.01em; color: var(--lv3-ink-900);
  display: inline-flex; align-items: baseline; gap: 6px;
}
.lv3-pip { width: 7px; height: 7px; border-radius: 50%; display: inline-block; transform: translateY(-3px); }
.lv3-pip-warn  { background: var(--lv3-amber); }
.lv3-pip-alert { background: var(--lv3-crimson); }
.lv3-brief-note {
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 10.5px; color: var(--lv3-ink-500); letter-spacing: 0.02em;
}

/* Fields */
.lv3-fields { display: flex; flex-direction: column; gap: 18px; }
.lv3-field  { display: flex; flex-direction: column; gap: 7px; }
.lv3-field-label {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--lv3-ink-500);
}
.lv3-input-wrap {
  display: flex; align-items: center;
  background: #fff; border: 1px solid var(--lv3-ink-200);
  border-radius: var(--lv3-radius); height: 46px;
  transition: border-color .15s, box-shadow .15s;
}
.lv3-input-wrap:focus-within {
  border-color: var(--lv3-green);
  box-shadow: 0 0 0 3px rgba(1,84,65,0.12);
}
.lv3-input-wrap input {
  flex: 1; border: 0; outline: 0; background: transparent;
  padding: 0 14px; height: 100%;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14px; color: var(--lv3-ink-900);
}
.lv3-input-wrap input::placeholder { color: var(--lv3-ink-300); }
.lv3-pw-toggle {
  background: transparent; border: 0; cursor: pointer;
  padding: 0 12px; height: 100%;
  display: flex; align-items: center; color: var(--lv3-ink-500);
}
.lv3-pw-toggle:hover { color: var(--lv3-ink-700); }

/* Error / confirm */
.lv3-error {
  font-size: 13px; color: var(--lv3-crimson);
  background: rgba(178,58,58,0.06);
  border: 1px solid rgba(178,58,58,0.2);
  border-radius: var(--lv3-radius); padding: 10px 13px;
}
.lv3-confirm {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: #016b4a; line-height: 1.5;
  background: rgba(0,196,113,0.07);
  border: 1px solid rgba(0,196,113,0.25);
  border-radius: var(--lv3-radius); padding: 11px 13px;
}

/* Submit — keep .login-btn-w for auth.js querySelector compatibility */
.login-btn-w,
.lv3-submit {
  height: 50px; width: 100%;
  background: var(--lv3-green); color: #fff;
  border: 0; border-radius: var(--lv3-radius);
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 600; font-size: 14.5px; letter-spacing: -0.005em;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background .15s, transform .05s;
  box-shadow: 0 1px 2px rgba(1,42,32,0.18);
  white-space: nowrap;
}
.login-btn-w:hover:not([disabled]),
.lv3-submit:hover:not([disabled]) { background: var(--lv3-green-deep); }
.login-btn-w:active,
.lv3-submit:active { transform: translateY(1px); }
.login-btn-w[disabled],
.lv3-submit[disabled] { opacity: 0.55; cursor: not-allowed; }

/* MFA hint */
.lv3-mfa-hint {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: -10px;
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 11px; letter-spacing: 0.06em; color: var(--lv3-ink-500);
}

/* Help row */
.lv3-help-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding-top: 4px;
}
.lv3-help-link {
  font-size: 13px; color: var(--lv3-teal);
  text-decoration: none; font-weight: 500; white-space: nowrap;
  background: none; border: 0; cursor: pointer; padding: 0;
  font-family: 'Inter', -apple-system, sans-serif;
}
.lv3-help-link:hover { color: var(--lv3-green); text-decoration: underline; }

/* Back link */
.lv3-back {
  font-size: 13px; color: var(--lv3-green);
  cursor: pointer; font-weight: 600; display: inline-block;
}
.lv3-back:hover { opacity: 0.7; }

/* Footer */
.lv3-return-foot {
  border-top: 1px solid var(--lv3-ink-200); padding-top: 14px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.04em; color: var(--lv3-ink-500);
}
.lv3-foot-left { display: inline-flex; gap: 14px; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 980px) {
  .lv3-stage { grid-template-columns: 1fr; }
  .lv3-tower { padding: 28px; min-height: auto; }
  .lv3-tower-mid { gap: 20px; }
  .lv3-return-pane { padding: 32px 24px; }
}
@media (max-width: 600px) {
  .lv3-metrics { grid-template-columns: 1fr; }
  .lv3-briefing { grid-template-columns: 1fr; }
  .lv3-brief-col { border-right: 0; border-bottom: 1px solid var(--lv3-ink-150); }
  .lv3-brief-col:last-child { border-bottom: 0; }
}
