/*
 * Authentication page styles for SigmaSRC Enterprise Platform
 * Login, logout, and authentication-related components
 */

/* Login page layout */
.auth-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  max-width: 450px;
  width: 100%;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  overflow: hidden;
  animation: slideUp 0.6s ease-out;
}

.auth-header {
  background: linear-gradient(135deg, var(--esp-brand-blue), var(--esp-brand-light-blue));
  color: white;
  text-align: center;
  padding: 2rem 1.5rem;
}

.auth-header img {
  max-width: 200px;
  height: auto;
  margin-bottom: 1rem;
  filter: brightness(0) invert(1);
}

.auth-header h3 {
  margin-bottom: 0.5rem;
  font-weight: 300;
}

.auth-header small {
  opacity: 0.8;
  font-size: 0.875rem;
}

.auth-body {
  padding: 2rem;
}

.auth-footer {
  background: var(--esp-light);
  text-align: center;
  padding: 1rem;
  border-top: 1px solid #dee2e6;
}

/* Authentication method info */
.auth-method-info {
  background: rgba(var(--esp-info), 0.1);
  border: 1px solid rgba(var(--esp-info), 0.3);
  border-radius: var(--esp-border-radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.auth-method-info .icon {
  color: var(--esp-info);
  margin-top: 0.125rem;
}

.auth-method-info .content {
  flex: 1;
}

.auth-method-info .title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--esp-dark);
}

.auth-method-info .description {
  font-size: 0.875rem;
  color: var(--esp-secondary);
  margin: 0;
}

/* Instructions section */
.auth-instructions {
  margin-bottom: 1.5rem;
}

.instruction-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.instruction-number {
  background: var(--esp-primary);
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.instruction-text {
  flex: 1;
  margin: 0;
  padding-top: 0.25rem;
}

/* Form styling */
.auth-form {
  margin-bottom: 1.5rem;
}

.auth-form .form-label {
  font-weight: 600;
  color: var(--esp-dark);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-form .form-control {
  border-radius: var(--esp-border-radius);
  border: 2px solid #e9ecef;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.auth-form .form-control:focus {
  border-color: var(--esp-primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--esp-primary), 0.25);
  transform: translateY(-1px);
}

.auth-form .form-control.is-invalid {
  border-color: var(--esp-danger);
}

.auth-form .invalid-feedback {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Password toggle button */
.password-toggle {
  border-left: none;
  background: #e9ecef;
  border-color: #e9ecef;
  color: var(--esp-secondary);
  transition: all 0.3s ease;
}

.password-toggle:hover,
.password-toggle:focus {
  background: #dee2e6;
  border-color: #dee2e6;
  color: var(--esp-dark);
}

/* Remember me checkbox */
.auth-remember {
  margin-bottom: 1.5rem;
}

.auth-remember .form-check-input {
  border-radius: 0.25rem;
  border: 2px solid #dee2e6;
}

.auth-remember .form-check-input:checked {
  background-color: var(--esp-primary);
  border-color: var(--esp-primary);
}

.auth-remember .form-check-label {
  font-size: 0.9rem;
  color: var(--esp-secondary);
  cursor: pointer;
}

/* Submit button */
.auth-submit {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: var(--esp-border-radius);
  background: linear-gradient(135deg, var(--esp-primary), #0b5ed7);
  border: none;
  color: white;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(var(--esp-primary), 0.3);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-submit .icon {
  margin-right: 0.5rem;
}

/* Loading state */
.auth-submit.loading {
  pointer-events: none;
}

.auth-submit.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.5rem;
  height: 1.5rem;
  margin: -0.75rem 0 0 -0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

/* Error messages */
.auth-error {
  background: rgba(var(--esp-danger), 0.1);
  border: 1px solid rgba(var(--esp-danger), 0.3);
  color: var(--esp-danger);
  padding: 1rem;
  border-radius: var(--esp-border-radius);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.auth-error .icon {
  margin-top: 0.125rem;
  flex-shrink: 0;
}

.auth-error .content {
  flex: 1;
}

.auth-error .title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.auth-error .message {
  font-size: 0.875rem;
  margin: 0;
}

/* Success messages */
.auth-success {
  background: rgba(var(--esp-success), 0.1);
  border: 1px solid rgba(var(--esp-success), 0.3);
  color: var(--esp-success);
  padding: 1rem;
  border-radius: var(--esp-border-radius);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.auth-success .icon {
  margin-top: 0.125rem;
  flex-shrink: 0;
}

/* Additional links */
.auth-links {
  text-align: center;
  margin-top: 1.5rem;
}

.auth-links a {
  color: var(--esp-primary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.auth-links a:hover {
  color: #0b5ed7;
  text-decoration: underline;
}

/* Server info */
.server-info {
  font-size: 0.8rem;
  color: var(--esp-secondary);
  text-align: center;
  margin-top: 1rem;
}

.server-info strong {
  color: var(--esp-dark);
}

/* Responsive design */
@media (max-width: 576px) {
  .auth-container {
    padding: 1rem 0.5rem;
  }
  
  .auth-card {
    border-radius: 0.5rem;
  }
  
  .auth-header {
    padding: 1.5rem 1rem;
  }
  
  .auth-body {
    padding: 1.5rem;
  }
  
  .auth-header img {
    max-width: 150px;
  }
  
  .auth-header h3 {
    font-size: 1.5rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .auth-card {
    border: 2px solid var(--esp-dark);
  }
  
  .auth-form .form-control {
    border-width: 3px;
  }
  
  .auth-form .form-control:focus {
    border-width: 3px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .auth-card {
    animation: none;
  }
  
  .auth-submit {
    transition: none;
  }
  
  .auth-submit:hover {
    transform: none;
  }
}

/* Print styles */
@media print {
  .auth-container {
    background: white;
    min-height: auto;
  }
  
  .auth-card {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .auth-header {
    background: white;
    color: black;
  }
  
  .auth-header img {
    filter: none;
  }
  
  .auth-submit {
    background: white;
    color: black;
    border: 1px solid #000;
  }
}