/* ============================================================
   Login Page
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .erp-login-page *,
  .erp-login-page *::before,
  .erp-login-page *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .erp-login-anim {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---- Keyframes ---- */
@keyframes erpLoginGradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes erpLoginFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(3deg); }
}
@keyframes erpLoginFloatSlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(12px, -18px) scale(1.05); }
  66% { transform: translate(-8px, 10px) scale(0.97); }
}
@keyframes erpLoginOrbDrift {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  50% { transform: translate(20px, -30px) scale(1.15); opacity: 0.75; }
}
@keyframes erpLoginParticle {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  10% { opacity: 0.7; }
  90% { opacity: 0.5; }
  100% { transform: translateY(-120px) scale(0.4); opacity: 0; }
}
@keyframes erpLoginLogoGlow {
  0%, 100% { box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 0 0 0 rgba(255,255,255,0.3); }
  50% { box-shadow: 0 12px 32px rgba(0,0,0,0.22), 0 0 0 8px rgba(255,255,255,0.08); }
}
@keyframes erpLoginShimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes erpLoginBtnPulse {
  0%, 100% { box-shadow: 0 8px 24px -6px rgba(37, 99, 235, 0.45); }
  50% { box-shadow: 0 8px 32px -4px rgba(37, 99, 235, 0.6), 0 0 0 4px rgba(59, 130, 246, 0.15); }
}
@keyframes erpLoginSpin {
  to { transform: rotate(360deg); }
}
@keyframes erpLoginFadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes erpLoginFadeRight {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes erpLoginScaleIn {
  from { opacity: 0; transform: scale(0.75); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes erpLoginBlobMove {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.08); }
}
@keyframes erpLoginExit {
  to { opacity: 0; transform: scale(0.98); filter: blur(4px); }
}
@keyframes erpLoginIconBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.erp-login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #F8FAFC;
  overflow: hidden;
  transition: opacity 0.5s ease, transform 0.5s ease, filter 0.5s ease;
}
.erp-login-page.erp-login-exiting {
  animation: erpLoginExit 0.5s ease forwards;
}

/* Staggered entrance */
.erp-login-anim {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--delay, 0s);
}
.erp-login-anim[data-anim="fade-up"] {
  transform: translateY(28px);
}
.erp-login-anim[data-anim="fade-right"] {
  transform: translateX(-24px);
}
.erp-login-anim[data-anim="scale"] {
  transform: scale(0.75);
}
.erp-login-anim.erp-login-anim-active {
  opacity: 1;
  transform: none;
}

/* ---- Brand panel (left) ---- */
.erp-login-brand {
  flex: 0 0 44%;
  max-width: 540px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 3.25rem;
  background: linear-gradient(155deg, #1E3A8A 0%, #2563EB 38%, #3B82F6 68%, #06B6D4 100%);
  background-size: 200% 200%;
  animation: erpLoginGradientShift 12s ease infinite;
  color: #fff;
  overflow: hidden;
}
.erp-login-brand::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -15%;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, transparent 68%);
  pointer-events: none;
  animation: erpLoginFloatSlow 18s ease-in-out infinite;
}
.erp-login-brand::after {
  content: '';
  position: absolute;
  bottom: -25%;
  left: -10%;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  pointer-events: none;
  animation: erpLoginFloatSlow 22s ease-in-out infinite reverse;
}

/* Background orbs */
.erp-login-bg-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.erp-login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
}
.erp-login-orb-1 {
  width: 180px;
  height: 180px;
  top: 8%;
  left: -40px;
  background: rgba(255,255,255,0.07);
  animation: erpLoginOrbDrift 14s ease-in-out infinite;
}
.erp-login-orb-2 {
  width: 100px;
  height: 100px;
  bottom: 25%;
  right: 5%;
  background: rgba(6, 182, 212, 0.2);
  animation: erpLoginOrbDrift 10s ease-in-out infinite 2s;
}
.erp-login-orb-3 {
  width: 60px;
  height: 60px;
  top: 45%;
  right: 15%;
  background: rgba(255,255,255,0.12);
  animation: erpLoginOrbDrift 8s ease-in-out infinite 1s;
}

