* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

body {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  background-color: #8A171C;
  position: relative;
}

/* Contenedor de la imagen - lado izquierdo */
.image-container {
  flex: 1;
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #8A171C;
  overflow: hidden;
  padding: 0;
}

/* Imagen real con object-fit */
.image-container img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* Contenedor del formulario - lado derecho */
.form-container {
  flex: 0 0 35vw;
  min-width: 420px;
  max-width: 550px;
  height: 100vh;
  position: relative;
  background-color: #8A171C;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem;
  overflow-y: auto;
  overflow-x: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Ajuste de separación entre el logo y el formulario */
.form-signin {
  width: 100%;
  max-width: 400px;
  padding: 4.5rem 1.5rem 2.5rem 1.5rem;
  margin-top: 3rem;
  position: relative;
  background: transparent !important;
  color: white !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

/* Logo de la universidad centrado arriba del formulario */
.form-signin::before {
  content: '';
  position: absolute;
  top: -110px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 180px;
  background-image: url('../img/logo-unillanos-horizontal2.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Título */
.form-signin h1 {
  color: white !important;
  font-weight: 400 !important;
  font-size: 1.5rem !important;
  margin-bottom: 2rem !important;
  text-align: left !important;
}

/* Contenedor de form-label-group */
.form-label-group {
  position: relative;
  margin-bottom: 1.2rem;
}

/* Estilos para inputs */
.form-control {
  height: 3.5rem;
  padding: 1rem 0.75rem 0.5rem 0.75rem;
  background-color: rgba(180, 25, 45, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 4px !important;
  color: white !important;
  font-size: 1rem;
  line-height: 1.5;
  transition: all 0.2s ease-in-out;
  width: 100%;
}

.form-control:focus {
  background-color: rgba(180, 25, 45, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
  color: white !important;
  box-shadow: 0 0 0 0.1rem rgba(255, 255, 255, 0.2) !important;
  outline: none;
}

/* Labels - Estilo inicial (placeholder-like) */
.form-label-group > label {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  color: rgba(220, 53, 69, 0.9) !important;
  font-weight: 400;
  font-size: 1rem;
  pointer-events: none;
  transition: all 0.2s ease-in-out;
  background: transparent;
  padding: 0;
  margin: 0;
  z-index: 2;
}

/* Ocultar completamente los placeholders nativos */
.form-control::placeholder {
  color: transparent !important;
  opacity: 0 !important;
}

.form-control::-webkit-input-placeholder,
.form-control::-moz-placeholder,
.form-control:-ms-input-placeholder,
.form-control::-ms-input-placeholder {
  color: transparent !important;
  opacity: 0 !important;
}

/* Ocultar label cuando hay contenido o cuando está enfocado */
.form-control:focus + label,
.form-control:not(:placeholder-shown) + label,
.form-control:valid + label {
  opacity: 0;
  transform: translateY(-50%) scale(0.8);
}

/* Asegurar que el texto ingresado sea blanco */
.form-control:not(:placeholder-shown) {
  color: white !important;
}

/* Botón principal */
.btn-primary {
  background-color: white !important;
  color: #dc3545 !important;
  border: none !important;
  font-weight: 500 !important;
  border-radius: 4px !important;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.2s ease-in-out;
  width: 100%;
}

.btn-primary:hover {
  background-color: rgba(255, 255, 255, 0.95) !important;
  color: #dc3545 !important;
  transform: translateY(-1px);
}

/* Botón secundario con líneas centradas a los lados (líneas detrás del texto) */
.btn-secondary {
  background-color: transparent !important;
  color: white !important;
  border: none !important;
  font-weight: 400 !important;
  font-size: 1rem;
  transition: all 0.2s ease-in-out;
  width: 100%;
  position: relative;
  text-align: center;
  margin: 2rem 0;
  padding: 0.5rem 0;
  z-index: 1; /* crea un nuevo contexto para que el texto quede por encima */
}

.btn-secondary::before,
.btn-secondary::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 20%;        /* longitud de las líneas */
  height: 2px;       /* grosor de las líneas */
  background-color: white;
  opacity: 0.9;
  z-index: -1;       /* las líneas quedan detrás del texto */
}

.btn-secondary::before {
  left: 0;
}

.btn-secondary::after {
  right: 0;
}

.btn-secondary:hover {
  background-color: transparent !important;
  color: #ffffff !important;
  transform: none;
}

.btn-block {
  margin-bottom: 0.8rem;
}

/* Texto del copyright */
.form-signin .text-muted {
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 0.85rem !important;
  text-align: center !important;
  margin-top: 2rem !important;
}

/* Responsive: En pantallas medianas y pequeñas */
@media (max-width: 992px) {
  .form-container {
    flex: 0 0 40vw;
    min-width: 380px;
    max-width: 500px;
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .image-container {
    height: 40vh;
    width: 100vw;
    flex: 0 0 40vh;
    padding: 10px;
  }

  .form-container {
    width: 100vw;
    min-width: 100vw;
    max-width: 100vw;
    height: 60vh;
    flex: 1;
    padding: 1rem;
  }

  .form-signin {
    max-width: 90%;
    padding: 1.5rem;
  }

  .form-signin::before {
    display: none;
  }

  .form-signin h1 {
    font-size: 1.4rem !important;
    margin-bottom: 1.5rem !important;
    text-align: center !important;
  }
}

@media (max-width: 576px) {
  .image-container {
    height: 35vh;
    flex: 0 0 35vh;
    padding: 5px;
  }

  .form-container {
    height: 65vh;
  }

  .form-signin {
    max-width: 95%;
    padding: 1rem;
  }

  .form-signin h1 {
    font-size: 1.3rem !important;
    margin-bottom: 1.2rem !important;
  }

  .form-signin .text-muted {
    font-size: 0.8rem !important;
    margin-top: 1.5rem !important;
  }

  .form-control {
    height: 3.2rem;
    font-size: 0.95rem;
  }

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

/* Fallbacks */
.form-control.has-content + label,
.form-control.input-has-value + label {
  opacity: 0;
}

@supports (-ms-ime-align: auto) {
  .form-label-group > label {
    display: block;
  }
}

@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  .form-label-group > label {
    display: block;
  }
}
