/* ------------------------------------------------------------------ *
 * Login screen only.
 *
 * Loaded exclusively by index.html, after styles.css. Every other page
 * (admin.html, employee.html, management.html) never links this file,
 * so nothing here reaches outside the login screen.
 *
 * The shared dark theme tokens live in styles.css. This file only adds
 * the login screen's own ambient background and entrance animations
 * on top of it.
 * ------------------------------------------------------------------ */

/* ---------------------------------------------------------------- *
 * Ambient background + entrance motion
 * ---------------------------------------------------------------- */

.hero-shell {
  position: relative;
  isolation: isolate;
  overflow: clip;
  display: flex;
  flex-direction: column;
}

/* Floated out of the flex flow so the card centers in the full viewport height,
   not just the space left over below the header. */
.hero-shell .hero-topbar {
  position: absolute;
  top: 24px;
  left: 24px;
  padding: 0;
}

.hero-shell .auth-layout {
  flex: 1;
  align-items: center;
  padding-top: 0;
  grid-template-columns: minmax(0, 480px);
}

.hero-shell::before,
.hero-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.hero-shell::before {
  inset: -35%;
  background:
    radial-gradient(circle at 22% 28%, rgba(0, 51, 181, 0.38), transparent 45%),
    radial-gradient(circle at 78% 18%, rgba(0, 198, 255, 0.20), transparent 42%),
    radial-gradient(circle at 60% 82%, rgba(0, 51, 181, 0.26), transparent 48%);
  animation: login-aurora-drift 9s var(--ease-standard) infinite alternate;
}

.hero-shell::after {
  inset: -45%;
  background:
    radial-gradient(circle at 68% 62%, rgba(0, 198, 255, 0.16), transparent 40%),
    radial-gradient(circle at 30% 75%, rgba(0, 51, 181, 0.20), transparent 44%);
  animation: login-aurora-spin 22s linear infinite;
}

.auth-panel {
  position: relative;
  min-height: 0;
  padding: 36px;
  gap: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--glow-quantum);
  animation: login-auth-rise 620ms var(--ease-standard) both;
}

.auth-panel::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(245, 248, 252, 0.16), transparent);
  animation: login-panel-sheen 1100ms var(--ease-standard) 520ms both;
  pointer-events: none;
}

.auth-panel .hero-copy {
  text-align: center;
  align-items: center;
}

.auth-panel .hero-copy h1 {
  font-size: var(--text-subheadline);
}

.auth-panel .hero-copy p {
  max-width: 46ch;
  color: var(--text-body-color);
  font-size: var(--text-body-sm);
}

.auth-panel .hero-copy h1::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin: 14px auto 0;
  border-radius: var(--radius-pill);
  background: var(--gradient-rule);
}

.auth-signin-area {
  gap: 14px;
}

.google-signin-slot {
  border-radius: var(--radius-pill);
  transition:
    transform var(--duration-hover) var(--ease-standard),
    box-shadow var(--duration-hover) var(--ease-standard);
}

.google-signin-slot:hover {
  transform: scale(1.02);
  box-shadow: var(--glow-neon);
}

.google-signin-slot:focus-within {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

/* Icon-only Google button: a small ringed circle instead of the wide text pill. */
.google-signin-slot--icon {
  position: relative;
  width: fit-content;
  margin: 0 auto;
  padding: 6px;
  border-radius: var(--radius-pill);
  box-shadow: var(--inset-hairline), 0 0 0 1px var(--border-subtle);
  animation: login-ring-pulse 2600ms var(--ease-standard) infinite;
}

.google-signin-slot--icon:hover {
  transform: scale(1.06);
}

.google-signin-slot--icon iframe {
  border-radius: var(--radius-pill);
}

/* Staggers login card contents one after another via --rise-step (set inline per element). */
.login-rise {
  animation: login-auth-rise 560ms var(--ease-standard) both;
  animation-delay: calc(260ms + var(--rise-step, 0) * 130ms);
}

/* ---------------------------------------------------------------- *
 * Sign-in status: idle / loading / success / error
 * ---------------------------------------------------------------- */

.signin-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 22px;
  font-size: var(--text-body-sm);
  color: var(--text-muted);
}

.signin-status.is-error {
  display: block;
  width: 100%;
}

.signin-status.is-success {
  color: var(--text-positive);
}

.status-spinner {
  width: 15px;
  height: 15px;
  flex: none;
  border: 2px solid var(--border-strong);
  border-top-color: var(--neon-pulse);
  border-radius: var(--radius-pill);
  animation: login-spin 640ms linear infinite;
}

.status-check {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: var(--status-positive);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-check-ring {
  stroke-dasharray: 64;
  stroke-dashoffset: 64;
  animation: login-check-draw 380ms var(--ease-standard) forwards;
}

.status-check-mark {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  animation: login-check-draw 260ms var(--ease-standard) 260ms forwards;
}

/* ---------------------------------------------------------------- *
 * Keyframes (prefixed "login-" so they can never shadow an
 * unrelated animation of the same name added later in styles.css)
 * ---------------------------------------------------------------- */

@keyframes login-aurora-drift {
  from { transform: translate3d(-8%, -5%, 0) scale(1); }
  to { transform: translate3d(8%, 5%, 0) scale(1.25); }
}

@keyframes login-aurora-spin {
  to { transform: rotate(360deg); }
}

@keyframes login-panel-sheen {
  from { transform: translateX(-120%) skewX(-18deg); }
  to { transform: translateX(220%) skewX(-18deg); }
}

@keyframes login-auth-rise {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.97);
    filter: blur(6px);
  }
  to { filter: blur(0); }
}

@keyframes login-spin {
  to { transform: rotate(360deg); }
}

@keyframes login-check-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes login-ring-pulse {
  0%, 100% { box-shadow: var(--inset-hairline), 0 0 0 1px var(--border-subtle); }
  50% { box-shadow: var(--inset-hairline), 0 0 0 1px var(--border-subtle), var(--glow-neon); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-shell::before,
  .hero-shell::after {
    animation: none !important;
    transform: none !important;
  }

  .auth-panel,
  .login-rise {
    animation-duration: 1ms !important;
  }

  .auth-panel::after {
    display: none !important;
  }

  .google-signin-slot:hover {
    transform: none;
  }

  .google-signin-slot--icon {
    animation: none !important;
  }

  .google-signin-slot--icon:hover {
    transform: none;
  }
}
