@charset "UTF-8";

:root {
  --login-primary: #056dae;
  --login-primary-hover: #045a8f;
  --login-text: #212529;
  --login-muted: #6c757d;
  --login-border: #d0d5dd;
  --login-surface: #fff;
  --login-card-height: 590px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--login-text);
  background: #f4f6f8;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Contenedor compartido por Login y Recuperar contraseña. */
.login-page {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

/* En móviles solo se muestra el formulario. */
.login-card {
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  background: var(--login-surface);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

.login-hero {
  display: none;
}

.login-content {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  background: var(--login-surface);
}

/* Logo: mismo espacio en las dos vistas. */
.title-logo-container {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.65rem 1.25rem 0.25rem;
}

.logo-login {
  display: block;
  width: 170px;
  max-width: 75%;
  height: 42px;
  object-fit: contain;
}

/* Encabezado estable aunque el mensaje esté vacío. */
.login-header {
  min-height: 0;
  padding: 0.35rem 1rem 0.5rem;
  text-align: center;
  border-bottom: 1px solid #eef1f4;
}

.title-container {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.texto-secundario {
  display: block;
  min-height: 1.1rem;
  margin: 0.2rem 0;
  color: var(--login-muted);
  font-size: 0.875rem;
  line-height: 1.25;
}

/* Reserva siempre el mismo espacio para evitar que la tarjeta cambie de alto. */
.zona-estado-formulario {
  position: relative;
  display: flex;
  width: 100%;
  height: 88px;
  align-items: center;
  justify-content: center;
}

.zona-estado-formulario > .mensaje-recuperacion,
.zona-estado-formulario > .mensaje-login {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  margin: 0 auto;
}

.zona-estado-formulario > .contador-bloqueo {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
}

/* Mensajes de los formularios de acceso y recuperación. */
.mensaje-recuperacion,
.mensaje-login {
  display: flex;
  width: min(100%, 360px);
  align-items: center;
  gap: 0.45rem;
  margin: 0.65rem auto 0;
  padding: 0.5rem 0.6rem;
  color: #344054;
  background: #f8fafc;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  font-size: 0.8125rem;
  line-height: 1.25;
  text-align: left;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.mensaje-recuperacion[hidden],
.mensaje-login[hidden] {
  display: none;
}

.mensaje-recuperacion::before,
.mensaje-login::before {
  display: inline-grid;
  flex: 0 0 1.1rem;
  width: 1.1rem;
  height: 1.1rem;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  content: "i";
}

.mensaje-recuperacion--visible,
.mensaje-login--visible {
  opacity: 1;
  transform: translateY(0);
}

.bienvenida-recuperacion,
.bienvenida-login {
  margin: 0.2rem 0;
  color: var(--login-muted);
  text-align: center;
}

.mensaje-recuperacion--exito,
.mensaje-login--exito {
  color: #166534;
  background: #f0fdf4;
  border-color: #86efac;
}

.mensaje-recuperacion--exito::before,
.mensaje-login--exito::before {
  content: "\2713";
}

.mensaje-recuperacion--error,
.mensaje-login--error {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fca5a5;
}

.mensaje-recuperacion--error::before,
.mensaje-login--error::before {
  content: "!";
}

.mensaje-recuperacion--info,
.mensaje-login--info {
  color: #075985;
  background: #f0f9ff;
  border-color: #7dd3fc;
}

.login-body {
  display: flex;
  width: 100%;
  justify-content: center;
  padding: 1rem;
}

.loginForm {
  width: 100%;
  max-width: 320px;
}

.inputFlotante {
  position: relative;
  width: 100%;
  margin-bottom: 0.9rem;
}

.inputFlotante input {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0.85rem 0.75rem 0.85rem 2.5rem;
  color: #333;
  background: var(--login-surface);
  border: 1px solid #adb5bd;
  border-radius: 6px;
  font: inherit;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.inputFlotante label {
  position: absolute;
  top: 50%;
  left: 2.5rem;
  z-index: 1;
  padding: 0 0.25rem;
  color: var(--login-muted);
  background: var(--login-surface);
  transform: translateY(-50%);
  pointer-events: none;
  transition:
    top 0.2s ease,
    left 0.2s ease,
    font-size 0.2s ease,
    color 0.2s ease;
}

.inputFlotante input:focus + label,
.inputFlotante input:not(:placeholder-shown) + label {
  top: 0;
  left: 2.25rem;
  color: var(--login-primary);
  font-size: 0.75rem;
}

.inputFlotante input:focus {
  border-color: var(--login-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(5, 109, 174, 0.18);
}

.inputFlotante input.is-invalid {
  border-color: rgba(220, 53, 69, 0.75);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

.input-icon {
  position: absolute;
  top: 25px;
  left: 0.75rem;
  width: 1.25rem;
  height: 1.5rem;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Reserva espacio desde el primer render y evita el salto de reCAPTCHA. */
.captcha-container {
  display: flex;
  width: 100%;
  min-height: 78px;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: 1rem;
  overflow: hidden;
}

.g-recaptcha {
  width: 304px;
  min-width: 304px;
  min-height: 78px;
  transform-origin: top center;
}

.g-recaptcha > div,
.g-recaptcha iframe {
  min-height: 78px;
}

/* Compatibilidad si alguna vista todavía utiliza CAPTCHA local. */
.captchaKey {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 2px;
}

.boton {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 1rem;
  color: #fff;
  background: var(--login-primary);
  border: 1px solid var(--login-primary);
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.boton:hover:not(:disabled) {
  background: var(--login-primary-hover);
  border-color: var(--login-primary-hover);
}

.boton:disabled {
  color: #667085;
  background: #e0e0e0;
  border-color: var(--login-border);
  cursor: not-allowed;
  opacity: 0.85;
}

.texto-boton-centrado {
  margin-top: 0.75rem;
  text-align: center;
}

.login-page a {
  color: var(--login-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-page a:hover {
  color: #004b78;
  text-decoration: underline;
}

.boton:focus-visible,
.login-page a:focus-visible {
  outline: 3px solid rgba(5, 109, 174, 0.3);
  outline-offset: 2px;
}

.login-footer {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  text-align: center;
  border-top: 1px solid #eef1f4;
}

/* Móvil: Google renderiza el widget compacto real (164 × 144 px). */
@media (max-width: 480px) {
  .login-page {
    padding: 0.5rem;
  }

  .login-body {
    padding-inline: 0.75rem;
  }

  .captcha-container {
    display: flex;
    min-height: 78px;
    justify-content: center;
    overflow: visible;
  }

  .captcha-container > .g-recaptcha {
    width: max-content !important;
    min-width: 0 !important;
    max-width: none;
    min-height: 78px;
    margin: 0 auto !important;
    transform: none !important;
  }

  .captcha-container > .g-recaptcha > div,
  .captcha-container > .g-recaptcha iframe {
    margin: 0 auto !important;
  }

  .zona-estado-formulario {
    height: 112px;
  }
}

/* En móviles con poca altura permite desplazamiento sin cortar contenido. */
@media (max-width: 991.98px) and (max-height: 700px) {
  .login-page {
    align-items: flex-start;
  }

  .title-logo-container {
    min-height: 60px;
    padding-top: 0.5rem;
  }

  .logo-login {
    height: 38px;
  }

  .login-header {
    min-height: 0;
    padding-block: 0.25rem 0.4rem;
  }
}

/* Escritorio: imagen y formulario ocupan columnas y alturas iguales. */
@media (min-width: 992px) {
  .login-page {
    padding: 2rem;
  }

  .login-card {
    display: grid;
    width: min(900px, 100%);
    max-width: 900px;
    min-height: var(--login-card-height);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
  }

  .login-hero {
    display: block;
    min-height: var(--login-card-height);
    overflow: hidden;
    background: #eef1f4;
  }

  .login-hero img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: var(--login-card-height);
    object-fit: cover;
    object-position: center;
  }

  .login-content {
    min-height: var(--login-card-height);
  }

  .title-logo-container {
    min-height: 75px;
  }

  .login-body {
    flex: 1;
    padding: 1rem 2rem;
  }

  .login-footer {
    min-height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-page *,
  .login-page *::before,
  .login-page *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
i.input-icon {
  width: 1.25rem;
  height: auto;
  font-size: 1.15rem;
  line-height: 1;
  color: #657487;
}
