:root {
  color-scheme: dark;
  --bg: #060813;
  --text: #f4f5fb;
  --muted: #959cb4;
  --faint: #68708b;
  --border-strong: rgba(255, 255, 255, 0.15);
  --success: #55e6a5;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
  background: #04050d;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 12%, rgba(110, 82, 255, 0.18), transparent 30rem),
    radial-gradient(circle at 86% 6%, rgba(25, 188, 232, 0.13), transparent 28rem),
    radial-gradient(circle at 60% 94%, rgba(211, 70, 177, 0.1), transparent 31rem),
    linear-gradient(145deg, #050710 0%, #090d1c 48%, #050711 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.55), transparent 85%);
  content: "";
  pointer-events: none;
}

body::after {
  position: fixed;
  width: 42rem;
  height: 42rem;
  right: -18rem;
  top: 22%;
  z-index: -1;
  border-radius: 50%;
  background: rgba(107, 76, 255, .1);
  filter: blur(90px);
  content: "";
  pointer-events: none;
  animation: ambientFloat 18s ease-in-out infinite alternate;
}

button, input {
  font: inherit;
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-body::after {
  right: auto;
  left: -17rem;
  top: 35%;
  background: rgba(49,187,220,.1);
}

.login-shell {
  position: relative;
  display: grid;
  width: min(920px, 100%);
  min-height: 570px;
  grid-template-columns: 1.08fr .92fr;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 32px;
  background: rgba(13,17,34,.64);
  box-shadow: 0 40px 110px rgba(0,0,0,.48);
  backdrop-filter: blur(28px) saturate(145%);
  animation: loginIn .7s cubic-bezier(.2,.8,.2,1) both;
}

.login-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(145deg, rgba(117,94,255,.18), rgba(14,20,43,.18));
}

.login-visual::before {
  position: absolute;
  width: 340px;
  height: 340px;
  right: -145px;
  top: 35px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(132,109,255,.5), rgba(50,198,230,.2));
  content: "";
  opacity: .48;
  animation: orbDrift 8s ease-in-out infinite alternate;
}

.login-visual::after {
  position: absolute;
  width: 220px;
  height: 220px;
  right: -20px;
  bottom: -120px;
  border-radius: 50%;
  background: rgba(255,92,188,.18);
  filter: blur(18px);
  content: "";
}

.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 14px;
  background: linear-gradient(140deg, #9a8aff 0%, #6c5bff 48%, #3cc8ec 100%);
  box-shadow: 0 10px 28px rgba(112,89,255,.38), inset 0 1px rgba(255,255,255,.4);
  color: #fff;
}

.brand-mark::after {
  position: absolute;
  width: 30px;
  height: 12px;
  right: -9px;
  top: 2px;
  transform: rotate(38deg);
  background: rgba(255,255,255,.32);
  filter: blur(5px);
  content: "";
}

.brand-copy {
  min-width: 0;
}

.brand-title {
  display: block;
  font-size: 15px;
  font-weight: 750;
}

.brand-subtitle {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 380px;
}

.login-kicker {
  margin-bottom: 10px;
  color: #a89eff;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.login-copy h1 {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 720;
  line-height: 1.04;
  letter-spacing: -.055em;
}

.login-copy p {
  margin-top: 16px;
  color: #a4aac0;
  line-height: 1.7;
}

.login-pulse {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8991a9;
  font-size: 10px;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(85,230,165,.1), 0 0 14px rgba(85,230,165,.7);
  animation: statusPulse 2.6s ease-in-out infinite;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px;
  background: rgba(8,11,24,.35);
}

.login-panel h2 {
  font-size: 23px;
  font-weight: 690;
  letter-spacing: -.035em;
}

.login-panel > p {
  margin: 6px 0 25px;
  color: var(--muted);
  font-size: 11px;
}

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

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

.field label {
  color: #a8aec1;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .05em;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  outline: none;
  background: rgba(4,7,18,.47);
  box-shadow: inset 0 1px 4px rgba(0,0,0,.14);
  color: var(--text);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

input::placeholder {
  color: #626a83;
}

input:focus {
  border-color: rgba(149,133,255,.58);
  background: rgba(8,11,25,.72);
  box-shadow: 0 0 0 3px rgba(129,106,255,.1), inset 0 1px 4px rgba(0,0,0,.16);
}

.text-faint {
  color: var(--faint);
}

.btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
  color: #dfe1ed;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.btn:hover {
  border-color: rgba(197,188,255,.76);
  background: linear-gradient(135deg, #a091ff, #7461f1);
  color: #fff;
  transform: translateY(-1px);
}

.btn-primary {
  border-color: rgba(168,153,255,.56);
  background: linear-gradient(135deg, #917fff, #6958e9);
  box-shadow: 0 9px 24px rgba(103,83,229,.25), inset 0 1px rgba(255,255,255,.22);
  color: #fff;
}

.btn-block {
  width: 100%;
}

.login-submit {
  min-height: 45px;
  margin-top: 3px;
}

.login-error {
  padding: 11px 13px;
  margin-bottom: 15px;
  border: 1px solid rgba(255,107,122,.2);
  border-radius: 12px;
  background: rgba(255,107,122,.08);
  color: #ff919c;
  font-size: 11px;
}

.login-foot {
  margin-top: 18px;
  color: #626a82;
  font-size: 9px;
  text-align: center;
}

@keyframes loginIn {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes statusPulse {
  50% {
    opacity: .55;
    box-shadow: 0 0 0 6px rgba(85,230,165,.06), 0 0 18px rgba(85,230,165,.45);
  }
}

@keyframes ambientFloat {
  to { transform: translate(-8vw, 7vh) scale(1.08); }
}

@keyframes orbDrift {
  to { transform: translate(-35px, 38px) scale(1.08); }
}

@media (max-width: 680px) {
  .login-body { padding: 14px; }
  .login-shell {
    min-height: auto;
    grid-template-columns: 1fr;
    border-radius: 25px;
  }
  .login-visual {
    min-height: 210px;
    padding: 27px;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .login-copy h1 {
    max-width: 300px;
    font-size: 31px;
  }
  .login-copy p,
  .login-pulse {
    display: none;
  }
  .login-panel {
    padding: 28px 24px;
  }
}

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