
.registro-container {
  width: 100%;
  min-height: 80vh;
  flex: 1 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 5%;
  background: linear-gradient(135deg, #fce8ef 0%, #fff9f0 30%, #fdf0f8 60%, #fff5e1 100%);
  background-size: 300% 300%;
  animation: gradientShift 18s ease-in-out infinite;
}

/* TARJETA DEL FORMULARIO */
.registro-form {
  max-width: 550px;
  width: 100%;
  padding: 40px;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(255, 105, 180, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-top: 5px solid var(--color-primario);
  position: relative;
  z-index: 2;
}

/* TÍTULOS DEL FORMULARIO */
.registro-form h2 {
  text-align: center;
  color: var(--color-primario); 
  font-family: 'Poppins', sans-serif;
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.subtitulo-form {
  text-align: center;
  font-size: 1.1rem;
  color: #666;
  margin-top: -10px;
  margin-bottom: 30px;
}

/* GRUPOS DE FORMULARIO */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"] {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.25s ease;
}

.form-group input:focus {
  border-color: var(--color-primario);
  box-shadow: 0 0 8px rgba(255, 105, 180, 0.4); 
}

/* LISTA DIDÁCTICA DE CONTRASEÑA (Estilo bonito de píldoras) */
.password-didactico {
  background-color: #fff;
  border-radius: 10px;
  border: 2px dashed var(--color-secundario); 
  padding: 15px 20px;
  margin-bottom: 25px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.password-didactico h4 {
  font-family: 'Poppins', sans-serif;
  color: var(--color-primario);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 15px;
  text-align: center;
}

#password-requisitos {
  list-style: none;
  padding-left: 0;
}

#password-requisitos li {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.85rem;
  margin-bottom: 10px;
  transition: all 0.4s ease-in-out;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: 20px;
  display: flex;
  align-items: center;
}
#password-requisitos li:last-child {
  margin-bottom: 0;
}

/* Estilo INVÁLIDO */
#password-requisitos li.invalido {
  color: #777;
  background-color: var(--color-fondo-claro);
  border: 1px solid #eee;
}

#password-requisitos li.invalido::before {
  content: '○';
  color: #aaa;
  font-weight: 900;
  font-size: 1rem;
  margin-right: 10px;
  transition: all 0.4s ease;
}

/* Estilo VÁLIDO (Fiesta de colores) */
#password-requisitos li.valido {
  color: #fff;
  background-color: var(--color-primario);
  border: 1px solid var(--color-primario);
  box-shadow: 0 3px 8px rgba(255, 105, 180, 0.5); 
  transform: scale(1.02);
  text-decoration: none;
}

#password-requisitos li.valido::before {
  content: '✓';
  color: var(--color-acento); /* Check dorado */
  font-weight: 900;
  font-size: 1rem;
  margin-right: 10px;
  transform: rotate(10deg) scale(1.1);
  transition: all 0.4s ease;
}

/* BOTÓN DE REGISTRARSE */
.btn-registrar {
  width: 100%;
  padding: 15px;
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--color-primario) 0%, #e6509a 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.btn-registrar:hover {
  background: linear-gradient(135deg, #e6509a 0%, #d43d90 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(255, 105, 180, 0.4);
}

.btn-registrar:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(255, 105, 180, 0.3);
}

/* ENLACE A INICIAR SESIÓN */
.login-redirect {
  text-align: center;
  margin-top: 25px;
  font-size: 0.95rem;
  color: #555;
}

.login-redirect a {
  color: var(--color-primario);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-bottom-color 0.3s ease;
}

.login-redirect a:hover {
  border-bottom-color: var(--color-primario); 
}

/* ESTILOS PARA LAS ALERTAS */
.alerta-error {
  background: #f8d7da;
  color: #721c24;
  padding: 12px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  border-left: 4px solid #dc3545;
  font-weight: 600;
}

.alerta-exito {
  background: #d4edda;
  color: #155724;
  padding: 12px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  border-left: 4px solid #28a745;
  font-weight: 600;
}

/* --- Estilo para el Checkbox "Recuérdame" --- */
.form-group-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.form-group-checkbox label {
  /* Hacemos que la etiqueta coincida con las otras */
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: #555;
  font-size: 0.95rem;
  margin-bottom: 0; /* Quitamos el margen que tienen las otras etiquetas */
}

.form-group-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

/* --- Toggle mostrar/ocultar contraseña --- */
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 48px;
  padding-left: 44px;
}

.toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  z-index: 2;
  transition: color 0.2s ease;
  overflow: visible;
}

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

.toggle-password svg {
  width: 22px;
  height: 22px;
  stroke: #aaa;
  transition: stroke 0.2s ease;
}

.toggle-password:hover svg {
  stroke: var(--color-primario);
}

/* --- Link ¿Olvidaste tu contraseña? --- */
.olvidaste-pass {
  text-align: right;
  margin-top: -12px;
  margin-bottom: 22px;
  font-size: 0.85rem;
}

