:root {
  --bg: #eef3f8;
  --bg-deep: #dbe4ee;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(124, 145, 169, 0.18);
  --line-strong: rgba(95, 120, 148, 0.32);
  --text: #1e2b3a;
  --muted: #66788d;
  --accent: #0f6efd;
  --accent-soft: rgba(15, 110, 253, 0.18);
  --success: #21b26f;
  --shadow: 0 30px 80px rgba(55, 83, 117, 0.16);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 28%),
    linear-gradient(145deg, #f4f7fb 0%, #e8eef5 45%, #d8e2ee 100%);
  color: var(--text);
}

button,
input,
a {
  font: inherit;
}

.scene {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

.scene__grid,
.scene__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene__grid {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 88%);
  animation: gridShift 18s linear infinite;
}

.scene__glow--top {
  background: radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.95), transparent 34%);
}

.scene__glow--bottom {
  background: radial-gradient(circle at 80% 100%, rgba(15, 110, 253, 0.18), transparent 26%);
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 24px;
}

.stage__backdrop {
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 36px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.3)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(223, 232, 242, 0.7));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  overflow: hidden;
}

.orb,
.rail,
.network,
.storage-module,
.data-stream {
  position: absolute;
}

.orb {
  border-radius: 999px;
  filter: blur(6px);
  opacity: 0.72;
}

.orb--one {
  width: 360px;
  height: 360px;
  left: -80px;
  top: -100px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.16) 72%, transparent 75%);
  animation: floatOrb 14s ease-in-out infinite;
}

.orb--two {
  width: 420px;
  height: 420px;
  right: -110px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(15, 110, 253, 0.16), rgba(15, 110, 253, 0.06) 56%, transparent 72%);
  animation: floatOrb 18s ease-in-out infinite reverse;
}

.orb--three {
  width: 240px;
  height: 240px;
  left: 54%;
  top: 10%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.08) 68%, transparent 74%);
  animation: pulseOrb 10s ease-in-out infinite;
}

.rail {
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(134, 154, 177, 0.58), transparent);
}

.rail::after {
  content: "";
  position: absolute;
  inset: -3px 10%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.68), transparent);
  filter: blur(7px);
}

.rail--top {
  top: 26%;
}

.rail--middle {
  top: 50%;
}

.rail--bottom {
  top: 73%;
}

.network {
  width: 220px;
  height: 220px;
}

.network::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px dashed rgba(117, 138, 161, 0.3);
}

.network span {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(220, 230, 240, 0.95));
  border: 1px solid rgba(130, 151, 176, 0.36);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.15);
}

.network span:nth-child(1) {
  top: 10%;
  left: 42%;
}

.network span:nth-child(2) {
  top: 46%;
  right: 4%;
}

.network span:nth-child(3) {
  bottom: 8%;
  left: 22%;
}

.network span:nth-child(4) {
  top: 48%;
  left: 8%;
}

.network--left {
  top: 13%;
  left: 5%;
  animation: rotateSlow 28s linear infinite;
}

.network--right {
  right: 6%;
  bottom: 11%;
  animation: rotateSlow 32s linear infinite reverse;
}

.data-stream {
  inset: 0;
  overflow: hidden;
}

.packet {
  position: absolute;
  width: var(--size);
  height: calc(var(--size) * 0.66);
  left: var(--left);
  top: calc(100% + 24px);
  border-radius: 8px;
  border: 1px solid rgba(127, 149, 173, 0.28);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(232, 238, 246, 0.88));
  box-shadow: 0 12px 30px rgba(88, 112, 141, 0.12);
  opacity: 0;
  animation: packetRise var(--duration) linear var(--delay) infinite;
}

.packet::after {
  content: "";
  position: absolute;
  inset: 22% 14%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(15, 110, 253, 0.02), rgba(15, 110, 253, 0.4), rgba(15, 110, 253, 0.02));
}

.storage-module {
  left: -10%;
  bottom: 16%;
  width: 260px;
  height: 138px;
  animation: moduleRide 16s ease-in-out infinite;
}

.storage-module__shadow {
  position: absolute;
  inset: auto 14px -18px 14px;
  height: 24px;
  border-radius: 50%;
  background: rgba(71, 95, 124, 0.18);
  filter: blur(12px);
}

.storage-module__body {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  padding: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(233, 240, 247, 0.9)),
    linear-gradient(180deg, rgba(225, 234, 243, 0.84), rgba(250, 252, 255, 0.94));
  border: 1px solid rgba(147, 165, 186, 0.34);
  box-shadow: 0 26px 48px rgba(67, 91, 120, 0.2);
}

.storage-module__lights {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.storage-module__lights span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #66d19e, #2daf72);
  box-shadow: 0 0 18px rgba(33, 178, 111, 0.5);
}

.storage-module__lights span:nth-child(2) {
  animation: blink 1.8s linear infinite;
}

