/* ===========================================
   LOGIN PAGE — P3M Dark Theme Redesign
   =========================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  margin: 0;
  background-color: #0f172a;
}

/* Background Overlay */
.login-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: -1;
}

/* Wrapper for centering */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* Main Card */
.login-card {
  display: flex;
  width: 100%;
  max-width: 950px;
  min-height: 520px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  background: transparent;
  animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==============================================
   LEFT PANEL
   ============================================== */
.login-left {
  flex: 1;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* Dynamic gradient using CSS variable */
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary-color) 85%, transparent) 0%, rgba(30, 25, 40, 0.95) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.login-logo-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.login-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.login-brand-text {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.3px;
  border-left: 2px solid rgba(255,255,255,0.3);
  padding-left: 16px;
}

.login-brand-text span {
  font-weight: 400;
  font-size: 12px;
  opacity: 0.8;
}

.welcome-title {
  font-size: 38px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  opacity: 0;
  animation: fadeInLeft 0.8s ease forwards 0.2s;
}

.welcome-subtitle {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
  line-height: 1.4;
  opacity: 0;
  animation: fadeInLeft 0.8s ease forwards 0.3s;
}

.welcome-desc {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  border-left: 2px solid rgba(255,255,255,0.15);
  padding-left: 16px;
  opacity: 0;
  animation: fadeInLeft 0.8s ease forwards 0.4s;
}

/* ==============================================
   RIGHT PANEL
   ============================================== */
.login-right {
  flex: 1;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(23, 25, 33, 0.98);
}

.login-form-container {
  width: 100%;
  max-width: 360px;
}

.form-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin-bottom: 28px;
  opacity: 0;
  animation: slideUpFade 0.8s ease forwards 0.3s;
}

/* Error Alert */
.login-alert {
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 24px;
  text-align: center;
}

/* Form Groups */
.form-group {
  margin-bottom: 24px;
  opacity: 0;
  animation: slideUpFade 0.8s ease forwards 0.4s;
}

.form-group:nth-child(2) {
  animation-delay: 0.5s;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  padding: 14px 40px 14px 14px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  font-size: 14px;
  color: #fff;
  outline: none;
  transition: all 0.3s ease;
}

.form-input::placeholder {
  color: #64748b;
}

.form-input:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 1px var(--secondary-color);
}

.input-icon, .btn-toggle-password {
  position: absolute;
  right: 16px;
  color: var(--secondary-color);
  font-size: 16px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.btn-toggle-password {
  color: #64748b;
}
.btn-toggle-password:hover {
  color: var(--secondary-color);
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  margin-bottom: 12px;
  transition: background 0.2s ease, transform 0.2s ease;
  opacity: 0;
  animation: slideUpFade 0.8s ease forwards 0.6s;
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--primary-color) 80%, black);
  transform: translateY(-2px);
}

.btn-outline {
  width: 100%;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  opacity: 0;
  animation: slideUpFade 0.8s ease forwards 0.7s;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Footer */
.form-footer {
  text-align: center;
  font-size: 12px;
  color: #64748b;
  margin-top: 40px;
  opacity: 0;
  animation: slideUpFade 0.8s ease forwards 0.8s;
}

/* ==============================================
   ANIMATIONS
   ============================================== */
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive */
@media (max-width: 900px) {
  .login-card {
    flex-direction: column;
    height: auto;
    max-width: 500px;
  }
  .login-left {
    padding: 40px;
  }
  .login-right {
    padding: 40px;
  }
  .welcome-title {
    font-size: 36px;
  }
}
