/**
 * Estilos para validação de formulários em tempo real
 * Compatível com o tema azul (#2c578a) e branco
 */

/* Estilos para campos inválidos */
.form-control.is-invalid {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23dc3545' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%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);
  padding-right: calc(1.5em + 0.75rem) !important;
}

/* Estilos para campos válidos */
.form-control.is-valid {
  border-color: #28a745 !important;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2328a745' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'%3E%3C/path%3E%3Cpolyline points='22 4 12 14.01 9 11.01'%3E%3C/polyline%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);
  padding-right: calc(1.5em + 0.75rem) !important;
}

/* Mensagens de feedback */
.invalid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #dc3545;
}

.valid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #28a745;
}

.is-invalid ~ .invalid-feedback,
.is-invalid ~ .invalid-tooltip {
  display: block;
}

.is-valid ~ .valid-feedback,
.is-valid ~ .valid-tooltip {
  display: block;
}

/* Indicador de força de senha */
.password-strength-meter {
  height: 5px;
  width: 100%;
  background-color: #e9ecef;
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.password-strength-meter-fill {
  height: 100%;
  width: 0;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-weak .password-strength-meter-fill {
  width: 25%;
  background-color: #dc3545;
}

.strength-medium .password-strength-meter-fill {
  width: 50%;
  background-color: #ffc107;
}

.strength-good .password-strength-meter-fill {
  width: 75%;
  background-color: #17a2b8;
}

.strength-strong .password-strength-meter-fill {
  width: 100%;
  background-color: #28a745;
}

.password-strength-text {
  font-size: 0.75rem;
  margin-top: 5px;
  color: #6c757d;
  transition: color 0.3s ease;
}

.strength-weak .password-strength-text {
  color: #dc3545;
}

.strength-medium .password-strength-text {
  color: #ffc107;
}

.strength-good .password-strength-text {
  color: #17a2b8;
}

.strength-strong .password-strength-text {
  color: #28a745;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}

.toast {
  max-width: 350px;
  overflow: hidden;
  font-size: 0.875rem;
  background-color: rgba(255, 255, 255, 0.95);
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 0.25rem;
  margin-bottom: 10px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-header {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  color: #6c757d;
  background-color: rgba(255, 255, 255, 0.85);
  background-clip: padding-box;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.toast-body {
  padding: 0.75rem;
}

.toast-success {
  border-left: 4px solid #28a745;
}

.toast-error {
  border-left: 4px solid #dc3545;
}

.toast-warning {
  border-left: 4px solid #ffc107;
}

.toast-info {
  border-left: 4px solid #17a2b8;
}

/* Animações para transições */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.animate-fade {
  animation: fadeIn 0.3s ease;
}

.animate-slide {
  animation: slideInUp 0.3s ease;
}

/* Melhorias para indicadores de carregamento */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(44, 87, 138, 0.3);
  border-radius: 50%;
  border-top-color: #2c578a;
  animation: spin 1s ease-in-out infinite;
  margin-right: 10px;
}

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

/* Melhorias de acessibilidade */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsividade */
@media (max-width: 768px) {
  .form-side {
    padding: 1.5rem !important;
  }
  
  .form-title {
    font-size: 1.5rem !important;
  }
  
  .form-subtitle {
    font-size: 0.9rem !important;
  }
  
  .btn {
    padding: 0.5rem 1rem !important;
  }
  
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }
  
  .toast {
    max-width: 100%;
  }
}

@media (max-width: 576px) {
  .main-card {
    flex-direction: column !important;
  }
  
  .content-side {
    display: none !important;
  }
  
  .form-side {
    width: 100% !important;
    border-radius: 12px !important;
  }
}