/* Rising particles */
.erp-login-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.erp-login-particles span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  bottom: -10px;
  animation: erpLoginParticle 8s ease-in infinite;
}
.erp-login-particles span:nth-child(1) { left: 15%; animation-delay: 0s; animation-duration: 7s; }
.erp-login-particles span:nth-child(2) { left: 30%; animation-delay: 1.5s; animation-duration: 9s; width: 3px; height: 3px; }
.erp-login-particles span:nth-child(3) { left: 50%; animation-delay: 3s; animation-duration: 8s; }
.erp-login-particles span:nth-child(4) { left: 65%; animation-delay: 0.8s; animation-duration: 10s; width: 5px; height: 5px; }
.erp-login-particles span:nth-child(5) { left: 80%; animation-delay: 2.2s; animation-duration: 7.5s; }
.erp-login-particles span:nth-child(6) { left: 92%; animation-delay: 4s; animation-duration: 9.5s; width: 3px; height: 3px; }
.erp-login-brand-inner {
  position: relative;
  z-index: 1;
}
.erp-login-logo {
  width: 72px;
  height: 72px;
  background: rgba(255,255,255,0.95);
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  margin-bottom: 1.75rem;
  animation: erpLoginLogoGlow 3s ease-in-out infinite;
}
.erp-login-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: erpLoginFloat 4s ease-in-out infinite;
}
.erp-login-brand h1 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0 0 0.5rem;
  color: #fff;
}
.erp-login-brand .erp-login-loc {
  font-size: 0.9375rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  font-weight: 500;
}
.erp-login-brand-desc {
  font-size: 0.9375rem;
  line-height: 1.65;
  opacity: 0.88;
  max-width: 340px;
  margin-bottom: 2.25rem;
}
.erp-login-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.erp-login-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.92;
}
.erp-login-feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease, background 0.3s ease;
}
.erp-login-features li:hover .erp-login-feature-icon {
  transform: scale(1.1);
  background: rgba(255,255,255,0.24);
}
.erp-login-features li:hover .erp-login-feature-icon svg {
  animation: erpLoginIconBounce 0.5s ease;
}
.erp-login-feature-icon svg {
  width: 16px;
  height: 16px;
}

/* Decorative floating shapes */
.erp-login-shape {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.erp-login-shape-1 {
  width: 120px;
  height: 120px;
  top: 12%;
  right: 8%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  animation: erpLoginFloat 6s ease-in-out infinite;
}
.erp-login-shape-2 {
  width: 64px;
  height: 64px;
  bottom: 18%;
  right: 22%;
  background: rgba(255,255,255,0.08);
  animation: erpLoginFloat 5s ease-in-out infinite 1s;
}
.erp-login-shape-3 {
  width: 40px;
  height: 40px;
  top: 55%;
  left: 12%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  animation: erpLoginFloat 7s ease-in-out infinite 0.5s;
}

/* ---- Form panel (right) ---- */
.erp-login-form-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.75rem;
  position: relative;
}
.erp-login-form-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.erp-login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
}
.erp-login-blob-1 {
  width: 320px;
  height: 320px;
  top: 10%;
  right: 5%;
  background: rgba(59, 130, 246, 0.18);
  animation: erpLoginBlobMove 16s ease-in-out infinite;
}
.erp-login-blob-2 {
  width: 260px;
  height: 260px;
  bottom: 10%;
  left: 10%;
  background: rgba(6, 182, 212, 0.12);
  animation: erpLoginBlobMove 20s ease-in-out infinite 3s reverse;
}
.erp-login-form-wrap::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 50%;
  height: 60%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
  pointer-events: none;
}
.erp-login-card {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}
.erp-login-mobile-brand {
  display: none;
  text-align: center;
  margin-bottom: 1.75rem;
}
.erp-login-mobile-brand img {
  width: 56px;
  height: 56px;
  padding: 8px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
  margin-bottom: 0.75rem;
  animation: erpLoginLogoGlow 3s ease-in-out infinite;
}
.erp-login-mobile-brand h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1E293B;
  margin: 0 0 0.2rem;
}
.erp-login-mobile-brand p {
  font-size: 0.8125rem;
  color: #64748B;
  margin: 0;
}

.erp-login-card-head {
  margin-bottom: 1.75rem;
}
.erp-login-card-head h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #1E293B;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
}
.erp-login-card-head p {
  font-size: 0.9375rem;
  color: #64748B;
  margin: 0;
}

