/* ==========================================================================
   Dioly RMM Dashboard - Page-Specific Styles (Login Page)
   ========================================================================== */

/* Keyframe Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   1. Login Page Layout (.login-page)
   -------------------------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0a0e1a;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.login-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.03;
  width: 60vw;
  max-width: 800px;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

/* --------------------------------------------------------------------------
   2. Login Container (.login-container)
   -------------------------------------------------------------------------- */
.login-container {
  max-width: 440px;
  width: 100%;
  padding: 0 24px;
  position: relative;
  z-index: 1;
  animation: fadeIn 0.6s ease;
  margin-top: -100px;
}

/* --------------------------------------------------------------------------
   3. Login Header (.login-header)
   -------------------------------------------------------------------------- */
.login-header {
  text-align: center;
  margin-bottom: 8px;
}

.login-header img,
.login-logo {
  max-width: 450px;
  height: auto;
  margin-bottom: 0;
  margin-left: -20px;
  display: inline-block;
}

.login-header .subtitle,
.login-header p,
.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: -60px 0 0 0;
}

/* --------------------------------------------------------------------------
   4. Login Card (.login-card)
   -------------------------------------------------------------------------- */
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  position: relative;
}

/* --------------------------------------------------------------------------
   5. Login Form Specific Styles
   -------------------------------------------------------------------------- */
.login-card .form-group {
  margin-bottom: 24px;
  position: relative;
}

.login-card .form-input {
  padding: 16px;
  font-size: 1rem;
}

.login-card .password-input-wrapper,
.login-card .input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.login-card .password-input-wrapper .form-input,
.login-card .input-wrapper .form-input {
  padding-right: 48px;
  width: 100%;
}

.login-card .btn-primary {
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
  margin-top: 8px;
}

.password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-muted);
  background: transparent;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  z-index: 2;
}

.password-toggle:hover {
  color: var(--text-primary);
}

.remember-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0;
  font-size: 0.85rem;
}

.remember-row label,
.remember-row .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-secondary);
}

.remember-row a,
.forgot-password-link {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

.remember-row a:hover,
.forgot-password-link:hover {
  text-decoration: underline;
  color: var(--primary-hover, var(--primary));
}

/* --------------------------------------------------------------------------
   6. Login Error (.login-error)
   -------------------------------------------------------------------------- */
.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  display: none;
  align-items: center;
  gap: 8px;
}

.login-error.visible,
.login-error.show,
.login-error.active,
.login-error[style*="display: flex"],
.login-error[style*="display: block"] {
  animation: fadeIn 0.3s ease;
}

/* --------------------------------------------------------------------------
   7. Login Footer (.login-footer)
   -------------------------------------------------------------------------- */
.login-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.login-footer p {
  margin: 4px 0;
}

.login-footer .version-info {
  opacity: 0.75;
  font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   8. Lockout Overlay (.lockout-overlay)
   -------------------------------------------------------------------------- */
.lockout-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 26, 0.9);
  backdrop-filter: blur(8px);
  border-radius: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
  z-index: 10;
  animation: fadeIn 0.3s ease;
}

.lockout-overlay.hidden,
.lockout-overlay:not(.active) {
  display: none;
}

.lockout-overlay .lockout-icon {
  font-size: 2.5rem;
  color: var(--danger, #ef4444);
  margin-bottom: 16px;
}

.lockout-overlay .lockout-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.lockout-overlay .lockout-message {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.lockout-overlay .countdown-timer {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   9. Responsive Design
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .login-container {
    padding: 0 16px;
  }

  .login-card {
    padding: 28px 20px;
    border-radius: 12px;
  }

  .login-header {
    margin-bottom: 28px;
  }

  .login-header img,
  .login-logo {
    max-width: 350px;
    margin-bottom: 12px;
  }

  .login-header .subtitle,
  .login-subtitle {
    font-size: 0.85rem;
  }

  .login-card .form-group {
    margin-bottom: 18px;
  }

  .login-card .form-input {
    padding: 14px 12px;
    font-size: 0.95rem;
  }

  .login-card .btn-primary {
    padding: 14px;
    font-size: 1rem;
  }

  .remember-row {
    font-size: 0.8rem;
    margin: 12px 0;
  }

  .login-footer {
    margin-top: 24px;
    font-size: 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   10. Floating Particles Background
   -------------------------------------------------------------------------- */
@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.15;
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) scale(1);
  }
}

.login-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--primary-cyan, #00b4d8);
  opacity: 0;
  animation: floatUp linear infinite;
}

.particle-1 {
  width: 4px; height: 4px;
  left: 10%;
  animation-duration: 12s;
  animation-delay: 0s;
}
.particle-2 {
  width: 6px; height: 6px;
  left: 30%;
  animation-duration: 15s;
  animation-delay: 2s;
}
.particle-3 {
  width: 3px; height: 3px;
  left: 50%;
  animation-duration: 10s;
  animation-delay: 4s;
}
.particle-4 {
  width: 5px; height: 5px;
  left: 70%;
  animation-duration: 14s;
  animation-delay: 1s;
}
.particle-5 {
  width: 3px; height: 3px;
  left: 85%;
  animation-duration: 11s;
  animation-delay: 3s;
}
.particle-6 {
  width: 4px; height: 4px;
  left: 45%;
  animation-duration: 13s;
  animation-delay: 5s;
}

/* --------------------------------------------------------------------------
   11. Form Icon Positioning (Login-specific)
   -------------------------------------------------------------------------- */
.form-input-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-icon .form-input {
  width: 100%;
}

.form-input-icon .form-input-icon-right {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   12. Login Button Specific
   -------------------------------------------------------------------------- */
.btn-login {
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
  margin-top: 8px;
  border: none;
}

.btn-login .btn-spinner {
  display: inline-flex;
  align-items: center;
}

/* --------------------------------------------------------------------------
   13. Login Version Text
   -------------------------------------------------------------------------- */
.login-version {
  opacity: 0.6;
  font-size: 0.75rem;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   14. Shake Animation (Error feedback)
   -------------------------------------------------------------------------- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake-animation {
  animation: shake 0.5s ease-in-out;
}
