/**
 * AUTH FORMS - ENTERPRISE STYLES
 * Estilos para todos los formularios de autenticación
 */

/* ========== FORM BASE STYLES ========== */
.auth-form {
  width: 100%;
  max-width: 100%;
}

.auth-form .form-control,
.auth-form .form-select {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.auth-form .form-control:focus,
.auth-form .form-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.auth-form .form-control.is-invalid {
  border-color: #dc3545;
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.auth-form .form-control.is-valid {
  border-color: #28a745;
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.auth-form .form-label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.auth-form .form-text {
  font-size: 0.875rem;
  color: #6c757d;
}

/* ========== PASSWORD TOGGLE ========== */
/* Hide native password reveal button in Edge/Chrome/Chromium browsers */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
}

input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-password-reveal {
  display: none !important;
}

.password-toggle-container {
  position: relative;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  padding: 5px 10px;
  font-size: 16px;
  transition: color 0.2s;
  z-index: 10;
}

.password-toggle-btn:hover {
  color: #667eea;
}

/* ========== 2FA CODE INPUTS ========== */
.code-inputs-container {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 2rem 0;
}

.code-input {
  width: 50px;
  height: 60px;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.code-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.3rem rgba(102, 126, 234, 0.25);
  transform: scale(1.05);
}

.code-input:valid {
  border-color: #28a745;
  background-color: rgba(40, 167, 69, 0.05);
}

/* ========== WIZARD STYLES ========== */
.wizard-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
}

.wizard-steps::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 25%;
  right: 25%;
  height: 2px;
  background: #dee2e6;
  z-index: 0;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
  flex: 1;
}

.wizard-step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #dee2e6;
  color: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  transition: all 0.3s ease;
}

.wizard-step.active .wizard-step-number {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transform: scale(1.1);
}

.wizard-step.completed .wizard-step-number {
  background: #28a745;
  color: white;
}

.wizard-step.completed .wizard-step-number::after {
  content: '✓';
}

.wizard-step-label {
  font-size: 0.875rem;
  color: #6c757d;
  text-align: center;
}

.wizard-step.active .wizard-step-label {
  color: #667eea;
  font-weight: 600;
}

/* ========== ALERT ENHANCEMENTS ========== */
.auth-form .alert {
  border-radius: 10px;
  border: none;
  padding: 1rem 1.25rem;
}

.auth-form .alert-info {
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0.05) 100%);
  color: #0d6efd;
}

.auth-form .alert-warning {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 193, 7, 0.1) 100%);
  color: #856404;
}

.auth-form .alert-success {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.2) 0%, rgba(40, 167, 69, 0.1) 100%);
  color: #155724;
}

/* ========== BUTTONS ========== */
.auth-form .btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.auth-form .btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
}

.auth-form .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.auth-form .btn-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border: none;
}

.auth-form .btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
}

.auth-form .btn-warning {
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
  border: none;
  color: #000;
}

.auth-form .btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 193, 7, 0.4);
}

.auth-form .btn-outline-primary:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 576px) {
  .code-inputs-container {
    gap: 8px;
  }
  
  .code-input {
    width: 40px;
    height: 50px;
    font-size: 20px;
  }
  
  .wizard-step-label {
    font-size: 0.75rem;
  }
  
  .wizard-step-number {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }
}

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

.auth-form .tab-pane {
  animation: fadeIn 0.4s ease;
}

/* ========== CUSTOM CHECKBOX/RADIO ========== */
.auth-form .form-check-input:checked {
  background-color: #667eea;
  border-color: #667eea;
}

.auth-form .form-check-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Invalid checkbox styling */
.form-check-input.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-check-input.is-invalid:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* ========== DISABLE VALIDATION ICONS FOR LOGIN FORM ========== */
/* Eliminar completamente los iconos de validación (checks y X) */
form[name="login-form"] .form-control:valid,
form[name="login-form"] .form-control:invalid,
form[name="login-form"] .was-validated .form-control:valid,
form[name="login-form"] .was-validated .form-control:invalid,
form[name="login-form"] .form-control.is-valid,
form[name="login-form"] .form-control.is-invalid {
  background-image: none !important;
  border-color: #dee2e6 !important;
  padding-right: 0.75rem !important;
}

/* Remover bordes de validación al hacer focus */
form[name="login-form"] .form-control:valid:focus,
form[name="login-form"] .form-control:invalid:focus,
form[name="login-form"] .was-validated .form-control:valid:focus,
form[name="login-form"] .was-validated .form-control:invalid:focus {
  border-color: #667eea !important;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15) !important;
}

/* Ocultar mensajes de feedback */
form[name="login-form"] .valid-feedback,
form[name="login-form"] .invalid-feedback {
  display: none !important;
}
