/**
 * CSS específico para tela de Login
 * /suporte/assets/css/login.css
 */

/* =====================================================
   LAYOUT ESPECÍFICO DO LOGIN
   ===================================================== */

.login-container {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  position: relative;
}

.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="b" gradientUnits="userSpaceOnUse" cx="500" cy="500" r="500"><stop offset="0" stop-color="white" stop-opacity="0.1"/><stop offset="1" stop-color="white" stop-opacity="0"/></radialGradient></defs><rect width="1000" height="1000" fill="url(%23b)"/></svg>') center/cover;
  opacity: 0.1;
}

/* =====================================================
   FORMULÁRIO DE LOGIN
   ===================================================== */

.login-form-container {
  position: relative;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-logo {
  transition: transform 0.3s ease;
}

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

/* =====================================================
   INPUTS CUSTOMIZADOS
   ===================================================== */

.login-input {
  transition: all 0.3s ease;
  border: 2px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.9);
}

.login-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: white;
  transform: translateY(-1px);
}

.login-input:hover:not(:focus) {
  border-color: #d1d5db;
  background: white;
}

/* Input com ícone */
.input-with-icon {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  transition: color 0.3s ease;
}

.input-with-icon .login-input {
  padding-left: 3rem;
}

.input-with-icon .login-input:focus + .input-icon {
  color: #3b82f6;
}

/* =====================================================
   BOTÃO DE LOGIN CUSTOMIZADO
   ===================================================== */

.login-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.login-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.login-btn:hover::before {
  left: 100%;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.login-btn:active {
  transform: translateY(0);
  box-shadow: 0 5px 10px rgba(59, 130, 246, 0.3);
}

/* =====================================================
   TOGGLE DE SENHA
   ===================================================== */

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.3s ease;
  padding: 4px;
  border-radius: 4px;
}

.password-toggle:hover {
  color: #6b7280;
  background: rgba(0, 0, 0, 0.05);
}

.password-toggle:focus {
  outline: none;
  color: #3b82f6;
}

/* =====================================================
   CHECKBOX CUSTOMIZADO
   ===================================================== */

.custom-checkbox {
  position: relative;
  display: inline-block;
}

.custom-checkbox input[type="checkbox"] {
  appearance: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid #d1d5db;
  border-radius: 0.25rem;
  background: white;
  transition: all 0.3s ease;
  cursor: pointer;
}

.custom-checkbox input[type="checkbox"]:checked {
  background: #3b82f6;
  border-color: #3b82f6;
}

.custom-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.custom-checkbox input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* =====================================================
   ALERTAS DE ERRO
   ===================================================== */

.login-alert {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.error-shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* =====================================================
   LOADING STATE
   ===================================================== */

.login-loading .login-btn {
  pointer-events: none;
  opacity: 0.7;
}

.login-loading .login-btn .btn-text {
  opacity: 0;
}

.login-loading .login-btn .btn-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* =====================================================
   LINKS
   ===================================================== */

.login-link {
  color: #3b82f6;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.login-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #3b82f6;
  transition: width 0.3s ease;
}

.login-link:hover::after {
  width: 100%;
}

.login-link:hover {
  color: #1d4ed8;
}

/* =====================================================
   FOOTER DO LOGIN
   ===================================================== */

.login-footer {
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.login-footer:hover {
  opacity: 1;
}

/* =====================================================
   RESPONSIVIDADE ESPECÍFICA
   ===================================================== */

@media (max-width: 640px) {
  .login-form-container {
    margin: 1rem;
    border-radius: 0.75rem;
  }
  
  .login-title {
    font-size: 1.75rem;
  }
  
  .login-input {
    padding: 0.75rem;
  }
  
  .login-btn {
    padding: 0.875rem 1rem;
  }
}

@media (max-width: 480px) {
  .login-container {
    padding: 0.5rem;
  }
  
  .login-form-container {
    margin: 0.5rem;
    padding: 1.5rem;
  }
}

/* =====================================================
   ANIMAÇÕES DE ENTRADA
   ===================================================== */

.login-form-container {
  animation: loginFadeIn 0.6s ease-out;
}

@keyframes loginFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-logo {
  animation: logoFloat 0.8s ease-out 0.2s both;
}

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

.login-title {
  animation: titleSlide 0.8s ease-out 0.4s both;
}

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

.login-form {
  animation: formSlide 0.8s ease-out 0.6s both;
}

@keyframes formSlide {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* =====================================================
   MODO ESCURO (FUTURO)
   ===================================================== */

@media (prefers-color-scheme: dark) {
  .login-form-container {
    background: rgba(31, 41, 55, 0.95);
    border-color: rgba(75, 85, 99, 0.3);
  }
  
  .login-input {
    background: rgba(55, 65, 81, 0.9);
    border-color: #4b5563;
    color: #f9fafb;
  }
  
  .login-input:focus {
    background: #374151;
    border-color: #3b82f6;
  }
}