/* views/css/registro.css */
:root {
  --teal: #008080;
  --aquamarine: #7FFFD4;
  --bright-teal: #01F9C6;
  --cadet-blue: #5F9EA0;
  --caribbean-green: #00CC99;
  --common-teal: #009193;
}

/* animación de fondo RGB */
@keyframes bgRGB {
  0%   { background-color: var(--teal); }
  20%  { background-color: var(--aquamarine); }
  40%  { background-color: var(--bright-teal); }
  60%  { background-color: var(--cadet-blue); }
  80%  { background-color: var(--caribbean-green); }
  100% { background-color: var(--common-teal); }
}

/* centrar todo y animar fondo */
html, body {
  width: 100%;
  height: 100%;
  margin: 0; padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: bgRGB 15s ease-in-out infinite alternate;
  font-family: Arial, sans-serif;
}

/* recuadro blanco con sombra negra */
.auth-container {
  display: flex;
  width: 85vw;
  height: 85vh;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 8px 30px rgba(0,0,0,0.3),
    0 0 60px rgba(0,0,0,0.2);
}

.pane {
  position: relative;
  overflow: hidden;
  height: 100%;
}

/* formulario a la izquierda (35%) */
.form-pane {
  flex: 1;
  padding: 2rem 2rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.15);
}

/* carrusel a la derecha (65%) */
.carousel-pane {
  flex: 0 0 65%;
}

.form-pane h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.6rem;
}
.form-pane form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.form-pane input {
  width: 100%;
  max-width: 320px;
  padding: .8rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

/* Checkbox alineado a la izquierda con texto pegado */
.form-pane .tos {
  width: 100%;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 0; /* Elimina el espacio entre el checkbox y el texto */
  margin: 0;
  padding: 0; /* Elimina cualquier padding adicional */
  justify-content: flex-start; /* Alinea el contenido a la izquierda */
  margin-left: -160px;
}

.form-pane .tos input[type="checkbox"] {
  margin: 0; /* Elimina cualquier margen del checkbox */
  padding: 0; /* Elimina cualquier padding del checkbox */
}

.form-pane .tos label {
  margin: 0; /* Elimina cualquier margen del texto */
  padding: 0; /* Elimina cualquier padding del texto */
  line-height: 1; /* Asegura que el texto esté alineado verticalmente con el checkbox */
}

.form-pane .btn-signup {
  width: 100%;
  max-width: 320px;
  padding: .8rem;
  background: #222;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

.form-pane .links {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}
.form-pane .links .switch {
  color: #007bff;
  text-decoration: underline;
}
.form-pane .links .back {
  padding: .5rem 1rem;
  border: 1px solid #555;
  border-radius: 6px;
  color: #555;
  text-decoration: none;
}

/* carrusel intacto */
.carousel-pane .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .8s ease;
}
.carousel-pane .slide.is-active {
  opacity: 1;
}
.carousel-pane .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* MODIFICACIÓN: Media queries para ocultar el carrusel en dispositivos móviles */
@media (max-width: 576px) {
  html, body {
    overflow: auto;
  }
  
  .auth-container {
    width: 100vw;
    height: 100vh;
    flex-direction: column-reverse; /* Carrusel arriba, formulario abajo */
    border-radius: 0;
  }
  
  /* Ocultar carrusel en móviles muy pequeños */
  .carousel-pane {
    display: none;
  }
  
  /* Formulario ocupa todo el espacio */
  .form-pane {
    flex: 1;
    padding: 1.5rem;
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
  }
  
  /* Ajustar tamaño de campos para mejor usabilidad */
  .form-pane input,
  .form-pane .btn-signup {
    max-width: 100%;
    width: 100%;
  }
  
  /* Corregir alineación del checkbox y texto */
  .form-pane .tos {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    gap: 0.5rem;
  }
}

/* Medium devices (teléfonos landscape y tablets, 577px hasta 768px) */
@media (min-width: 577px) and (max-width: 768px) {
  .auth-container {
    width: 95vw;
    height: 95vh;
    flex-direction: column-reverse; /* Carrusel arriba, formulario abajo */
  }
  
  /* Reducir carrusel en tablets */
  .carousel-pane {
    flex: 0 0 40%;
    max-height: 40%;
  }
  
  /* Ajustar área del formulario */
  .form-pane {
    flex: 1;
    padding: 1.5rem;
  }
  
  /* Corregir alineación del checkbox y texto */
  .form-pane .tos {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    justify-content: center;
    gap: 0.5rem;
  }
  
  /* Centrar los enlaces */
  .form-pane .links {
    margin-top: 0.5rem;
  }
  
  /* Alinear y dimensionar elementos del formulario */
  .form-pane input,
  .form-pane .btn-signup {
    max-width: 80%;
    width: 80%;
  }
}

/* Large devices (tablets landscape y desktop pequeños, 769px hasta 992px) */
@media (min-width: 769px) and (max-width: 992px) {
  .auth-container {
    width: 90vw;
    height: 90vh;
  }
  
  /* Ajustar proporción del carrusel vs formulario */
  .carousel-pane {
    flex: 0 0 55%;
  }
  
  .form-pane {
    flex: 0 0 45%;
    padding: 1.5rem;
  }
  
  /* Corregir alineación del checkbox y texto */
  .form-pane .tos {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    justify-content: center;
    gap: 0.5rem;
  }
}

/* Orientation specific adjustments para dispositivos que cambian de orientación */
@media (orientation: portrait) and (max-width: 992px) {
  /* En orientación retrato priorizar el formulario y reducir carrusel */
  .auth-container {
    flex-direction: column-reverse; /* Carrusel arriba, formulario abajo */
  }
  
  .carousel-pane {
    flex: 0 0 35%;
    max-height: 35%;
  }
  
  .form-pane {
    flex: 1;
  }
}

/* Mejorar visibilidad de campos de formulario en dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
  .form-pane input,
  .form-pane .btn-signup {
    padding: 1rem 0.8rem;
    font-size: 1.1rem;
  }
  
  /* Aumentar tamaño de checkboxes para mejor experiencia táctil */
  .form-pane input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }
}

/* Ajustes para pantallas muy pequeñas (teléfonos antiguos) */
@media (max-width: 320px) {
  .form-pane h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }
  
  .form-pane input {
    padding: 0.6rem;
    font-size: 0.9rem;
  }
  
  .form-pane .links .switch {
    font-size: 0.85rem;
  }
}

/* Asegurarse de que los mensajes de error sean legibles en todos los dispositivos */
.errores ul {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.errores li {
  color: #d32f2f;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

/* Ajuste general para pantallas altas y estrechas (modo landscape en móviles) */
@media (max-height: 500px) and (orientation: landscape) {
  .auth-container {
    height: auto;
    min-height: 100vh;
  }
  
  .form-pane {
    padding: 1rem;
    overflow-y: auto;
  }
  
  .form-pane h2 {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
  }
  
  .form-pane form {
    gap: 0.7rem;
  }
}