/* Estilos personalizados para validação - Tema Solar Energy Logo */

:root {
  --solar-blue-primary: #1a2b3d;
  --solar-blue-secondary: #2c4a6b;
  --solar-orange: #ff6b35;
  --solar-orange-dark: #e55722;
  --solar-white: #ffffff;
  --solar-black: #0f1419;
}

/* ========================================
   Botão de carregamento (tema logo)
   ======================================== */

.btn-loading {
  position: relative;
  pointer-events: none;
  background: linear-gradient(135deg, var(--solar-orange-dark) 0%, var(--solar-orange) 100%);
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  margin: auto;
  border: 3px solid transparent;
  border-top-color: var(--solar-white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========================================
   Tooltips de campo (tema logo)
   ======================================== */

.field-tooltip {
  font-size: 0.75rem !important;
  margin-top: 0.5rem !important;
  margin-bottom: 0 !important;
  padding: 0.5rem 0.75rem !important;
  border-radius: 8px;
  border-left: 3px solid var(--solar-orange);
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(255, 107, 53, 0.05) 100%);
  color: var(--solar-black);
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.2);
}

.field-tooltip .btn-close {
  font-size: 0.6rem;
  padding: 0.1rem 0.2rem;
  color: var(--solar-orange);
}

/* ========================================
   Indicadores de força da senha (tema logo)
   ======================================== */

.password-strength {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--solar-blue-primary) 0%, var(--solar-blue-secondary) 100%);
  color: var(--solar-white);
}

.password-strength small {
  font-weight: 600;
  display: flex;
  align-items: center;
}

.password-match {
  margin-top: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: 6px;
  font-weight: 500;
}

/* ========================================
   Estados dos campos (baseados na logo)
   ======================================== */

.form-control.is-valid {
  border-color: #22c55e;
  background-color: rgba(34, 197, 94, 0.05);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2322c55e' d='m2.3 6.73.94-.94 1.89 1.89 3.75-3.75.94.94L3.24 9.41z'/%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);
  box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.25);
}

.form-control.is-invalid {
  border-color: #ef4444;
  background-color: rgba(239, 68, 68, 0.05);
  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='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 2.4 2.4m0-2.4L5.8 7'/%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);
  box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.25);
}

/* ========================================
   Feedback de erro personalizado (tema logo)
   ======================================== */

.field-error {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #ef4444;
  font-weight: 500;
  padding: 0.375rem 0.5rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
  border-radius: 6px;
  border-left: 3px solid #ef4444;
}

/* ========================================
   Animações suaves para alternância de campos
   ======================================== */

#cpfField, #cnpjField {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top;
}

#cpfField.hiding, #cnpjField.hiding {
  opacity: 0;
  transform: scaleY(0);
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* ========================================
   Notificações globais (tema logo)
   ======================================== */

.alert {
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-left: 4px solid;
  font-weight: 500;
}

.alert-success {
  background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%);
  border-left-color: #10b981;
  color: var(--solar-black);
}

.alert-danger {
  background: linear-gradient(135deg, #fee2e2 0%, #fef2f2 100%);
  border-left-color: #ef4444;
  color: var(--solar-black);
}

.alert-info {
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  border-left-color: var(--solar-blue-secondary);
  color: var(--solar-black);
}

.alert-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
  border-left-color: var(--solar-orange);
  color: var(--solar-black);
}

/* ========================================
   Responsividade para mensagens
   ======================================== */

@media (max-width: 768px) {
  .alert {
    margin: 0.5rem !important;
    font-size: 0.875rem;
    padding: 0.75rem;
  }
  
  .field-tooltip {
    font-size: 0.7rem !important;
    padding: 0.375rem 0.5rem !important;
  }
  
  .password-strength {
    padding: 0.375rem 0.5rem;
  }
}

/* ========================================
   Estados de hover para botões (tema logo)
   ======================================== */

.btn-solar-orange:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
  background: linear-gradient(135deg, var(--solar-orange) 0%, var(--solar-orange-dark) 100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Destaque para campos ativos (tema logo)
   ======================================== */

.form-control:focus {
  border-color: var(--solar-orange);
  box-shadow: 0 0 0 0.25rem rgba(255, 107, 53, 0.25);
  background: var(--solar-white);
  transform: translateY(-1px);
  transition: all 0.3s ease;
}

.input-group .form-control:focus {
  z-index: 5;
}

/* ========================================
   Estilo para seleção de tipo de usuário (tema logo)
   ======================================== */

.btn-check:checked + .btn-outline-solar-orange {
  background: linear-gradient(135deg, var(--solar-orange) 0%, var(--solar-orange-dark) 100%);
  border-color: var(--solar-orange);
  color: var(--solar-white);
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
  transform: translateY(-1px);
}

.btn-outline-solar-orange {
  border: 2px solid var(--solar-orange);
  color: var(--solar-orange);
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-outline-solar-orange::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.1), transparent);
  transition: left 0.5s ease;
}

.btn-outline-solar-orange:hover::before {
  left: 100%;
}

/* ========================================
   Cards e containers (tema logo)
   ======================================== */

.card {
  border: none;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(26, 43, 61, 0.15);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(26, 43, 61, 0.2);
}

/* ========================================
   Input groups (tema logo)
   ======================================== */

.input-group-text {
  background: linear-gradient(135deg, #f8fafc 0%, var(--solar-white) 100%);
  border-color: #e2e8f0;
  color: var(--solar-blue-primary);
  font-weight: 500;
}

/* ========================================
   Efeitos de micro-interação
   ======================================== */

.form-control, .btn, .card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control:hover {
  border-color: rgba(255, 107, 53, 0.3);
}

/* ========================================
   Indicadores visuais melhorados
   ======================================== */

.validation-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

.validation-icon.success {
  color: #22c55e;
}

.validation-icon.error {
  color: #ef4444;
}

/* ========================================
   Loading states (tema logo)
   ======================================== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(26, 43, 61, 0.8) 0%, rgba(44, 74, 107, 0.8) 100%);
  backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 107, 53, 0.3);
  border-top: 4px solid var(--solar-orange);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}