.login-auth-page {
  --login-navy: #071225;
  --login-blue: #2563eb;
  --login-cyan: #22d3ee;
  --login-orange: #f59e0b;
  position: relative;
  isolation: isolate;
  min-height: calc(100svh - 56px);
  padding: 68px 24px 44px;
  overflow: hidden;
}

.login-ambient {
  position: fixed;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(37, 99, 235, .2), transparent 31%),
    radial-gradient(circle at 87% 76%, rgba(34, 211, 238, .15), transparent 29%),
    linear-gradient(145deg, #eef5ff 0%, #f8fafc 48%, #edf7fb 100%);
}

.login-ambient-grid {
  position: absolute;
  inset: -30%;
  opacity: .38;
  background-image:
    linear-gradient(rgba(37, 99, 235, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, .07) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 8%, transparent 66%);
  mask-image: radial-gradient(circle at 50% 45%, #000 8%, transparent 66%);
  transform: perspective(700px) rotateX(56deg) translateY(17%);
  transform-origin: center center;
  animation: loginGridDrift 18s linear infinite;
}

.login-ambient-orb {
  position: absolute;
  width: min(44vw, 580px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(4px);
  opacity: .6;
  animation: loginOrbFloat 10s ease-in-out infinite alternate;
}

.login-ambient-orb-a {
  left: -18%;
  top: -28%;
  background: radial-gradient(circle, rgba(59, 130, 246, .28), rgba(59, 130, 246, 0) 70%);
}

.login-ambient-orb-b {
  right: -20%;
  bottom: -34%;
  background: radial-gradient(circle, rgba(34, 211, 238, .26), rgba(34, 211, 238, 0) 70%);
  animation-delay: -4s;
}

.login-home-link {
  position: absolute;
  z-index: 3;
  top: 18px;
  left: 4px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  color: #334155;
  font-size: 13px;
  font-weight: 760;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .07);
  backdrop-filter: blur(12px);
  transition: transform .2s ease, border-color .2s ease, color .2s ease;
}

.login-home-link:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: translateX(-3px);
}

.login-home-link:focus-visible,
.login-password-toggle:focus-visible,
.login-auth-card a:focus-visible,
.login-auth-card button:focus-visible,
.login-auth-card input:focus-visible {
  outline: 3px solid rgba(34, 211, 238, .72);
  outline-offset: 3px;
}

.login-shell {
  width: min(460px, 100%);
  animation: loginCardArrive .72s cubic-bezier(.2, .75, .25, 1) both;
}

.login-auth-card {
  position: relative;
  width: 100%;
  padding: 34px 40px 30px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 30px;
  background: rgba(255, 255, 255, .86);
  box-shadow:
    0 35px 90px rgba(15, 23, 42, .16),
    inset 0 1px rgba(255, 255, 255, .92);
  backdrop-filter: blur(20px) saturate(1.14);
}

.login-auth-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(37, 99, 235, .3), transparent 35%, rgba(34, 211, 238, .24));
  opacity: .55;
  pointer-events: none;
}

.login-auth-card::after {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 10% -14% -16%;
  border-radius: 38%;
  background: radial-gradient(ellipse, rgba(37, 99, 235, .2), transparent 67%);
  filter: blur(16px);
  pointer-events: none;
}

.login-brand {
  display: grid;
  place-items: center;
  min-height: 78px;
}

.login-auth-card .login-logo {
  width: min(230px, 72%);
  max-width: none;
  margin: 0 auto 6px;
  animation: none;
  filter: drop-shadow(0 12px 20px rgba(15, 23, 42, .11));
}

.login-guardian {
  --eye-x: 0px;
  --eye-y: 0px;
  position: relative;
  width: 82px;
  height: 64px;
  margin: 4px auto 12px;
  transform-origin: center bottom;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}

.login-guardian-signal {
  position: absolute;
  left: 39px;
  top: -4px;
  width: 4px;
  height: 14px;
  border-radius: 99px;
  background: linear-gradient(#67e8f9, #2563eb);
}

.login-guardian-signal::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 15px rgba(245, 158, 11, .7);
}

