/* ============================================
   REGISTRO.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: 520px; /* Más ancho para el formulario de registro */
  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 (opcional) */
.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.5rem;
  animation: fadeIn 0.8s ease-out 0.3s both;
  position: relative;
}

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

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

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

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

/* Position relative para el toggle de contraseña */
.position-relative {
  position: relative;
}

/* 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 3.2rem 1.1rem 1.1rem; /* Espacio para el toggle */
  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;
}

/* Input con icono a la izquierda */
.auth-input.with-icon {
  padding-left: 3.2rem;
}

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

/* Input inválido */
.auth-input.is-invalid {
  border-color: #d00 !important;
  box-shadow: 0 0 0 4px rgba(221, 0, 0, 0.1) !important;
}

/* Toggle para mostrar/ocultar contraseña */
.password-toggle {
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--color-text-light);
  font-size: 1.2rem;
  transition: color 0.3s ease;
  z-index: 2;
}

.password-toggle:hover {
  color: var(--color-primary);
}

/* Barra de fuerza de contraseña */
.barra {
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background-color: #e2e8f0;
  margin-top: 0.5rem;
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.barra::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  transition: all 0.3s ease;
  border-radius: 4px;
}

/* Niveles de fuerza */
.fuerza-0::after {
  width: 0%;
  background-color: #e2e8f0;
}

.fuerza-1 {
  background-color: #fee2e2;
}

.fuerza-1::after {
  width: 25%;
  background: linear-gradient(90deg, #ff4d4f, #ff7875);
}

.fuerza-2 {
  background-color: #ffedd5;
}

.fuerza-2::after {
  width: 50%;
  background: linear-gradient(90deg, #ff7a45, #ffa940);
}

.fuerza-3 {
  background-color: #fef3c7;
}

.fuerza-3::after {
  width: 75%;
  background: linear-gradient(90deg, #faad14, #ffd666);
}

.fuerza-4 {
  background-color: #d1fae5;
}

.fuerza-4::after {
  width: 100%;
  background: linear-gradient(90deg, #52c41a, #73d13d);
}

/* Mensaje de ayuda de contraseña */
.password-match {
  font-size: 0.9rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: all 0.3s ease;
}

.password-match.text-success {
  color: #52c41a;
  background: rgba(82, 196, 26, 0.1);
}

.password-match.text-danger {
  color: #ff4d4f;
  background: rgba(255, 77, 79, 0.1);
}

.password-match.text-warning {
  color: #faad14;
  background: rgba(250, 173, 20, 0.1);
}

/* Feedback de validación */
.invalid-feedback {
  color: #ff4d4f;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
  animation: fadeIn 0.3s ease;
}

.invalid-feedback:not(:empty) {
  display: block;
}

/* Términos y condiciones mejorados */
.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: var(--color-text);
  animation: fadeIn 0.8s ease-out 0.5s both;
}

.auth-terms input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  margin-top: 0.1rem;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}

.auth-terms label {
  cursor: pointer;
  user-select: none;
  line-height: 1.4;
}

.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);
}

/* 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.55s 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);
}

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

.auth-button--primary:disabled {
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Error de registro */
#registroError: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;
}

#registroError: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); }
}

/* 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%;
}

/* 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 3rem 1rem 1rem;
    font-size: 0.95rem;
  }

  .password-toggle {
    right: 1rem;
  }
}

/* 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,
body.dark .password-toggle {
  color: #6C757D;
}

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

body.dark .barra {
  background-color: #2d3748;
}