/* ============================================================
   Login Page — Animated Background & Entrance
   ============================================================ */

/* ---------- Animated gradient background ---------- */
.login-page {
  background: linear-gradient(130deg, #bfdbfe 0%, #ddd6fe 30%, #fbcfe8 55%, #bae6fd 75%, #bbf7d0 100%);
  background-size: 300% 300%;
  animation: login-bg-shift 20s ease-in-out infinite;
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-bs-theme="dark"] .login-page {
  background: linear-gradient(130deg, #0f172a 0%, #1e1b4b 35%, #172554 65%, #0f172a 100%);
}

@keyframes login-bg-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---------- Decorative blurred blobs ---------- */
.login-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.6;
  will-change: transform;
  animation: login-blob 16s ease-in-out infinite alternate;
}

.blob-1 { width: 340px; height: 340px; top: -80px; left: -80px; background: #60a5fa; }
.blob-2 { width: 380px; height: 380px; bottom: -100px; right: -60px; background: #c084fc; animation-delay: -4s; }
.blob-3 { width: 260px; height: 260px; top: 30%; right: 8%; background: #f472b6; animation-delay: -8s; }
.blob-4 { width: 300px; height: 300px; bottom: 6%; left: 10%; background: #34d399; animation-delay: -12s; }

[data-bs-theme="dark"] .blob-1 { background: #1e40af; opacity: 0.35; }
[data-bs-theme="dark"] .blob-2 { background: #6d28d9; opacity: 0.35; }
[data-bs-theme="dark"] .blob-3 { background: #be185d; opacity: 0.3; }
[data-bs-theme="dark"] .blob-4 { background: #047857; opacity: 0.3; }

@keyframes login-blob {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, 40px) scale(1.15); }
  100% { transform: translate(-40px, 60px) scale(0.95); }
}

/* ---------- Floating graduation caps ---------- */
.login-float {
  position: absolute;
  bottom: -50px;
  font-size: 20px;
  color: rgba(37, 99, 235, 0.45);
  opacity: 0;
  animation: login-rise linear infinite;
  will-change: transform, opacity;
}

.login-float img {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: contain;
  padding: 2px;
  background: #ffffff;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
  animation: login-sway 3.5s ease-in-out infinite alternate;
}

.f-1 { left: 5%;  animation-duration: 14s; animation-delay: 0s; font-size: 18px; }
.f-2 { left: 15%; animation-duration: 18s; animation-delay: 3s; font-size: 26px; color: rgba(16, 185, 129, 0.4); }
.f-3 { left: 28%; animation-duration: 16s; animation-delay: 6s; font-size: 14px; color: rgba(139, 92, 246, 0.4); }
.f-4 { left: 42%; animation-duration: 20s; animation-delay: 1s; font-size: 22px; color: rgba(236, 72, 153, 0.4); }
.f-5 { left: 58%; animation-duration: 15s; animation-delay: 8s; font-size: 17px; }
.f-6 { left: 70%; animation-duration: 19s; animation-delay: 4s; font-size: 24px; color: rgba(245, 158, 11, 0.45); }
.f-7 { left: 82%; animation-duration: 17s; animation-delay: 9s; font-size: 15px; color: rgba(16, 185, 129, 0.4); }
.f-8 { left: 92%; animation-duration: 21s; animation-delay: 2s; font-size: 20px; color: rgba(139, 92, 246, 0.4); }

@keyframes login-rise {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.6; }
  100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

@keyframes login-sway {
  from { transform: translateX(-12px) rotate(-12deg); }
  to   { transform: translateX(12px) rotate(12deg); }
}

/* ---------- Logo ---------- */
.login-logo {
  margin-bottom: 1.5rem;
  gap: 8px;
  animation: login-rise-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.login-logo .login-logo-img {
  height: 56px;
  width: auto;
  border-radius: 12px;
  object-fit: contain;
  padding: 4px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  animation: login-float-y 2.8s ease-in-out infinite;
}

[data-bs-theme="dark"] .login-logo .login-logo-img {
  background: #ffffff;
}

.login-logo b {
  font-weight: 800;
  background: linear-gradient(90deg, #2563eb, #7c3aed, #db2777, #2563eb);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: login-shimmer 4s linear infinite;
}

[data-bs-theme="dark"] .login-logo b {
  background: linear-gradient(90deg, #60a5fa, #a78bfa, #f472b6, #60a5fa);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
}

@keyframes login-float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

@keyframes login-shimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 250% center; }
}

/* ---------- Login card ---------- */
.login-box {
  z-index: 1;
  position: relative;
}

.login-box .card {
  animation: login-rise-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

@keyframes login-rise-in {
  from { opacity: 0; transform: translateY(34px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Staggered content ---------- */
.login-card-body .login-box-msg,
.login-card-body form,
.login-card-body hr,
.login-card-body .small,
.login-card-body .alert {
  opacity: 0;
  animation: login-fade-in 0.6s ease-out forwards;
}

.login-card-body .login-box-msg { animation-delay: 0.35s; }
.login-card-body form          { animation-delay: 0.45s; }
.login-card-body .alert        { animation-delay: 0.5s; }
.login-card-body hr            { animation-delay: 0.7s; }
.login-card-body .small        { animation-delay: 0.8s; }

@keyframes login-fade-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Input focus effect ---------- */
.login-card-body .input-group-text {
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.login-card-body .input-group-text .bi {
  transition: transform var(--transition-bounce), color 0.3s ease;
}

.login-card-body .input-group:focus-within .input-group-text {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.login-card-body .input-group:focus-within .input-group-text .bi {
  transform: scale(1.25) rotate(-10deg);
  color: #2563eb;
}

/* ---------- Login button ---------- */
.login-btn {
  position: relative;
  overflow: hidden;
  border: none;
  font-weight: 600;
  background: linear-gradient(90deg, #2563eb, #4f46e5, #7c3aed, #2563eb);
  background-size: 300% 100%;
  animation: login-btn-flow 5s linear infinite;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
  transition: transform var(--transition-bounce), box-shadow var(--transition-normal), filter 0.3s ease;
}

.login-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  animation: login-sheen 3.2s ease-in-out infinite;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.45);
  filter: brightness(1.06);
}

.login-btn:active {
  transform: translateY(0) scale(0.97);
}

@keyframes login-btn-flow {
  0%   { background-position: 0% 0; }
  100% { background-position: 300% 0; }
}

@keyframes login-sheen {
  0%, 60% { left: -120%; }
  100%    { left: 130%; }
}

/* ---------- Theme toggle ---------- */
.login-page .theme-toggle-btn {
  animation: login-fade-in 0.6s ease-out 0.9s both;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .login-page,
  .login-blob,
  .login-float,
  .login-float img,
  .login-logo,
  .login-logo .login-logo-img,
  .login-logo b,
  .login-box .card,
  .login-card-body .login-box-msg,
  .login-card-body form,
  .login-card-body hr,
  .login-card-body .small,
  .login-card-body .alert,
  .login-card-body .input-group-text,
  .login-card-body .input-group-text .bi,
  .login-btn,
  .login-btn::before,
  .login-page .theme-toggle-btn {
    animation: none !important;
    transition: none !important;
  }
}