/* ============================================
   LOGIN.CSS - VERSIÓN MEJORADA Y ATRACTIVA
   ============================================ */

/* Wrapper general centrado con fondo blanco */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 120px 1rem 2rem 1rem; /* Espacio superior para el navbar */
  box-sizing: border-box;
  background: #FFFFFF;
  position: relative;
}

/* Panel contenedor mejorado */
.auth-panel {
  width: 100%;
  max-width: 500px; /* Más ancho */
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: 1.25rem;
  padding: 3rem 2.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Borde superior decorativo */
.auth-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

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

/* Icono decorativo */
.auth-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: white;
  box-shadow: 0 8px 24px rgba(0, 61, 165, 0.25);
  animation: fadeIn 0.8s ease-out;
}

/* Título mejorado */
.auth-title {
  color: var(--color-primary);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  animation: fadeIn 0.8s ease-out 0.1s both;
}

/* Subtítulo */
.auth-subtitle {
  text-align: center;
  color: var(--color-text-light);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
  animation: fadeIn 0.8s ease-out 0.2s both;
}

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

/* Grupos de campos mejorados */
.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  animation: fadeIn 0.8s ease-out 0.3s both;
}

.auth-form-group:nth-child(2) {
  animation-delay: 0.4s;
}

.auth-form-group label {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Wrapper para inputs con iconos */
.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-light);
  font-size: 1.1rem;
  pointer-events: none;
  transition: color 0.3s ease;
  z-index: 1;
}

/* Campos de entrada mejorados */
.auth-input {
  width: 100%;
  padding: 1.1rem 1.1rem 1.1rem 3.2rem;
  border: 2px solid var(--color-border);
  border-radius: 0.75rem;
  font-size: 1rem;
  background-color: #fff;
  color: var(--color-text);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.auth-input::placeholder {
  color: var(--color-text-light);
}

.auth-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(0, 61, 165, 0.1);
  outline: none;
  transform: translateY(-2px);
  background-color: #fff;
}

.auth-input:focus ~ .input-icon {
  color: var(--color-primary);
}

/* Botones generales mejorados */
.auth-button {
  width: 100%;
  padding: 1.1rem;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.8s ease-out 0.5s both;
}

/* Efecto ripple en botones */
.auth-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.auth-button:hover::before {
  width: 300px;
  height: 300px;
}

/* Botón principal */
.auth-button--primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 61, 165, 0.3);
}

.auth-button--primary:hover,
.auth-button--primary:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 61, 165, 0.4);
}

/* Botón secundario (amarillo) */
.auth-button--secondary {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-dark));
  color: #212529;
  box-shadow: 0 4px 14px rgba(246, 202, 72, 0.3);
}

.auth-button--secondary:hover,
.auth-button--secondary:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(246, 202, 72, 0.4);
}

/* Botón Google */
.auth-button--google {
  background: linear-gradient(135deg, #db4437 0%, #c1351d 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(219, 68, 55, 0.3);
  animation: fadeIn 0.8s ease-out 0.7s both;
}

.auth-button--google:hover,
.auth-button--google:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(219, 68, 55, 0.4);
}

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

/* Separador decorativo */
.auth-separator {
  text-align: center;
  margin: 1.75rem 0;
  color: var(--color-text-light);
  font-size: 0.95rem;
  position: relative;
  animation: fadeIn 0.8s ease-out 0.6s both;
}

.auth-separator::before,
.auth-separator::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-border), transparent);
}

.auth-separator::before { 
  left: 0; 
}

.auth-separator::after { 
  right: 0; 
}

/* Términos y condiciones */
.auth-terms {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: var(--color-text);
}

.auth-terms input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.auth-terms a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.auth-terms a:hover,
.auth-terms a:focus {
  text-decoration: underline;
  color: var(--color-primary-dark);
}

/* Footer links mejorados */
.auth-footer-links {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--color-text-light);
  animation: fadeIn 0.8s ease-out 0.6s both;
}

.auth-footer-links a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
}

.auth-footer-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.auth-footer-links a:hover {
  color: var(--color-primary-dark);
  transform: translateX(2px);
}

.auth-footer-links a:hover::after {
  width: 100%;
}

/* Error mejorado con animación */
#loginError:not(:empty),
.auth-error:not(:empty) {
  animation: shake 0.5s ease-in-out;
  padding: 0.875rem;
  background: rgba(211, 47, 47, 0.1);
  border-left: 4px solid var(--color-error);
  border-radius: 0.5rem;
  margin-top: 1rem;
  color: var(--color-error);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#loginError:not(:empty)::before,
.auth-error:not(:empty)::before {
  content: '⚠️';
  font-size: 1.2rem;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
  20%, 40%, 60%, 80% { transform: translateX(8px); }
}

/* Responsive */
@media (max-width: 768px) {
  .auth-wrapper {
    padding: 100px 1rem 2rem 1rem;
  }

  .auth-panel {
    max-width: 95%;
  }
}

@media (max-width: 576px) {
  .auth-wrapper {
    padding: 90px 1rem 1.5rem 1rem;
  }

  .auth-panel {
    padding: 2rem 1.5rem;
    max-width: 100%;
  }

  .auth-title {
    font-size: 1.7rem;
  }

  .auth-subtitle {
    font-size: 0.95rem;
  }

  .auth-icon {
    width: 70px;
    height: 70px;
    font-size: 2rem;
  }

  .auth-button {
    padding: 1rem;
    font-size: 1rem;
  }

  .auth-input {
    padding: 1rem 1rem 1rem 3rem;
  }
}

/* Dark mode support */
body.dark .auth-wrapper {
  background: var(--color-bg);
}

body.dark .auth-panel {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
}

body.dark .auth-input {
  background-color: #1E1E1E;
  border-color: #333333;
  color: #F1F1F1;
}

body.dark .auth-input:focus {
  background-color: #252525;
  border-color: var(--color-primary);
}

body.dark .auth-title {
  color: #4f8cff;
}

body.dark .input-icon {
  color: #6C757D;
}

body.dark .auth-input:focus ~ .input-icon {
  color: #4f8cff;
}