/* ======================================================================================
   BOOT.CSS
   Login + Boot Overlay
   Loaded only on index.html
   ====================================================================================== */

/* ======================================================================================
   ROOT VARS (ONLY VARS USED IN THIS FILE)
   ====================================================================================== */

:root {
  --white: #ffffff;
  --red: #dc3545;
  --green: #00ff38;
  --pink: #ff00c1;
  --link: #1875ff;
  --window-dark: #0e1111;
  --window-darker: #020202;
  --window-border: #353839;
  --window-border2: #0e1111;
  --boot-bg: #000;
  --boot-fg: #cfd3d7;
  --boot-dim: #343a40;
  --ok: #00ff38;
  --warn: #ffdd57;
  --fail: #dc3545;
  --info: #1875ff;
  --panel-border: #22272e;
  --panel-head: #0d0f12;
  --side-w: 460px;
  --w-time: 12ch;
  --w-val: 18ch;
  --breakpoint-xs: 0;
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1440px;
  --breakpoint-xl: 1600px;
  --breakpoint-xxl: 1920px;
  --clear: #0000;
  --neon-cyan: #00ccff;
  --neon-cyan-soft: rgba(0,204,255,.45);
  --neon-green-soft: rgba(0,255,69,.45);
  --neon-blue-soft: rgba(0,170,255,.45);
  --panel-glow: rgba(0,204,255,.18);
  --panel-glow-strong: rgba(0,204,255,.35);
  --login-bg-dark: #050505;
  --login-bg-mid: #0b0b0b;
  --login-bg-light: #111;
}

/* ======================================================================================
   LOGIN SCREEN (FINAL WATCH_DOGS STYLE – COMPACT PULSES)
   ====================================================================================== */

/* Full-screen blackout wrapper */

#login-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Internal fullscreen wrapper */

#login-form {
  width: 100vw;
  height: 100vh;
  background: #050505;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* ==========================================================
   LOGIN WINDOW (CORE CONTAINER)
   ========================================================== */