.olvidaste-pass a {
  color: var(--color-primario);
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.olvidaste-pass a:hover {
  opacity: 0.75;
}

/* --- Animación de entrada del formulario --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Responsive --- */

/* Tablets */
@media (max-width: 768px) {
  .registro-container {
    padding: 40px 5%;
    min-height: 0;
  }
}

/* Teléfonos en portrait */
@media (max-width: 600px) {
  .registro-container {
    padding: 20px 4%;
    min-height: 0;
    align-items: flex-start;
  }

  .registro-form {
    padding: 25px 18px;
  }

  .registro-form h2 {
    font-size: 1.65rem;
  }

  .subtitulo-form {
    font-size: 0.95rem;
    margin-bottom: 20px;
  }

  .form-group {
    margin-bottom: 15px;
  }

  .form-group label {
    font-size: 0.88rem;
    margin-bottom: 6px;
  }

  .password-didactico {
    padding: 12px 14px;
    margin-bottom: 16px;
  }

  .password-didactico h4 {
    font-size: 0.92rem;
    margin-bottom: 10px;
  }

  #password-requisitos li {
    font-size: 0.78rem;
    padding: 6px 10px;
    margin-bottom: 6px;
  }

  .btn-registrar {
    padding: 13px;
    font-size: 1rem;
  }

  .login-redirect {
    font-size: 0.88rem;
    margin-top: 18px;
  }
}

/* Teléfonos pequeños */
@media (max-width: 400px) {
  .registro-container {
    padding: 16px 3%;
  }

  .registro-form {
    padding: 20px 14px;
    border-radius: 12px;
  }

  .registro-form h2 {
    font-size: 1.4rem;
  }

  .form-group {
    margin-bottom: 13px;
  }

  .btn-registrar {
    font-size: 1rem;
    padding: 13px;
  }
}

/* --- Validador de email en tiempo real --- */
.email-wrapper {
  position: relative;
}

.email-wrapper input {
  padding-right: 40px;
  padding-left: 44px;
}

.email-validador {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.email-validador.valido  { color: #28a745; }
.email-validador.invalido { color: #dc3545; }

/* --- Botón con estado de carga (spinner) --- */
.btn-registrar {
  position: relative;
}

.btn-registrar.cargando {
  color: transparent;
  pointer-events: none;
  opacity: 0.85;
}

.btn-registrar.cargando::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* --- Shake para alertas de error --- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%, 55%  { transform: translateX(-7px); }
  35%, 75%  { transform: translateX(7px); }
}

.shake {
  animation: shake 0.45s ease;
}

/* ============================================================
   DECORACIÓN FLOTANTE DEL FONDO
   ============================================================ */
.registro-container {
  position: relative;
  overflow: hidden;
}

/* Blob rosa – esquina superior izquierda */
.registro-container::before {
  content: '';
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 105, 180, 0.35) 0%, rgba(255, 182, 193, 0.18) 45%, transparent 70%);
  top: -200px;
  left: -200px;
  animation: flotar 9s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

/* Blob dorado – esquina inferior derecha */
.registro-container::after {
  content: '';
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.32) 0%, rgba(255, 165, 0, 0.14) 45%, transparent 70%);
  bottom: -180px;
  right: -180px;
  animation: flotar 13s ease-in-out infinite reverse;
  pointer-events: none;
  z-index: 0;
}

@keyframes flotar {
  0%, 100% { transform: translateY(0)    scale(1); }
  50%       { transform: translateY(-30px) scale(1.06); }
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================================================
   ANIMACIÓN ESCALONADA DE LOS ELEMENTOS DEL FORMULARIO
   ============================================================ */
.registro-form > * {
  opacity: 0;
  animation: fadeInUp 0.45s ease forwards;
}

.registro-form > *:nth-child(1) { animation-delay: 0.08s; }
.registro-form > *:nth-child(2) { animation-delay: 0.17s; }
.registro-form > *:nth-child(3) { animation-delay: 0.26s; }
.registro-form > *:nth-child(4) { animation-delay: 0.35s; }
.registro-form > *:nth-child(5) { animation-delay: 0.44s; }
.registro-form > *:nth-child(6) { animation-delay: 0.52s; }
.registro-form > *:nth-child(7) { animation-delay: 0.59s; }
.registro-form > *:nth-child(8) { animation-delay: 0.66s; }
.registro-form > *:nth-child(9) { animation-delay: 0.73s; }

/* ============================================================
   RESPONSIVE PARA LOS BLOBS + AJUSTES GENERALES (480px)
   ============================================================ */
@media (max-width: 480px) {
  .registro-container::before {
    width: 300px;
    height: 300px;
    top:  -110px;
    left: -110px;
  }

  .registro-container::after {
    width: 260px;
    height: 260px;
    bottom: -100px;
    right:  -100px;
  }

  /* Prevenir el zoom automático en iOS al enfocar un input */
  .form-group input[type="text"],
  .form-group input[type="email"],
  .form-group input[type="tel"],
  .form-group input[type="password"] {
    font-size: 16px;
    padding: 11px 13px;
  }

  .password-wrapper input {
    padding-right: 44px;
    padding-left: 44px;
  }

  .subtitulo-form {
    font-size: 1rem;
    margin-bottom: 22px;
  }

  .form-group label {
    font-size: 0.9rem;
  }

  .form-group-checkbox label {
    font-size: 0.9rem;
  }

  .olvidaste-pass {
    font-size: 0.82rem;
  }

  .login-redirect {
    font-size: 0.9rem;
  }
}


@media (prefers-reduced-motion: reduce) {
  .registro-form > *,
  .registro-container::before,
  .registro-container::after,
  .registro-container {
    animation: none;
    opacity: 1;
  }
}


#particles-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}


.field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 2;
  display: flex;
  align-items: center;
}

