/* login.css - advanced "Aurora" login screen for moonOS.
   Animated aurora blobs, twinkling starfield, live clock, glass user card
   with a press-and-hold sign-in ring, mouse parallax and a blur-zoom
   sign-in transition. Respects prefers-reduced-motion. */

.login-screen {
  overflow: hidden;
  cursor: default;
}

/* ---------- aurora background ---------- */
.login-aurora {
  position: absolute;
  inset: -10%;
  background: #05070f;
  overflow: hidden;
}
.aurora-blob {
  position: absolute;
  width: 55vmax;
  height: 55vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}
.aurora-blob.b1 {
  background: radial-gradient(circle at 40% 40%, #2b4bd8 0%, transparent 65%);
  top: -12%; left: -10%;
  animation: aurora-drift1 26s ease-in-out infinite alternate;
}
.aurora-blob.b2 {
  background: radial-gradient(circle at 60% 60%, #7b2ff7 0%, transparent 65%);
  top: 20%; right: -14%;
  animation: aurora-drift2 32s ease-in-out infinite alternate;
}
.aurora-blob.b3 {
  background: radial-gradient(circle at 50% 50%, #0ea5e9 0%, transparent 62%);
  bottom: -18%; left: 30%;
  animation: aurora-drift3 38s ease-in-out infinite alternate;
  opacity: 0.4;
}
@keyframes aurora-drift1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(9vmax, 7vmax) scale(1.15); }
}
@keyframes aurora-drift2 {
  from { transform: translate(0, 0) scale(1.1); }
  to   { transform: translate(-8vmax, 6vmax) scale(0.95); }
}
@keyframes aurora-drift3 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-6vmax, -8vmax) scale(1.2); }
}

#login-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ---------- giant clock ---------- */
.login-top {
  position: relative;
  z-index: 5;
  text-align: center;
  color: #fff;
  margin-bottom: 34px;
  user-select: none;
}
.login-clock {
  font-size: clamp(56px, 9vw, 96px);
  font-weight: 200;
  letter-spacing: -3px;
  line-height: 1;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.55);
  font-variant-numeric: tabular-nums;
}
.login-date {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

/* ---------- floating profile (no card) ---------- */
.login-screen .login-box {
  width: auto;
  padding: 10px 20px;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  cursor: pointer;
  will-change: transform;
  animation: login-card-in 700ms cubic-bezier(0.22, 1.2, 0.36, 1) both;
}
@keyframes login-card-in {
  from { opacity: 0; transform: translateY(26px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.login-screen .login-box:hover {
  transform: translateY(-2px);
}

/* avatar with rotating glow ring */
.login-avatar-ring {
  position: relative;
  width: 92px;
  height: 92px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-avatar-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    #2b4bd8, #7b2ff7, #0ea5e9, #2b4bd8);
  animation: ring-spin 6s linear infinite;
  filter: blur(1px);
}
.login-avatar-ring::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #0b0e1a;
}
@keyframes ring-spin {
  to { transform: rotate(360deg); }
}
.login-screen .login-avatar {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 76px;
  margin: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2a3352, #141a2e);
  color: #9db4ff;
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.08);
}
.login-screen .login-avatar svg {
  width: 38px;
  height: 38px;
}

.login-screen .login-name {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #fff;
  margin-bottom: 4px;
  background: linear-gradient(110deg, #fff 40%, #9db4ff 50%, #fff 60%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: name-shimmer 5s ease-in-out infinite;
}
@keyframes name-shimmer {
  0%, 100% { background-position: 110% 0; }
  50%      { background-position: -10% 0; }
}
.login-screen .login-sub {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 24px;
}

/* ---------- hold-to-sign-in ---------- */
.login-hold {
  position: relative;
  width: 76px;
  height: 76px;
  margin-top: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  outline: none;
}
.login-hold .hold-track {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}
.login-hold .hold-track .track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 5;
}
.login-hold .hold-track .fill {
  fill: none;
  stroke: url(#holdGrad);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 201; /* 2*pi*32 */
  stroke-dashoffset: 201;
}
.login-hold.charging .hold-track .fill {
  transition: stroke-dashoffset 750ms linear;
  stroke-dashoffset: 0;
}
.login-hold .hold-core {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: rgba(125, 160, 255, 0.12);
  border: 1px solid rgba(125, 160, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bcd0ff;
  transition: background 200ms ease, transform 150ms ease;
}
.login-hold:hover .hold-core,
.login-hold:focus-visible .hold-core {
  background: rgba(125, 160, 255, 0.22);
}
.login-hold.charging .hold-core {
  transform: scale(0.92);
  background: rgba(125, 160, 255, 0.3);
}
.login-hold .hold-label {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
/* success ripple */
.login-hold.done .hold-core {
  animation: hold-pop 450ms ease;
}
@keyframes hold-pop {
  0% { box-shadow: 0 0 0 0 rgba(125, 160, 255, 0.55); }
  100% { box-shadow: 0 0 0 26px rgba(125, 160, 255, 0); }
}

/* ---------- footer ---------- */
.login-foot {
  position: relative;
  z-index: 5;
  margin-top: 38px;
  display: flex;
  gap: 26px;
  align-items: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  user-select: none;
}
.login-foot kbd {
  font-family: inherit;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom-width: 2px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ---------- sign-in transition ---------- */
.login-screen.signing-in {
  pointer-events: none;
}
.login-screen.signing-in .login-top,
.login-screen.signing-in .login-foot {
  opacity: 0;
  transition: opacity 350ms ease;
}
.login-screen.signing-in .login-box {
  animation: login-zoom 550ms cubic-bezier(0.5, 0, 0.75, 0) forwards;
}
@keyframes login-zoom {
  to {
    transform: scale(1.35);
    opacity: 0;
    filter: blur(14px);
  }
}
.login-screen.signing-in .login-aurora,
.login-screen.signing-in #login-stars {
  animation: login-bg-out 600ms ease forwards;
}
@keyframes login-bg-out {
  to { opacity: 0; transform: scale(1.12); filter: blur(30px); }
}

/* center the whole column */
.login-screen {
  flex-direction: column;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .aurora-blob,
  .login-avatar-ring::before,
  .login-screen .login-name,
  .login-screen .login-box {
    animation: none !important;
  }
}