.login-container {
  width: 520px;
  background: rgb(5,5,5);
  border: 3px solid var(--boot-dim);
  box-shadow: 0 0 6px rgba(0,255,255,0.15), 0 0 12px rgba(0,255,255,0.08);
  display: flex;
  flex-direction: column;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

/* Fade-in state (added by JS after boot) */

.login-container.login-visible {
  opacity: 1;
  pointer-events: all;
}

/* Fade-out state (existing exit animation) */

.login-container.login-fade-out {
  animation: loginFadeOut 0.6s ease forwards;
}

@keyframes loginFadeOut {
  to {
    opacity: 0;
    pointer-events: none;
  }
}

/* Header */

/* Animated gradient sweep — extended dark zones */

.login-header {
  width: 100%;
  padding: 12px 16px;
  border-bottom: 3px solid var(--boot-dim);
  background: linear-gradient( 100deg, #0c0c0c 0%, #0c0c0c 22%, #111821 35%, #15212c 46%, #111821 58%, #0c0c0c 78%, #0c0c0c 100% );
  background-size: 320% 100%;
  animation: headerSweep 6s linear infinite;
  font-family: Oxanium;
  color: var(--info);
  font-size: 0.95rem;
  letter-spacing: 2px;
  text-shadow: 0 0 4px rgba(0,204,255,0.65), 0 0 8px rgba(0,204,255,0.28);
}

/* Smooth right → left motion */

@keyframes headerSweep {
  0% {
    background-position: 250% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

/* Body */

.login-body {
  display: flex;
  padding: 24px;
  gap: 24px;
}

/* Left column */

.login-left {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-avatar {
  width: 135px;
  height: 135px;
  border: 3px solid var(--boot-dim);
  background: rgba(14,14,14,0.8);
  padding: 0;
  box-shadow: 0 0 4px rgba(0,255,255,0.20), inset 0 0 4px rgba(0,255,255,0.10);
}

.login-username {
  margin-top: 10px;
  width: 100%;
  text-align: center;
  border: 2px solid var(--boot-dim);
  padding: 8px 0 4px 0;
  color: white;
  background: rgba(14,14,14,0.8);
  font-size: 1.05rem;
  box-shadow: 0 0 4px rgba(255,0,0,0.12), inset 0 0 3px rgba(255,0,0,0.1);
}

/* Right column */

.login-right {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.field-label {
  font-family: Oxanium;
  margin-bottom: 6px;
  color: #cfcfcf;
}

/* Password field */

#login-pass {
  width: 100%;
  border: 3px solid var(--boot-dim);
  background: rgba(14,14,14,0.8);
  color: #fff;
  padding: 10px;
  font-family: Oxanium;
  transition: box-shadow 120ms linear;
}

#login-pass:focus {
  box-shadow: inset 0 0 9px rgba(0,255,200,0.35), 0 0 8px rgba(0,255,200,0.20);
}

/* Button row */

.login-actions {
  margin-top: 26px;
  display: flex;
  justify-content: space-between;
}

/* Base button style */

#cancel-button, #login-button {
  width: 48%;
  padding: 8px 0;
  background: rgba(14,14,14,0.8);
  border: 3px solid var(--boot-dim);
  color: #fff;
  font-family: Oxanium;
  transition: box-shadow 120ms linear;
  box-shadow: inset 0 0 6px rgba(255,0,0,0.30);
}

/* When typing finished → Login "ready" glow */

#login-button.input-ready {
  box-shadow: inset 0 0 7px rgba(0,255,56,0.55), 0 0 5px rgba(0,255,56,0.22);
}

/* Cancel "ready" yellow state */

#cancel-button.input-ready2 {
  box-shadow: inset 0 0 7px rgba(255,205,25,0.55), 0 0 5px rgba(255,205,25,0.20);
}

/* ==========================================================
   ULTRA-SMOOTH LOGIN PULSE  — minimal radius shift
   ========================================================== */

@keyframes pulse-login {
  0% {
    box-shadow: inset 0 0 8px rgba(0,255,56,0.55), 0 0 3px rgba(0,255,56,0.25);
  }
  50% {
    box-shadow: inset 0 0 8px rgba(0,255,56,0.95), 0 0 6px rgba(0,255,56,0.35);
  }
  100% {
    box-shadow: inset 0 0 8px rgba(0,255,56,0.55), 0 0 3px rgba(0,255,56,0.25);
  }
}

.pulse-login {
  animation: pulse-login 1.15s cubic-bezier(0.42,0,0.23,1) both;
}

/* ==========================================================
   ULTRA-SMOOTH CANCEL PULSE — softer, no jump
   ========================================================== */

@keyframes pulse-cancel {
  0% {
    box-shadow: inset 0 0 8px rgba(255,75,75,0.45), 0 0 3px rgba(255,75,75,0.20);
  }
  50% {
    box-shadow: inset 0 0 8px rgba(255,75,75,0.85), 0 0 6px rgba(255,75,75,0.32);
  }
  100% {
    box-shadow: inset 0 0 8px rgba(255,75,75,0.45), 0 0 3px rgba(255,75,75,0.20);
  }
}

.pulse-cancel {
  animation: pulse-cancel 1.1s cubic-bezier(0.42,0,0.23,1) both;
}

/* Footer underline */

.login-footer {
  width: 100%;
  height: 4px;
  background: repeating-linear-gradient( 90deg, var(--boot-dim) 0px, var(--boot-dim) 2px, transparent 2px, transparent 8px );
}

@keyframes headerCursorBlink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* ======================================================================================
   9) BOOT OVERLAY (console + panels)
   ====================================================================================== */

.znx-boot {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 2147483647;
  pointer-events: all;
  background: var(--boot-bg);
  color: var(--boot-fg);
  font: 1.05rem Oxanium;
  letter-spacing: .2px;
  opacity: 1;
  transition: opacity .25s ease;
}

.boot-skip-hint {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 8px;
  border: 1px solid rgba(207,211,215,.22);
  background: rgba(0,0,0,.42);
  color: rgba(207,211,215,.85);
  font: 700 10px/1 Oxanium;
  letter-spacing: .1em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 0 3px rgba(207,211,215,.22);
  pointer-events: none;
  user-select: none;
  z-index: 5;
  animation: bootSkipBreath 2.25s ease-in-out infinite;
}

@keyframes bootSkipBreath {
  0%, 100% {
    opacity: .55;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: .98;
    transform: translateX(-50%) scale(1.015);
  }
}