.field-icon svg {
  stroke: #bbb;
  transition: stroke 0.3s ease;
}

.email-wrapper:focus-within .field-icon svg,
.password-wrapper:focus-within .field-icon svg {
  stroke: var(--color-primario);
}


.form-group-checkbox input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-radius: 5px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  flex-shrink: 0;
  outline: none;
}

.form-group-checkbox input[type="checkbox"]:hover {
  border-color: var(--color-primario);
}

.form-group-checkbox input[type="checkbox"]:checked {
  background-color: var(--color-primario);
  border-color: var(--color-primario);
}

.form-group-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.form-group-checkbox input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.25);
}


.form-group input.input-valido {
  border-color: #28a745;
  box-shadow: 0 0 6px rgba(40, 167, 69, 0.2);
}

.form-group input.input-invalido {
  border-color: #dc3545;
  box-shadow: 0 0 6px rgba(220, 53, 69, 0.15);
}


.form-group label {
  transition: color 0.22s ease, transform 0.22s ease;
  transform-origin: left center;
}
.form-group:focus-within > label {
  color: var(--color-primario);
  transform: translateY(-2px) scale(0.97);
}

/* Hover suave antes del foco */
.form-group input[type="email"]:hover,
.form-group input[type="password"]:hover {
  border-color: #e0a0bf;
  background-color: #fffcfe;
}

/* Foco mejorado: glow rosado + tinte de fondo */
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
  box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.13), 0 4px 16px rgba(255, 105, 180, 0.16);
  background-color: #fffafd;
}

/* Línea gradiente animada que aparece en la base del input al hacer foco */
.email-wrapper::after,
.password-wrapper::after {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primario), var(--color-acento), var(--color-primario), transparent);
  border-radius: 2px;
  transition: width 0.35s ease, left 0.35s ease;
  pointer-events: none;
  z-index: 3;
}
.email-wrapper:focus-within::after,
.password-wrapper:focus-within::after {
  width: 100%;
  left: 0;
}

/* Shimmer deslizante en el botón al hacer hover */
.btn-registrar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 55%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transition: left 0.5s ease;
  border-radius: 8px;
  pointer-events: none;
}
.btn-registrar:hover::before {
  left: 150%;
}


.balloon-fly {
  position: fixed;
  bottom: -90px;
  width: 46px;
  height: 60px;
  border-radius: 50% 50% 45% 45% / 45% 45% 60% 60%;
  background: radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.45) 0%, var(--color, #FF69B4) 55%);
  z-index: 9999;
  pointer-events: none;
  animation: balloonFly var(--dur, 3s) ease-in forwards;
  will-change: transform, opacity;
}

/* Nudo del globo */
.balloon-fly::before {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 9px;
  background: var(--color, #FF69B4);
  border-radius: 0 0 50% 50%;
  filter: brightness(0.8);
}

/* Hilo */
.balloon-fly::after {
  content: '';
  position: absolute;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%);
  width: 1.5px;
  height: 28px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.22), transparent);
}

@keyframes balloonFly {
  0% {
    transform: translateX(0) translateY(0) rotate(-8deg);
    opacity: 0;
  }
  6% { opacity: 1; }
  40% {
    transform: translateX(var(--sway, 40px)) translateY(-40vh) rotate(6deg);
  }
  75% {
    transform: translateX(calc(var(--sway, 40px) * -0.4)) translateY(-82vh) rotate(-4deg);
    opacity: 1;
  }
  100% {
    transform: translateX(calc(var(--sway, 40px) * 0.3)) translateY(-115vh) rotate(2deg);
    opacity: 0;
  }
}


.cursor-sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 99998;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c, #FF69B4);
  transform: translate(-50%, -50%) scale(1.2);
  animation: sparkleOut 0.5s ease forwards;
}

@keyframes sparkleOut {
  0%   { opacity: 1;   transform: translate(-50%, -50%) scale(1.4); }
  50%  { opacity: 0.8; transform: translate(-50%, -50%) scale(2);   }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(0.1); }
}

.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: rippleEffect 0.55s ease forwards;
  pointer-events: none;
}

@keyframes rippleEffect {
  to { transform: scale(1); opacity: 0; }
}