/* ═══════════════════════════════════════════════════════
   TNT Federation Command — Login
   Cybersecurity Operations Console
   ═══════════════════════════════════════════════════════ */

:root {
  --bg-dark: #060a12;
  --bg-card: rgba(12,18,32,.92);
  --bg-input: rgba(15,23,42,.8);
  --border-primary: rgba(59,130,246,.12);
  --border-glow: rgba(59,130,246,.25);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-red: #ef4444;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ── Animated Background ─────────────────────────────── */
.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* Hex grid */
.login-grid {
  position: absolute;
  inset: -20%;
  width: 140%;
  height: 140%;
  background-image:
    linear-gradient(rgba(59,130,246,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,.025) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Radial glow behind card */
.login-bg::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(59,130,246,.06) 0%, rgba(6,182,212,.03) 40%, transparent 70%);
  pointer-events: none;
}

/* Scanning line effect */
.login-bg::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(59,130,246,.15) 20%, rgba(6,182,212,.2) 50%, rgba(59,130,246,.15) 80%, transparent 100%);
  animation: scanline 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes scanline {
  0%, 100% { top: -2px; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* Floating particles */
.login-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.login-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(59,130,246,.3);
  border-radius: 50%;
  animation: float linear infinite;
}

@keyframes float {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ── Container ───────────────────────────────────────── */
.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
}

/* ── Card ────────────────────────────────────────────── */
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  padding: 2.2rem 2rem;
  backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(59,130,246,.05),
    0 25px 60px rgba(0,0,0,.6),
    0 0 80px rgba(59,130,246,.03),
    inset 0 1px 0 rgba(255,255,255,.03);
  position: relative;
  overflow: hidden;
}

/* Top accent line */
.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59,130,246,.4), rgba(6,182,212,.4), transparent);
}

/* ── Logo Section ────────────────────────────────────── */
.login-logo {
  text-align: center;
  margin-bottom: 1.8rem;
}

.login-logo-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin-bottom: .8rem;
  border: 2px solid rgba(59,130,246,.15);
  box-shadow: 0 0 30px rgba(59,130,246,.1), 0 0 60px rgba(6,182,212,.05);
  transition: box-shadow .3s;
}

.login-logo-img:hover {
  box-shadow: 0 0 40px rgba(59,130,246,.2), 0 0 80px rgba(6,182,212,.1);
}

.login-logo h1 {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-primary);
  margin-bottom: .15rem;
}

.login-logo h1 span {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-logo-sub {
  font-size: .58rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-weight: 500;
}

/* System status indicator */
.login-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  margin-top: .8rem;
  padding: .35rem .7rem;
  background: rgba(16,185,129,.05);
  border: 1px solid rgba(16,185,129,.1);
  border-radius: 20px;
  font-size: .55rem;
  color: var(--accent-emerald);
  letter-spacing: .5px;
  display: inline-flex;
}

.login-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-emerald);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16,185,129,.4); }
  50% { opacity: .7; box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}

/* ── Messages ────────────────────────────────────────── */
.login-msg {
  display: none;
  padding: .55rem .75rem;
  border-radius: 8px;
  font-size: .68rem;
  margin-bottom: .8rem;
  line-height: 1.4;
  font-family: var(--mono);
  font-weight: 500;
}

.login-msg.error {
  display: block;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.15);
  color: var(--accent-red);
}

.login-msg.success {
  display: block;
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.15);
  color: var(--accent-emerald);
}

.login-msg.info {
  display: block;
  background: rgba(59,130,246,.08);
  border: 1px solid rgba(59,130,246,.15);
  color: var(--accent-blue);
}

/* ── Form Fields ─────────────────────────────────────── */
.login-field {
  margin-bottom: .9rem;
  position: relative;
}

.login-field label {
  display: block;
  font-size: .6rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-field input {
  width: 100%;
  padding: .7rem .9rem;
  background: var(--bg-input);
  border: 1px solid rgba(59,130,246,.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: .8rem;
  font-family: var(--font);
  outline: none;
  transition: all .25s;
}

.login-field input:focus {
  border-color: rgba(59,130,246,.4);
  box-shadow: 0 0 0 3px rgba(59,130,246,.08), 0 0 20px rgba(59,130,246,.05);
  background: rgba(15,23,42,.95);
}

.login-field input::placeholder {
  color: var(--text-muted);
  font-size: .72rem;
}

/* ── Submit Button ───────────────────────────────────── */
.login-btn {
  width: 100%;
  padding: .75rem;
  background: linear-gradient(135deg, rgba(59,130,246,.9), rgba(37,99,235,.9));
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  font-family: var(--font);
  border: 1px solid rgba(59,130,246,.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all .25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: .4rem;
  position: relative;
  overflow: hidden;
}

.login-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.05) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform .5s;
}

.login-btn:hover::before {
  transform: translateX(100%);
}

.login-btn:hover {
  background: linear-gradient(135deg, rgba(59,130,246,1), rgba(37,99,235,1));
  box-shadow: 0 0 25px rgba(59,130,246,.2), 0 4px 15px rgba(59,130,246,.15);
  transform: translateY(-1px);
}

.login-btn:active {
  transform: translateY(0);
  box-shadow: 0 0 15px rgba(59,130,246,.15);
}

.login-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.login-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

.login-btn.loading .login-spinner { display: block; }
.login-btn.loading #loginBtnText { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── OTP / TOTP Step Info ────────────────────────────── */
.login-step-info {
  text-align: center;
  margin-bottom: 1.2rem;
  padding: .9rem;
  background: rgba(59,130,246,.04);
  border-radius: 10px;
  border: 1px solid rgba(59,130,246,.08);
}

.login-step-icon {
  font-size: 1.5rem;
  margin-bottom: .4rem;
  filter: grayscale(.3);
}

.login-step-info p {
  font-size: .68rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Resend ──────────────────────────────────────────── */
.login-resend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: .8rem;
}

.login-link {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: .62rem;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font);
  letter-spacing: .3px;
  transition: color .2s;
}

.login-link:hover { color: var(--accent-blue); }

.login-link:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.login-timer {
  font-size: .58rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

/* ── Footer ──────────────────────────────────────────── */
.login-footer {
  margin-top: 1.5rem;
  text-align: center;
  position: relative;
}

.login-footer-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-primary), transparent);
  margin-bottom: .7rem;
}

.login-footer span {
  font-size: .5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.login-footer-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: .4rem;
  font-size: .48rem;
  color: rgba(100,116,139,.5);
  font-family: var(--mono);
  letter-spacing: .5px;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 480px) {
  .login-container { padding: 1rem; }
  .login-card { padding: 1.5rem 1.2rem; }
  .login-logo-img { width: 56px; height: 56px; }
}
