:root {
  --bg: #04070d;
  --bg-soft: #09101b;
  --panel: rgba(8, 14, 24, 0.78);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-highlight: rgba(255, 255, 255, 0.03);

  --input: rgba(255, 255, 255, 0.05);
  --input-border: rgba(255, 255, 255, 0.08);

  --text: #f5f7fb;
  --muted: #95a2b8;
  --primary: #e50914;
  --primary-hover: #c90812;
  --danger: #ff6b6b;
  --success: #62d39f;

  --shadow: 0 30px 80px rgba(0, 0, 0, 0.48);

  --radius-xl: 30px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Inter", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(229, 9, 20, 0.09), transparent 30%),
    linear-gradient(180deg, #02040a 0%, #04070d 45%, #02040a 100%);
  overflow: hidden;
}

/* Background */
.page-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.76) 0%, rgba(0, 0, 0, 0.36) 45%, rgba(0, 0, 0, 0.76) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.12) 50%, rgba(0, 0, 0, 0.68) 100%);
}

.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.2) 0.5px, transparent 0.6px),
    radial-gradient(circle at 80% 40%, rgba(255,255,255,0.18) 0.5px, transparent 0.6px),
    radial-gradient(circle at 50% 70%, rgba(255,255,255,0.16) 0.5px, transparent 0.6px);
  background-size: 180px 180px, 220px 220px, 260px 260px;
}

.bg-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(100px);
  opacity: 0.2;
}

.bg-glow-one {
  width: 420px;
  height: 420px;
  top: -120px;
  left: -90px;
  background: rgba(229, 9, 20, 0.34);
  animation: pulseGlow 9s ease-in-out infinite;
}

.bg-glow-two {
  width: 380px;
  height: 380px;
  right: -90px;
  bottom: -120px;
  background: rgba(229, 9, 20, 0.2);
  animation: pulseGlow 11s ease-in-out infinite reverse;
}

.bg-glow-three {
  width: 260px;
  height: 260px;
  top: 18%;
  right: 18%;
  background: rgba(255, 255, 255, 0.05);
  animation: floatGlow 14s ease-in-out infinite;
}

.bg-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.98;
}

.line {
  fill: none;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  will-change: transform, stroke-dashoffset, opacity;
}

.base-line {
  stroke: url(#lineGradA);
  stroke-width: 1.45;
  stroke-dasharray: 14 18;
  opacity: 0.45;
}

.accent-line {
  stroke: url(#lineGradB);
  stroke-width: 1.8;
  stroke-dasharray: 18 20;
  opacity: 0.78;
}

.glow-line {
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 3.4;
  stroke-dasharray: 2 28;
  opacity: 0.18;
  filter: blur(1.6px);
}

.line-1 {
  animation:
    flowLeft 15s linear infinite,
    floatSoft 8s ease-in-out infinite;
}

.line-2 {
  animation:
    flowRight 17s linear infinite,
    floatSoftAlt 10s ease-in-out infinite;
}

.line-3 {
  animation:
    flowLeft 21s linear infinite,
    floatSoft 12s ease-in-out infinite reverse;
}

.line-4 {
  animation:
    flowRight 19s linear infinite,
    floatSoftAlt 11s ease-in-out infinite reverse;
}

.glow-1 {
  animation:
    glowTravel 7s linear infinite,
    floatSoft 13s ease-in-out infinite;
}

.glow-2 {
  animation:
    glowTravelReverse 9s linear infinite,
    floatSoftAlt 15s ease-in-out infinite;
}

@keyframes flowLeft {
  0% {
    stroke-dashoffset: 0;
    transform: translateX(0);
  }
  100% {
    stroke-dashoffset: -220;
    transform: translateX(-90px);
  }
}

@keyframes flowRight {
  0% {
    stroke-dashoffset: 0;
    transform: translateX(0);
  }
  100% {
    stroke-dashoffset: 220;
    transform: translateX(90px);
  }
}

@keyframes floatSoft {
  0% {
    transform: translateY(0) scaleX(1);
  }
  50% {
    transform: translateY(-10px) scaleX(1.015);
  }
  100% {
    transform: translateY(0) scaleX(1);
  }
}

@keyframes floatSoftAlt {
  0% {
    transform: translateY(0) scaleX(1);
  }
  50% {
    transform: translateY(12px) scaleX(0.985);
  }
  100% {
    transform: translateY(0) scaleX(1);
  }
}

@keyframes glowTravel {
  0% {
    stroke-dashoffset: 0;
    opacity: 0.08;
  }
  50% {
    opacity: 0.26;
  }
  100% {
    stroke-dashoffset: -320;
    opacity: 0.08;
  }
}

@keyframes glowTravelReverse {
  0% {
    stroke-dashoffset: 0;
    opacity: 0.06;
  }
  50% {
    opacity: 0.22;
  }
  100% {
    stroke-dashoffset: 320;
    opacity: 0.06;
  }
}

@keyframes pulseGlow {
  0% {
    transform: scale(1);
    opacity: 0.14;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.26;
  }
  100% {
    transform: scale(1);
    opacity: 0.14;
  }
}

@keyframes floatGlow {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 0.06;
  }
  50% {
    transform: translate3d(18px, -20px, 0);
    opacity: 0.11;
  }
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 0.06;
  }
}

/* Layout */
.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-panel {
  position: relative;
  width: 100%;
  max-width: 470px;
  padding: 42px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 28%);
  pointer-events: none;
}

.login-head {
  position: relative;
  margin-bottom: 30px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-head h1 {
  margin: 0 0 10px;
  font-size: 38px;
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.login-head p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
  max-width: 360px;
}

.login-form {
  position: relative;
  display: grid;
  gap: 22px;
}

.field {
  display: grid;
  gap: 10px;
}

.field label {
  font-size: 14px;
  font-weight: 600;
  color: #f8faff;
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  width: 100%;
  height: 58px;
  padding: 0 56px 0 16px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  background: var(--input);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.input-wrap input::placeholder {
  color: #6f7b90;
  text-transform: none;
  letter-spacing: normal;
}

.input-wrap input:focus {
  border-color: rgba(229, 9, 20, 0.75);
  box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.12);
  background: rgba(255, 255, 255, 0.08);
}

.toggle-visibility {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #94a0b7;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.toggle-visibility:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.toggle-visibility svg {
  width: 18px;
  height: 18px;
}

#eyeClosed {
  display: none;
}

.toggle-visibility.is-visible #eyeOpen {
  display: none;
}

.toggle-visibility.is-visible #eyeClosed {
  display: block;
}

.field-meta {
  font-size: 12px;
  color: var(--muted);
}

.submit-btn {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #f31522 0%, #ce0812 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 14px 30px rgba(229, 9, 20, 0.26);
}

.submit-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 18px 36px rgba(229, 9, 20, 0.32);
}

.feedback {
  min-height: 18px;
  margin: 0;
  font-size: 13px;
  color: var(--danger);
}

.feedback.success {
  color: var(--success);
}

@media (max-width: 560px) {
  .login-shell {
    padding: 18px;
  }

  .login-panel {
    padding: 28px 22px;
    border-radius: 22px;
  }

  .login-head h1 {
    font-size: 30px;
  }

  .login-head p {
    font-size: 14px;
  }
}