/* login.css — Trang đăng nhập riêng biệt, full-page, không dùng _Layout chung.
   Thiết kế: nền gradient tối + card kính mờ (glassmorphism) + micro-animation,
   đồng bộ tông màu với navbar chính (layout.css). */

/* ====== Reset & Base ====== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family:
    "Be Vietnam Pro",
    system-ui,
    -apple-system,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ====== Full-page Background ====== */
body.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a1020 0%, #0f172a 30%, #1a1040 60%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}

/* Animated mesh gradient overlay */
body.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 20% 30%, rgba(59, 130, 246, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 500px 500px at 80% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 70%),
    radial-gradient(ellipse 400px 300px at 60% 20%, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
  animation: login-bg-drift 20s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes login-bg-drift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-30px, 20px) scale(1.05);
  }
  100% {
    transform: translate(20px, -15px) scale(1);
  }
}

/* Floating particles */
body.login-page::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 15%, rgba(147, 197, 253, 0.35) 50%, transparent 50%),
    radial-gradient(1px 1px at 30% 70%, rgba(147, 197, 253, 0.2) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 55% 25%, rgba(103, 232, 249, 0.3) 50%, transparent 50%),
    radial-gradient(1px 1px at 75% 60%, rgba(196, 181, 253, 0.25) 50%, transparent 50%),
    radial-gradient(2px 2px at 90% 10%, rgba(59, 130, 246, 0.3) 50%, transparent 50%),
    radial-gradient(1px 1px at 45% 85%, rgba(103, 232, 249, 0.2) 50%, transparent 50%);
  animation: login-stars-float 30s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes login-stars-float {
  0% {
    transform: translateY(0);
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(-20px);
    opacity: 0.6;
  }
}

/* ====== Login Card ====== */
.login-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 20px;
  animation: login-card-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes login-card-enter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-card {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 44px 36px 36px;
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.06),
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(59, 130, 246, 0.05);
  position: relative;
  overflow: hidden;
}

/* ====== Logo / Brand ====== */
.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.login-brand-icon::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow:
    0 0 0 3px rgba(34, 197, 94, 0.2),
    0 0 12px rgba(34, 197, 94, 0.6);
  animation: login-pulse 2.4s ease-in-out infinite;
  position: absolute;
  top: -4px;
  right: -4px;
}

@keyframes login-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.75);
  }
}

.login-brand-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: brightness(1.2);
}

.login-brand-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: linear-gradient(90deg, #ffffff 0%, #93c5fd 55%, #67e8f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 4px;
}

.login-brand-sub {
  font-size: 13px;
  color: rgba(148, 163, 184, 0.8);
  font-weight: 400;
}

/* ====== Alerts ====== */
.login-alert {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: login-alert-in 0.35s ease-out;
}

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

.login-alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.login-alert-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #86efac;
}

.login-alert i {
  font-size: 16px;
  flex-shrink: 0;
}

/* ====== Form ====== */
.login-form-group {
  margin-bottom: 18px;
}

.login-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(203, 213, 225, 0.85);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.login-input-wrap {
  position: relative !important;
  display: block !important;
}

/* Icon bên trái input (user, lock) — chỉ target <i> trực tiếp, KHÔNG ảnh hưởng
   <i> bên trong button toggle (vì button là con trực tiếp, <i> nằm sâu hơn). */
.login-input-wrap > i {
  position: absolute !important;
  left: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: rgba(148, 163, 184, 0.5) !important;
  font-size: 15px !important;
  transition: color 0.2s ease !important;
  pointer-events: none !important;
  z-index: 2 !important;
}

.login-input {
  width: 100% !important;
  height: 46px !important;
  padding: 0 44px 0 42px !important; /* right padding cho nút toggle */
  background: rgba(30, 41, 59, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px !important;
  color: #e2e8f0 !important;
  font-size: 14px !important;
  font-family: inherit !important;
  font-weight: 500 !important;
  outline: none !important;
  transition: all 0.2s ease !important;
}

.login-input::placeholder {
  color: rgba(148, 163, 184, 0.4);
  font-weight: 400;
}

.login-input:focus {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.1),
    0 0 20px rgba(59, 130, 246, 0.08);
  background: rgba(30, 41, 59, 0.8);
}

.login-input:focus ~ i,
.login-input-wrap:focus-within > i {
  color: #60a5fa !important;
}

/* Password toggle — nằm trong input, bên phải */
.login-pw-toggle {
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: none !important;
  border: none !important;
  color: rgba(148, 163, 184, 0.5) !important;
  cursor: pointer !important;
  padding: 6px !important;
  font-size: 15px !important;
  line-height: 1 !important;
  transition: color 0.2s ease !important;
  z-index: 3 !important;
  pointer-events: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 6px !important;
}

.login-pw-toggle:hover {
  color: #93c5fd !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.login-pw-toggle i {
  pointer-events: none !important;
  position: static !important;
  transform: none !important;
  font-size: 15px !important;
  color: inherit !important;
}

/* ====== Submit Button ====== */
.login-btn {
  width: 100%;
  height: 46px;
  margin-top: 6px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #4f46e5 100%);
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.login-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Shimmer effect */
.login-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.12) 45%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0.12) 55%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: login-shimmer 3s ease-in-out infinite;
}

@keyframes login-shimmer {
  0% {
    background-position: 200% 50%;
  }
  100% {
    background-position: -200% 50%;
  }
}

/* ====== Footer ====== */
.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.45);
  line-height: 1.6;
}

.login-footer code {
  font-size: 11px;
  background: rgba(30, 41, 59, 0.5);
  padding: 2px 6px;
  border-radius: 4px;
  color: rgba(148, 163, 184, 0.6);
}

/* ====== Responsive ====== */
@media (max-width: 480px) {
  .login-wrapper {
    padding: 16px;
  }
  .login-card {
    padding: 32px 24px 28px;
    border-radius: 16px;
  }
  .login-brand-title {
    font-size: 20px;
  }
}