.login-guardian-screen {
  position: absolute;
  inset: 10px 4px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 4px solid #4f7ef4;
  border-radius: 20px;
  background: linear-gradient(145deg, #071225, #102344);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .22), inset 0 0 18px rgba(34, 211, 238, .1);
}

.login-guardian-eye {
  display: block;
  width: 10px;
  height: 13px;
  border-radius: 50%;
  background: #8bf3ff;
  box-shadow: 0 0 12px rgba(34, 211, 238, .9);
  transform: translate(var(--eye-x), var(--eye-y));
  transition: width .18s ease, height .18s ease, border-radius .18s ease;
}

.login-guardian-hand {
  position: absolute;
  z-index: 3;
  top: 35px;
  width: 28px;
  height: 14px;
  border: 3px solid #a5f3fc;
  border-radius: 999px;
  background: #3568db;
  opacity: 0;
  transition: opacity .2s ease, transform .28s cubic-bezier(.2, .8, .2, 1);
}

.login-guardian-hand-left { left: 5px; transform: translate(-18px, 20px) rotate(28deg); }
.login-guardian-hand-right { right: 5px; transform: translate(18px, 20px) rotate(-28deg); }

.login-guardian.is-shy .login-guardian-hand { opacity: 1; }
.login-guardian.is-shy .login-guardian-hand-left { transform: translate(15px, -1px) rotate(-13deg); }
.login-guardian.is-shy .login-guardian-hand-right { transform: translate(-15px, -1px) rotate(13deg); }
.login-guardian.is-shy .login-guardian-eye { width: 12px; height: 3px; border-radius: 99px; }
.login-guardian.is-ready { transform: translateY(-3px) rotate(-2deg); }
.login-guardian.is-checking { animation: loginGuardianCheck .7s ease-in-out infinite alternate; }

.login-heading { margin-bottom: 22px; text-align: center; }
.login-product-mark { margin: 0 0 5px; color: #2563eb; font-size: 11px; font-weight: 900; letter-spacing: .2em; }
.login-heading h1 { margin: 0; color: var(--login-navy); font-size: clamp(28px, 6vw, 36px); line-height: 1.15; }

.login-form { gap: 16px; margin-top: 0; }
.login-field { display: grid; gap: 7px; color: #334155; font-size: 13px; font-weight: 760; }
.login-control { position: relative; display: block; }
.login-control input {
  min-height: 54px;
  padding: 13px 72px 13px 45px;
  border: 1px solid #d7e0ee;
  border-radius: 16px;
  background: rgba(248, 250, 252, .9);
  color: #0f172a;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .025);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}
.login-control input::placeholder { color: #94a3b8; }
.login-control input:hover { border-color: #b8c7dc; background: #fff; }
.login-control input:focus {
  border-color: #60a5fa;
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .1), 0 10px 24px rgba(37, 99, 235, .06);
  transform: translateY(-1px);
}
.login-control input[name="username"] { padding-right: 14px; }
.login-field-icon {
  position: absolute;
  z-index: 2;
  left: 16px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #3b82f6;
  font-size: 19px;
  font-weight: 900;
  transform: translateY(-50%);
  pointer-events: none;
}

.login-password-toggle {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 9px;
  min-width: 48px;
  padding: 7px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
  transform: translateY(-50%);
}
.login-password-toggle:hover { background: #eaf2ff; color: #1d4ed8; }
.login-password-hide { display: none; }
.login-password-toggle[aria-pressed="true"] .login-password-show { display: none; }
.login-password-toggle[aria-pressed="true"] .login-password-hide { display: inline; }

.login-submit {
  min-height: 54px;
  margin-top: 3px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(115deg, #1d4ed8, #2563eb 52%, #0ea5e9);
  box-shadow: 0 15px 30px rgba(37, 99, 235, .24);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.login-submit:hover { transform: translateY(-2px); filter: saturate(1.08); box-shadow: 0 18px 35px rgba(37, 99, 235, .3); }
.login-submit-arrow { font-size: 18px; transition: transform .2s ease; }
.login-submit:hover .login-submit-arrow { transform: translateX(4px); }
.login-submit[aria-busy="true"] { cursor: wait; filter: saturate(.7); }

.login-card-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 22px;
  color: #64748b;
  font-size: 13px;
}
.login-card-actions .join-link { display: inline; margin: 0; color: #2563eb; font-weight: 820; }
.login-card-actions .join-link:hover { color: #1d4ed8; text-decoration: underline; text-underline-offset: 3px; }

.join-auth-page { padding-block: 56px 36px; }
.join-shell { width: min(500px, 100%); }
.join-auth-card { padding-block: 28px 26px; }
.join-auth-card .login-brand { min-height: 58px; }
.join-auth-card .login-logo { width: min(205px, 68%); }
.join-auth-card .login-heading { margin-bottom: 16px; }
.join-auth-card .login-form { gap: 12px; }
.join-auth-card .login-control input { padding-right: 14px; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body.login-has-error .login-auth-card { animation: loginErrorNudge .34s ease both; }

@keyframes loginCardArrive {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes loginGridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 52px 52px, 52px 52px; }
}
@keyframes loginOrbFloat {
  from { transform: translate3d(-2%, -2%, 0) scale(.96); }
  to { transform: translate3d(5%, 4%, 0) scale(1.06); }
}
@keyframes loginGuardianCheck {
  from { transform: translateY(-2px) rotate(-3deg); }
  to { transform: translateY(-6px) rotate(3deg); }
}
@keyframes loginErrorNudge {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-7px); }
  70% { transform: translateX(7px); }
}

@media (max-width: 620px) {
  .login-auth-page { min-height: calc(100svh - 24px); padding: 74px 10px 28px; }
  .login-home-link { left: 10px; }
  .login-auth-card { padding: 28px 22px 24px; border-radius: 25px; }
  .login-auth-card .login-logo { width: min(215px, 78%); }
  .login-card-actions { flex-wrap: wrap; }
  .join-auth-page { padding-top: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-ambient-grid,
  .login-ambient-orb,
  .login-shell,
  .login-guardian.is-checking,
  body.login-has-error .login-auth-card {
    animation: none !important;
  }
  .login-home-link,
  .login-guardian,
  .login-guardian-hand,
  .login-guardian-eye,
  .login-control input,
  .login-submit,
  .login-submit-arrow {
    transition-duration: .01ms !important;
  }
}