.erp-login-form {
  background: #fff;
  border: 1px solid #E8EDF3;
  border-radius: 20px;
  padding: 2rem 2rem 1.75rem;
  box-shadow: 0 20px 50px -16px rgba(15, 23, 42, 0.12);
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}
.erp-login-form:hover {
  box-shadow: 0 24px 56px -16px rgba(59, 130, 246, 0.14);
}
.erp-login-field {
  margin-bottom: 1.15rem;
}
.erp-login-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.45rem;
}
.erp-login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.erp-login-input-icon {
  position: absolute;
  left: 0.95rem;
  color: #94A3B8;
  pointer-events: none;
  display: flex;
  align-items: center;
  transition: color 0.25s ease, transform 0.25s ease;
}
.erp-login-input-icon svg {
  width: 18px;
  height: 18px;
}
.erp-login-input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 2.75rem 0 2.75rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: #1E293B;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, transform 0.25s ease;
}
.erp-login-input-wrap.is-focused input {
  transform: translateY(-1px);
}
.erp-login-input-wrap.is-focused .erp-login-input-icon {
  color: #3B82F6;
  transform: scale(1.1);
}
.erp-login-input-wrap input:focus {
  background: #fff;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14), 0 4px 12px rgba(59, 130, 246, 0.08);
}
.erp-login-input-wrap input::placeholder {
  color: #94A3B8;
}
.erp-login-toggle-pwd {
  position: absolute;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #94A3B8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0;
  transition: color 0.2s ease, background 0.2s ease;
}
.erp-login-toggle-pwd:hover {
  color: #3B82F6;
  background: #EFF6FF;
}
.erp-login-toggle-pwd svg {
  width: 18px;
  height: 18px;
}

.erp-login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.35rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.erp-login-remember {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  margin: 0;
}
.erp-login-remember input {
  width: 16px;
  height: 16px;
  accent-color: #3B82F6;
  cursor: pointer;
}
.erp-login-forgot {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #3B82F6;
  text-decoration: none;
}
.erp-login-forgot:hover {
  color: #1D4ED8;
  text-decoration: none;
}

.erp-login-submit {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 40%, #06B6D4 80%, #3B82F6 100%);
  background-size: 200% auto;
  box-shadow: 0 8px 24px -6px rgba(37, 99, 235, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  animation: erpLoginBtnPulse 3s ease-in-out infinite;
}
.erp-login-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.25) 50%, transparent 60%);
  background-size: 200% 100%;
  animation: erpLoginShimmer 3s ease-in-out infinite;
  pointer-events: none;
}
.erp-login-submit:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px -6px rgba(37, 99, 235, 0.55);
  background-position: right center;
  animation: none;
}
.erp-login-submit:hover .erp-login-btn-arrow {
  transform: translateX(4px);
}
.erp-login-submit:active {
  transform: translateY(-1px);
}
.erp-login-submit.loading {
  opacity: 0.9;
  pointer-events: none;
  animation: none;
}
.erp-login-submit.loading .erp-login-btn-arrow {
  opacity: 0;
  transform: translateX(12px);
}
.erp-login-submit.loading .erp-login-btn-spinner {
  display: block;
}
.erp-login-btn-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: erpLoginSpin 0.7s linear infinite;
}
.erp-login-btn-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.erp-login-submit svg.erp-login-btn-arrow,
.erp-login-submit .erp-login-btn-arrow svg {
  width: 18px;
  height: 18px;
}

.erp-login-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: #94A3B8;
}
.erp-login-footer strong {
  color: #64748B;
  font-weight: 600;
}

.erp-login-version {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1rem;
  padding: 0.3rem 0.75rem;
  background: #F1F5F9;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748B;
}

/* Responsive */
@media (max-width: 991.98px) {
  .erp-login-page {
    flex-direction: column;
  }
  .erp-login-brand {
    display: none;
  }
  .erp-login-mobile-brand {
    display: block;
  }
  .erp-login-form-wrap {
    padding: 1.5rem 1.25rem 2rem;
    align-items: flex-start;
    padding-top: 2.5rem;
  }
}

@media (max-width: 479.98px) {
  .erp-login-form {
    padding: 1.5rem 1.25rem 1.35rem;
    border-radius: 16px;
  }
  .erp-login-card-head h2 {
    font-size: 1.5rem;
  }
}