.storage-module__lights span:nth-child(3) {
  background: linear-gradient(180deg, #70a8ff, #0f6efd);
  box-shadow: 0 0 18px rgba(15, 110, 253, 0.45);
}

.storage-module__bays {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.storage-module__bays span {
  height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(141, 160, 181, 0.24);
  background:
    linear-gradient(180deg, rgba(247, 250, 252, 0.94), rgba(224, 232, 241, 0.86)),
    linear-gradient(90deg, rgba(194, 205, 216, 0.35), rgba(255, 255, 255, 0.2));
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 470px);
  gap: 32px;
  align-items: center;
}

.login-shell__info {
  padding: 32px 12px 32px 20px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 700;
}

.login-shell__info h1 {
  margin: 0;
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.lead {
  max-width: 560px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.status-card {
  width: min(360px, 100%);
  margin-top: 30px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 36px rgba(85, 109, 138, 0.12);
  backdrop-filter: blur(12px);
}

.status-card__line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
}

.status-card__line + .status-card__line {
  border-top: 1px solid rgba(151, 169, 188, 0.18);
}

.status-card__label {
  color: var(--muted);
}

.login-card {
  position: relative;
  padding: 32px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 254, 0.84)),
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(234, 241, 247, 0.68));
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transform-style: preserve-3d;
  transition: transform 180ms ease;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--radius-xl) - 1px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 44%);
  pointer-events: none;
}

.login-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 110, 253, 0.08);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.login-card__badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(15, 110, 253, 0.36);
}

.login-card h2 {
  margin: 22px 0 10px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.login-card__text {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 9px;
}

.field span {
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 600;
}

.field input {
  width: 100%;
  border: 1px solid rgba(133, 152, 174, 0.24);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  padding: 16px 18px;
  color: var(--text);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.field input::placeholder {
  color: rgba(103, 118, 136, 0.62);
}

.field input:focus {
  border-color: rgba(15, 110, 253, 0.38);
  box-shadow: 0 0 0 4px rgba(15, 110, 253, 0.12);
  transform: translateY(-1px);
}

.login-form__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 0.94rem;
}

.login-form__actions a {
  color: var(--accent);
  text-decoration: none;
}

.login-form__actions a:hover {
  text-decoration: underline;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  min-height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #0f6efd, #4f9bff);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 18px 30px rgba(15, 110, 253, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 40px rgba(15, 110, 253, 0.32);
}

.button:active {
  transform: translateY(0);
}

.button__pulse {
  position: absolute;
  inset: auto auto auto -15%;
  width: 36%;
  height: 180%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: rotate(18deg);
  animation: buttonSweep 3.8s linear infinite;
}

.form-status {
  margin: 4px 0 0;
  color: var(--success);
  font-size: 0.92rem;
  font-weight: 600;
}

.form-status.is-busy {
  color: var(--accent);
}

.form-status.is-done {
  color: var(--success);
}

.form-status.is-error {
  color: #d14343;
}

.field input.is-error {
  border-color: rgba(209, 67, 67, 0.5);
  box-shadow: 0 0 0 4px rgba(209, 67, 67, 0.12);
  background: rgba(255, 251, 251, 0.94);
}

.login-card.is-error {
  animation: cardShake 420ms ease;
}

@keyframes gridShift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-72px, -72px, 0);
  }
}

@keyframes floatOrb {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(30px, 22px, 0) scale(1.06);
  }
}

@keyframes pulseOrb {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.72;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes rotateSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes packetRise {
  0% {
    transform: translate3d(0, 0, 0) scale(0.92) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.78;
  }
  50% {
    transform: translate3d(var(--drift), -58vh, 0) scale(1) rotate(8deg);
  }
  100% {
    transform: translate3d(calc(var(--drift) * 1.45), -112vh, 0) scale(1.02) rotate(-10deg);
    opacity: 0;
  }
}

@keyframes moduleRide {
  0% {
    transform: translate3d(0, 0, 0);
  }
  25% {
    transform: translate3d(34vw, -14px, 0);
  }
  50% {
    transform: translate3d(62vw, 6px, 0);
  }
  75% {
    transform: translate3d(34vw, 14px, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes blink {
  0%,
  48%,
  100% {
    opacity: 1;
  }
  52%,
  80% {
    opacity: 0.25;
  }
}

@keyframes buttonSweep {
  0% {
    transform: translateX(-180%) rotate(18deg);
  }
  100% {
    transform: translateX(520%) rotate(18deg);
  }
}

@keyframes cardShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(7px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(4px);
  }
}

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

  .login-shell__info {
    padding: 0;
  }

  .storage-module {
    width: 220px;
    bottom: 10%;
  }
}

@media (max-width: 640px) {
  .stage {
    padding: 18px;
  }

  .stage__backdrop {
    inset: 8px;
    border-radius: 28px;
  }

  .login-card {
    padding: 24px;
    border-radius: 26px;
  }

  .login-form__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .network,
  .storage-module,
  .status-card {
    display: none;
  }

  .scene__grid {
    background-size: 48px 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