.znx-boot.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.boot-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) var(--side-w);
  gap: 12px;
  height: 100%;
  padding: 10px;
  box-sizing: border-box;
}

.boot-main {
  min-width: 0;
  display: flex;
}

.boot-main .log-stack {
  width: 100%;
}

.boot-side {
  display: grid;
  grid-template-rows: repeat(3,1fr);
  gap: 12px;
  min-height: 0;
}

.boot-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}

.boot-panel.api-down .panel-head {
  color: var(--fail);
  border-color: rgba(220,53,69,.72);
  text-shadow: 0 0 4px rgba(220,53,69,.75), 0 0 4px rgba(220,53,69,.45);
}

.boot-panel.api-down .panel-log {
  border-color: rgba(220,53,69,.72);
  box-shadow: inset 0 0 0 1px rgba(220,53,69,.28);
}

.panel-head {
  background: var(--window-darker);
  color: var(--info);
  border: 4px solid var(--panel-border);
  border-bottom: none;
  padding: 6px 10px;
  font-weight: 700;
  text-transform: uppercase;
  font-family: Oxanium;
  text-shadow: 0 0 4px #00ccff, 0 0 4px rgba(0,204,255,.6);
}

.panel-log {
  min-height: 0;
  background: #000;
  border: 4px solid var(--panel-border);
  border-top: none;
}

/* Side panels follow the same bottom-up stack behavior as the main console. */
.panel-log.log-stack {
  align-content: end;
  white-space: pre;
}

/* Console area */

.log-stack {
  position: relative;
  min-height: 0;
  display: grid;
  grid-auto-rows: min-content;
  align-content: end;
  overflow: hidden;
  white-space: pre;
  line-height: 1.15;
  padding: 10px;
  box-sizing: border-box;
  border: 4px solid var(--panel-border);
  background: #000;
}

.log-stack::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 22px;
  background: linear-gradient(to bottom,#000,#0000);
  pointer-events: none;
}

.row.console {
  display: grid;
  grid-template-columns: var(--w-time) max-content 1fr;
  column-gap: .5rem;
  font-family: Oxanium;
}

.time {
  color: var(--boot-dim);
  text-shadow: 0 0 6px #545454, 0 0 6px rgba(60,60,60,.6);
}

.status {
  font-weight: 700;
  font-family: "Linear Beam";
}

.status.ok {
  color: var(--ok);
  text-shadow: 0 0 6px #00ff38, 0 0 6px rgba(0,255,69,.6);
}

.status.warn {
  color: var(--warn);
  text-shadow: 0 0 6px #ffcd19, 0 0 6px rgba(255,205,25,.6);
}

.status.fail {
  color: var(--fail);
}

.msg {
  color: inherit;
  text-shadow: 0 0 8px #d8d8d8, 0 0 8px rgba(241,241,241,.6);
}

.dim {
  color: #393939;
}

/* KV rows (right panes) */

.row.kv {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: baseline;
  column-gap: .5rem;
  min-height: 1.15em;
}

.kv-left {
  color: var(--boot-fg);
  opacity: .9;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: Oxanium;
  text-shadow: 0 0 4px #fff, 0 0 4px rgba(255,255,255,.6);
}

.kv-right {
  justify-self: end;
  text-align: right;
  white-space: pre;
  color: var(--ok);
  letter-spacing: .4px;
  font-weight: 600;
  text-transform: uppercase;
  font-family: "Linear Beam", Oxanium;
  text-shadow: 0 0 6px #00ff38, 0 0 6px rgba(0,255,69,.6);
}

.kv.ok .kv-right {
  color: var(--ok);
  text-shadow: 0 0 6px #00ff38, 0 0 6px rgba(0,255,69,.6);
}

.kv.warn .kv-right {
  color: var(--warn);
  text-shadow: 0 0 6px #ffcd19, 0 0 6px rgba(255,205,25,.6);
}

.kv.fail .kv-right {
  color: var(--fail);
  text-shadow: 0 0 6px #dc3545, 0 0 6px rgba(220,53,69,.6);
}

.kv .kv-right {
  text-shadow: none;
}

/* Cursor (used by some typewriter bits) */

.cursor::after {
  content: "_";
  animation: blip 1s steps(1) infinite;
}

@keyframes blip {
  50% {
    opacity: 0;
  }
}
