/* Login UI v0.2.0 */

:root {
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-solid: #0f172a;
  --border: rgba(148, 163, 184, 0.25);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.login-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 36px 18px 58px;
  isolation: isolate;
}

.login-background {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.9)),
    url("/static/assets/img/login-bg.jpg"),
    radial-gradient(circle at 20% 10%, rgba(56, 189, 248, 0.25), transparent 35%),
    radial-gradient(circle at 80% 70%, rgba(34, 197, 94, 0.18), transparent 35%),
    linear-gradient(135deg, #020617 0%, #0f172a 45%, #111827 100%);
  background-size: cover, cover, auto, auto, auto;
  background-position: center;
}

.login-grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.12) 1px, transparent 1px);
  background-size: 52px 52px;
  transform: perspective(900px) rotateX(62deg) translateY(18%);
  transform-origin: center bottom;
  opacity: 0.35;
  animation: gridMove 18s linear infinite;
}

.login-orb {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(42px);
  opacity: 0.32;
  animation: orbFloat 10s ease-in-out infinite alternate;
}

.login-orb-one {
  top: 8%;
  left: 8%;
  background: #0284c7;
}

.login-orb-two {
  right: 6%;
  bottom: 8%;
  background: #16a34a;
  animation-delay: -4s;
}

.login-scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: -20%;
  height: 30%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(56, 189, 248, 0.08),
    transparent
  );
  animation: scan 7s ease-in-out infinite;
}

.login-shell {
  width: min(1060px, 100%);
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 22px;
  align-items: stretch;
}

.login-brand-panel,
.login-card {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 26px 80px var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.login-brand-panel {
  min-height: 520px;
  border-radius: 28px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-brand-panel::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% 12%;
  height: 300px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.18), transparent 65%);
  pointer-events: none;
}

.brand-badge {
  width: fit-content;
  color: #bae6fd;
  border: 1px solid rgba(125, 211, 252, 0.35);
  background: rgba(2, 132, 199, 0.14);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.18em;
  font-weight: 800;
}

.login-brand-panel h1 {
  margin: 28px 0 14px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.login-brand-panel p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.signal-panel {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 86px;
  margin-top: 36px;
}

.signal-panel span {
  width: 16px;
  border-radius: 999px;
  background: linear-gradient(to top, var(--accent-2), var(--accent));
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.55);
  animation: signalPulse 1.8s ease-in-out infinite;
}

.signal-panel span:nth-child(1) {
  height: 30%;
}

.signal-panel span:nth-child(2) {
  height: 52%;
  animation-delay: 0.15s;
}

.signal-panel span:nth-child(3) {
  height: 76%;
  animation-delay: 0.3s;
}

.signal-panel span:nth-child(4) {
  height: 100%;
  animation-delay: 0.45s;
}

.brand-status {
  display: grid;
  gap: 10px;
  margin-top: 30px;
  color: #cbd5e1;
  font-size: 14px;
}

.brand-status div {
  display: flex;
  gap: 10px;
  align-items: center;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.85);
}

.login-card {
  border-radius: 28px;
  padding: 30px;
  align-self: center;
}

.login-card-header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.login-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.95), rgba(34, 197, 94, 0.9));
  color: #020617;
  font-weight: 950;
  letter-spacing: -0.08em;
  box-shadow: 0 14px 40px rgba(56, 189, 248, 0.3);
}

.login-card h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.04em;
}

.login-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.login-error {
  display: none;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(127, 29, 29, 0.42);
  color: #fecaca;
  border-radius: 14px;
  font-size: 14px;
}

.login-error.show {
  display: block;
}

.login-field {
  display: block;
  margin-bottom: 16px;
}

.login-field span {
  display: block;
  margin-bottom: 7px;
  color: #bfdbfe;
  font-size: 13px;
  font-weight: 750;
}

.login-field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 14px;
  padding: 0 14px;
  background: rgba(2, 6, 23, 0.7);
  color: var(--text);
  outline: none;
  font-size: 15px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.login-field input:focus {
  border-color: rgba(56, 189, 248, 0.8);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
  background: rgba(2, 6, 23, 0.9);
}

.password-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.password-toggle {
  height: 48px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 14px;
  padding: 0 14px;
  background: rgba(15, 23, 42, 0.9);
  color: #e0f2fe;
  cursor: pointer;
  font-weight: 800;
}

.password-toggle:hover {
  border-color: rgba(56, 189, 248, 0.75);
}

.login-button {
  width: 100%;
  height: 52px;
  margin-top: 6px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  color: #020617;
  background:
    linear-gradient(135deg, #7dd3fc, #22c55e);
  font-weight: 950;
  font-size: 16px;
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
  box-shadow: 0 18px 40px rgba(34, 197, 94, 0.22);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.login-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.login-button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.login-help {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.login-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  color: rgba(203, 213, 225, 0.72);
  font-size: 13px;
}

@keyframes gridMove {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 0 52px, 52px 0;
  }
}

@keyframes orbFloat {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(18px, -24px, 0) scale(1.06);
  }
}

@keyframes scan {
  0% {
    transform: translateY(-100%);
  }

  55% {
    transform: translateY(420%);
  }

  100% {
    transform: translateY(420%);
  }
}

@keyframes signalPulse {
  0%,
  100% {
    opacity: 0.48;
    transform: scaleY(0.86);
  }

  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@media (max-width: 880px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    min-height: auto;
  }

  .signal-panel {
    display: none;
  }
}

@media (max-width: 520px) {
  .login-page {
    padding: 18px 12px 58px;
  }

  .login-brand-panel,
  .login-card {
    border-radius: 22px;
    padding: 22px;
  }

  .login-help {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-grid,
  .login-orb,
  .login-scanline,
  .signal-panel span {
    animation: none !important;
  }

  .login-button,
  .login-field input {
    transition: none !important;
  }
}

@supports not ((backdrop-filter: blur(18px)) or (-webkit-backdrop-filter: blur(18px))) {
  .login-brand-panel,
  .login-card {
    background: rgba(15, 23, 42, 0.96);
  }
}

body.low-graphics .login-grid,
body.low-graphics .login-orb,
body.low-graphics .login-scanline,
body.low-graphics .signal-panel span {
  animation: none !important;
}

body.low-graphics .login-grid {
  opacity: 0.16;
}

body.low-graphics .login-brand-panel,
body.low-graphics .login-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(15, 23, 42, 0.96);
}
