/**
 * Enhanced Authentication Pages Styling
 * Modern, professional look for login, password reset, and 2FA pages
 */

/* Auth Container Enhancement */
.auth-container {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background: linear-gradient(135deg, #121212 0%, #1a1a1a 100%);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* Background Pattern */
.auth-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(57, 211, 83, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(57, 211, 83, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 50% 100%, rgba(57, 211, 83, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

/* Logo Enhancement */
.auth-logo {
  margin-bottom: 2rem;
  z-index: 1;
  animation: fadeInDown 0.6s ease-out;
}

.auth-logo img {
  max-width: 320px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.auth-logo img:hover {
  transform: scale(1.05);
}

/* Auth Card */
.auth-container .card,
.auth-container form {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(57, 211, 83, 0.1);
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* Card Title */
.auth-container h2,
.form-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
  text-align: center;
  position: relative;
}

/* Subtitle */
.auth-container p {
  color: #b0b0b0;
  text-align: center;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Form Groups */
.auth-container .form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

/* Labels */
.auth-container label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #e0e0e0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Input Fields Enhancement */
.auth-container input[type="text"],
.auth-container input[type="email"],
.auth-container input[type="password"],
.auth-container input[type="tel"] {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  background: #121212;
  border: 2px solid #333;
  border-radius: 8px;
  color: #f0f0f0;
  transition: all 0.3s ease;
  position: relative;
}

.auth-container input:focus {
  border-color: #39d353;
  outline: none;
  box-shadow: 
    0 0 0 4px rgba(57, 211, 83, 0.1),
    inset 0 1px 2px rgba(0, 0, 0, 0.3);
  background: #1a1a1a;
}

.auth-container input::placeholder {
  color: #666;
  opacity: 1;
}

/* Input Icons */
.input-group {
  position: relative;
}

.input-group-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 1.1rem;
  pointer-events: none;
  transition: color 0.3s ease;
}

.input-group input {
  padding-left: 3rem;
}

.input-group input:focus ~ .input-group-icon {
  color: #39d353;
}

/* Submit Button Enhancement */
.auth-container button[type="submit"],
.auth-container .btn-primary {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #39d353 0%, #2fb844 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(57, 211, 83, 0.3);
}

.auth-container button[type="submit"]:hover {
  background: linear-gradient(135deg, #2fb844 0%, #39d353 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(57, 211, 83, 0.4);
}

.auth-container button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(57, 211, 83, 0.3);
}

/* Checkbox Enhancement */
.auth-container .checkbox-container {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  cursor: pointer;
}

.auth-container input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 0.75rem;
  cursor: pointer;
  accent-color: #39d353;
}

.auth-container .checkbox-container label {
  margin: 0;
  cursor: pointer;
  color: #e0e0e0;
  font-weight: normal;
  text-transform: none;
  letter-spacing: normal;
}

/* Links Enhancement */
.auth-container a {
  color: #39d353;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-block;
  position: relative;
}

.auth-container a:hover {
  color: #2fb844;
  transform: translateX(2px);
}

.auth-container a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: #39d353;
  transition: width 0.3s ease;
}

.auth-container a:hover::after {
  width: 100%;
}

/* Link Container */
.auth-links {
  margin-top: 2rem;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid #333;
}

.auth-links a {
  display: inline-block;
  margin: 0.5rem;
}

/* Error Messages */
.auth-container .error,
.auth-container .alert-danger {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid #f44336;
  color: #f44336;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-weight: 500;
  animation: shake 0.5s ease-in-out;
}

/* Success Messages */
.auth-container .success,
.auth-container .alert-success {
  background: rgba(57, 211, 83, 0.1);
  border: 1px solid #39d353;
  color: #39d353;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

/* Flash Messages */
.flash-messages {
  width: 100%;
  max-width: 480px;
  margin-bottom: 1rem;
  z-index: 2;
}

.flash-messages ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.flash-messages li {
  background: rgba(57, 211, 83, 0.1);
  border: 1px solid #39d353;
  color: #39d353;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  animation: slideInRight 0.5s ease-out;
}

/* 2FA Code Input */
input#otp_code {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.5rem;
  font-family: 'Monaco', 'Courier New', monospace;
  font-weight: 600;
}

/* Password Strength Indicator */
.password-strength {
  margin-top: 0.5rem;
  height: 4px;
  background: #333;
  border-radius: 2px;
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.password-strength-bar.weak {
  width: 33%;
  background: #f44336;
}

.password-strength-bar.medium {
  width: 66%;
  background: #ff9800;
}

.password-strength-bar.strong {
  width: 100%;
  background: #39d353;
}

/* Loading State */
.auth-container button[type="submit"].loading {
  color: transparent;
  pointer-events: none;
}

.auth-container button[type="submit"].loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.6s linear infinite;
}

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes spinner {
  to { transform: rotate(360deg); }
}

/* Footer Enhancement */
.footer {
  background: transparent;
  margin-top: 3rem;
  padding: 1.5rem;
  text-align: center;
  color: #666;
  font-size: 0.875rem;
  z-index: 1;
  position: relative;
}

.footer-links {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #888;
  margin: 0 1rem;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #39d353;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .auth-container {
    padding: 1rem;
  }
  
  .auth-logo img {
    max-width: 250px;
  }
  
  .auth-container .card,
  .auth-container form {
    padding: 2rem 1.5rem;
    border-radius: 12px;
  }
  
  .auth-container h2 {
    font-size: 1.5rem;
  }
  
  .auth-container input[type="text"],
  .auth-container input[type="email"],
  .auth-container input[type="password"] {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }
  
  .auth-container button[type="submit"] {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
  }
}

/* Back Button Enhancement */
.auth-container .button,
.auth-container .btn-secondary {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: #39d353;
  border: 2px solid #39d353;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  margin-top: 1rem;
  text-align: center;
}

.auth-container .button:hover,
.auth-container .btn-secondary:hover {
  background: rgba(57, 211, 83, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(57, 211, 83, 0.2);
}