.auth-modal .modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: fadeIn 0.3s ease-out;
}

.auth-modal .modal-header {
  border-bottom: none;
  padding: 0;
  position: relative;
}

.auth-modal .modal-body {
  padding: 20px 25px 30px;
}

/* Pestañas tipo libro */
.auth-tabs { display: flex; width: 100%; }

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 15px 0;
  background-color: #f5f5f5;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.auth-tab:first-child { border-top-left-radius: 12px; }
.auth-tab:last-child { border-top-right-radius: 12px; }

.auth-tab.active { background-color: #fff; color: #c29e50; }

.auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: #c29e50;
}

.auth-tab:hover:not(.active) { background-color: #ebebeb; }

.auth-tab i { margin-right: 8px; }

.auth-content { display: none; }
.auth-content.active { display: block; animation: fadeIn 0.3s ease; }

/* Títulos y cierre */
.auth-modal .modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #c29e50;
  display: flex;
  align-items: center;
}

.auth-modal .close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: #f8f8f8;
  opacity: 0.8;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  margin: 0;
}

.auth-modal .close:hover { opacity: 1; background: #ebebeb; }

.auth-modal .close span {
  color: #555;
  font-size: 20px;
  line-height: 1;
  position: relative;
  top: -2px;
}

/* Formularios */
.auth-form-group { position: relative; margin-bottom: 20px; }

.auth-form-group label {
  font-size: 13px;
  color: #555;
  margin-bottom: 5px;
  display: block;
  font-weight: 500;
}

.auth-form-icon { 
  position: absolute; 
  left: 12px; 
  top: 36px; 
  color: #777; 
  font-size: 14px;
  /* Asegurar que los iconos FontAwesome se muestren correctamente */
  font-family: "Font Awesome 5 Free", "Font Awesome 5 Pro", "FontAwesome";
  font-weight: 900; /* Usar el peso correcto para FontAwesome 5 */
  z-index: 5;
  pointer-events: none;
}

/* Estilos específicos para iconos de FontAwesome */
.auth-form-icon.fas,
.auth-form-icon.far,
.auth-form-icon.fal,
.auth-form-icon.fab {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
}

.auth-form-icon.far {
  font-weight: 400;
}

.auth-form-control {
  height: 48px;
  border-radius: 8px;
  border: 1px solid #e1e1e1;
  width: 100%;
  padding: 10px 10px 10px 36px;
  font-size: 14px;
  transition: all 0.3s;
}

/* Campos sin icono izquierdo - usando clase específica */
.auth-form-control.no-left-icon {
  padding-left: 10px;
}

/* Campos sin icono izquierdo - detectados automáticamente */
.auth-form-group:not(:has(.auth-form-icon)) .auth-form-control {
  padding-left: 10px;
}

.auth-form-control:focus {
  border-color: #c29e50;
  box-shadow: 0 0 0 3px rgba(194, 158, 80, 0.1);
  outline: none;
}

/* Botones de formulario */
.auth-btn {
  display: block;
  width: 100%;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.auth-btn:focus { outline: none; }
.auth-btn:active { transform: translateY(1px); }

.auth-btn-primary { background: linear-gradient(45deg, #c29e50, #ddb868); color: #fff; }
.auth-btn-primary:hover { background: linear-gradient(45deg, #b08e40, #cea858); box-shadow: 0 4px 10px rgba(194, 158, 80, 0.3); }

.auth-btn-info { background: linear-gradient(45deg, #c29e50, #ddb868); color: #fff; }
.auth-btn-info:hover { background: linear-gradient(45deg, #b08e40, #cea858); box-shadow: 0 4px 10px rgba(194, 158, 80, 0.3); }

/* Enlaces de pie y recuperación */
.auth-footer-link { margin-top: 20px; text-align: center; font-size: 14px; color: #666; }
.auth-footer-link a { color: #c29e50; font-weight: 500; text-decoration: none; transition: all 0.2s; }
.auth-footer-link a:hover { color: #b08e40; text-decoration: underline; }

.auth-modal a#forgot-password { color: #c29e50; font-size: 13px; text-decoration: none; transition: all 0.2s; }
.auth-modal a#forgot-password:hover { color: #b08e40; text-decoration: underline; }

/* Validación visual */
.auth-form-control.is-valid {
  border-color: #4caf50;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%234caf50' 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-control.is-invalid {
  border-color: #f44336;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23f44336' viewBox='0 0 12 12'%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='%23f44336' 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);
}

/* Ajustes especiales para campos de contraseña con toggle de visibilidad */
.auth-form-control[type="password"].is-valid,
.auth-form-control[data-password="true"].is-valid {
  background-position: right calc(2.75em + 0.1875rem) center;
  padding-right: calc(2.75em + 0.75rem);
}

.auth-form-control[type="password"].is-invalid,
.auth-form-control[data-password="true"].is-invalid {
  background-position: right calc(2.75em + 0.1875rem) center;
  padding-right: calc(2.75em + 0.75rem);
}

.auth-feedback { display: none; width: 100%; margin-top: 5px; font-size: 12px; }
.invalid-feedback { color: #f44336; }
.valid-feedback { color: #4caf50; }
.auth-form-control.is-invalid ~ .invalid-feedback { display: block; }
.auth-form-control.is-valid ~ .valid-feedback { display: block; }

/* Toggle visibilidad de contraseña */
.auth-password-toggle { 
  position: absolute; 
  right: 12px; 
  top: 36px; 
  cursor: pointer; 
  color: #777; 
  font-size: 14px; 
  transition: color 0.2s;
  z-index: 10;
}
.auth-password-toggle:hover { color: #c29e50; }

/* Ajuste de padding para campos de contraseña con toggle */
.auth-form-control[type="password"],
.auth-form-control[data-password="true"] {
  padding-right: 45px;
}

/* Contenedor específico para campos de contraseña con iconos múltiples */
.auth-form-group:has(.auth-password-toggle) .auth-form-control {
  padding-right: 45px;
}

/* Ajuste del toggle cuando hay iconos de validación */
.auth-form-group .auth-form-control.is-valid ~ .auth-password-toggle,
.auth-form-group .auth-form-control.is-invalid ~ .auth-password-toggle {
  right: 8px;
}

/* Mejora visual: separación entre iconos */
.auth-form-group .auth-form-control[type="password"] {
  position: relative;
}

/* Botones sociales (base) */
.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 20px;
  border: 2px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  margin-bottom: 10px;
}

.auth-social-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.auth-social-btn:active { transform: translateY(0); }

/* Google (base) */
.auth-social-btn-google { background: linear-gradient(45deg, #db4437, #e57373); color: #fff; border-color: #db4437; }
.auth-social-btn-google:hover { background: linear-gradient(45deg, #c23321, #db4437); color: #fff; }
.auth-social-btn-google:disabled { background: #ccc; color: #666; cursor: not-allowed; opacity: 0.7; }
.auth-social-btn-google:disabled:hover { transform: none; box-shadow: none; background: #ccc; }

/* Estado de carga para botones sociales */
.auth-social-btn.loading { pointer-events: none; opacity: 0.8; position: relative; }
.auth-social-btn.loading::after {
  content: '';
  width: 16px; height: 16px; margin-left: 8px;
  border: 2px solid transparent; border-top: 2px solid currentColor; border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Divisor */
.auth-divider { margin: 20px 0; text-align: center; position: relative; }
.auth-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: #e0e0e0; }
.auth-divider span { background: #fff; padding: 0 15px; color: #666; font-size: 13px; }

/* Mejoras para botón Google en modal */
.auth-modal .auth-social-btn-google {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  max-width: 280px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #dadce0 !important; /* Estilo oficial de Google */
  color: #757575;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px rgba(60,64,67,0.15);
}

.auth-modal .auth-social-btn-google img, 
.auth-modal .auth-social-btn-google svg { 
  filter: none !important; 
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 18px !important;
  height: 18px !important;
  margin-right: 12px !important;
}

.auth-modal .auth-social-btn-google:hover {
  background: #f8f9fa !important;
  box-shadow: 0 1px 3px rgba(60,64,67,0.3), 0 4px 8px rgba(60,64,67,0.15) !important;
}

.auth-modal .auth-social-btn-google:active { 
  transform: scale(0.98); 
  background: #f1f3f4 !important;
}

@keyframes borderGlow {
  0% { box-shadow: 0 0 5px rgba(255, 127, 39, 0.5); }
  50% { box-shadow: 0 0 15px rgba(255, 127, 39, 0.7); }
  100% { box-shadow: 0 0 5px rgba(255, 127, 39, 0.5); }
}

.auth-modal .auth-social-btn-google:hover { animation: borderGlow 1.5s infinite; background: #fff8f0; }

/* Estado de carga para botón Google */
.auth-btn.loading { position: relative; color: transparent; }
.auth-btn.loading::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  top: 50%; left: 50%; margin-left: -10px; margin-top: -10px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

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

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Responsividad */
@media (max-width: 768px) {
  .auth-social-btn { font-size: 13px; padding: 10px 16px; }
}

@media (max-width: 576px) {
  .auth-modal .modal-content { border-radius: 0; height: 100%; }
  .auth-modal .modal-dialog { margin: 0; max-width: none; height: 100vh; }
  .auth-form-control { height: 46px; font-size: 16px; }
}
