/* ==========================================================================
   HCY GROUP · ACCESO A LA CENTRAL · AJUSTE FINAL
   La tarjeta completa, sin ninguna caja: fondo, borde, sombra y desenfoque
   en none. Sólo letras blancas sobre el espacio, con líneas finas de apoyo.
   El botón de la barra y la casilla de Recordarme siguen la misma regla:
   texto y trazo, nunca relleno. El fondo, la posición y el contrato de
   ERPNext quedan como estaban.
   ========================================================================== */

:root {
  /* ---- Color ---- */
  --noche: #03050a;
  --blanco: #ffffff;

  --tinta-marca: rgba(255, 255, 255, 0.88);
  --tinta-boton-chico: rgba(255, 255, 255, 0.92);
  --tinta-pie: rgba(255, 255, 255, 0.62);

  /* ---- La tarjeta: nada de cajas ---- */
  --tinta-etiqueta: rgba(255, 255, 255, 0.72);
  --tinta-suave: rgba(255, 255, 255, 0.80);
  --tinta-placeholder: rgba(255, 255, 255, 0.45);
  --tinta-ojo: rgba(255, 255, 255, 0.85);
  --linea-campo: rgba(255, 255, 255, 0.35);
  --linea-campo-foco: #ffffff;
  --linea-boton: rgba(255, 255, 255, 0.45);
  --linea-separadora: rgba(255, 255, 255, 0.18);
  --error-texto: #f5b3a1;
  --sombra-texto: 0 1px 3px rgba(0, 0, 0, 0.65);

  /* ---- El resto de la pantalla (sin cambios) ---- */
  --halo-cobre: 0 0 0 1px rgba(217, 138, 90, 0.7);

  /* ---- Medidas ---- */
  --alto-campo: 40px;
  --alto-boton: 44px;
  --alto-boton-chico: 34px;
  --ancho-tarjeta: 320px;
  --margen: 40px;
  --esp-8: 8px;
  --esp-12: 12px;
  --esp-16: 16px;
  --esp-24: 24px;

  /* ---- Tipografía ---- */
  --fuente: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;

  --transicion: 160ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

[hidden] {
  display: none !important;
}

.hcy-acceso .hide {
  display: none !important;
}

html {
  color-scheme: dark;
  background: var(--noche);
  -webkit-text-size-adjust: 100%;
}

body.hcy-acceso {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--noche);
  color: var(--blanco);
  font-family: var(--fuente);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

body.hcy-acceso ::selection {
  background: rgba(217, 138, 90, 0.32);
  color: var(--blanco);
}

body.hcy-acceso :is(a, button, input):focus-visible {
  outline: none;
}

/* Sólo para lectores de pantalla. */
.oculto {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Salto de accesibilidad ---------- */

.saltar {
  position: fixed;
  top: var(--esp-16);
  left: var(--esp-16);
  z-index: 30;
  padding: var(--esp-8) var(--esp-12);
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--noche);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transform: translateY(calc(-100% - var(--esp-24)));
  transition: transform var(--transicion);
}

.saltar:focus {
  transform: translateY(0);
  outline: none;
  box-shadow: var(--halo-cobre);
}

/* ---------- El fondo: toda la pantalla, sin velo ---------- */

.fondo {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: var(--noche);
  background-image: url('fondo-login.png');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  pointer-events: none;
}

.fondo__video {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

/* ---------- Abajo a la izquierda: tarjeta, botón y pie ---------- */

.acceso {
  position: fixed;
  left: var(--margen);
  bottom: var(--margen);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--esp-12);
  max-width: calc(100vw - var(--margen) - var(--esp-16));
  margin: 0;
}

/* ---------- La tarjeta: transparente, sin caja ---------- */

.panel {
  display: flex;
  flex-direction: column;
  gap: var(--esp-16);
  width: min(var(--ancho-tarjeta), calc(100vw - var(--margen) - var(--esp-16)));
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  text-shadow: var(--sombra-texto);
}

.panel:not([hidden]) {
  animation: panel-aparece 180ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

@keyframes panel-aparece {
  from {
    opacity: 0;
    transform: translateY(var(--esp-8));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel__titulo {
  margin: 0;
  color: var(--blanco);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: normal;
  text-shadow: var(--sombra-texto);
}

.form-signin {
  display: flex;
  flex-direction: column;
  gap: var(--esp-16);
  min-width: 0;
  margin: 0;
}

/* ---------- Campos: línea al pie, nunca recuadro ---------- */

.campo {
  display: flex;
  flex-direction: column;
  gap: var(--esp-8);
  min-width: 0;
}

.campo label {
  display: block;
  margin: 0;
  color: var(--tinta-etiqueta);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.25;
  text-transform: uppercase;
  text-shadow: var(--sombra-texto);
}

.campo__caja {
  position: relative;
  min-width: 0;
}

.campo__caja input {
  display: block;
  width: 100%;
  height: var(--alto-campo);
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--linea-campo);
  border-radius: 0;
  background: none;
  color: var(--blanco);
  caret-color: var(--blanco);
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
  outline: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  text-shadow: var(--sombra-texto);
  transition: border-color var(--transicion), border-width var(--transicion);
}

.campo__caja input::placeholder {
  color: var(--tinta-placeholder);
  opacity: 1;
  text-shadow: var(--sombra-texto);
}

/* Sólo cambia la línea de abajo: 1 px al 35 % y 1,5 px blanca al enfocar. */
.campo__caja input:focus,
.campo__caja input:focus-visible {
  outline: none;
  border-bottom: 1.5px solid var(--linea-campo-foco);
  box-shadow: none;
}

.campo__caja input:-webkit-autofill,
.campo__caja input:-webkit-autofill:hover,
.campo__caja input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--blanco);
  caret-color: var(--blanco);
  transition: background-color 9999s ease-out 0s;
}

#login_password {
  padding-right: 36px;
}

/* ---------- Ojo de la contraseña: trazo blanco, sin fondo ---------- */

.ojo {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: var(--alto-campo);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--tinta-ojo);
  cursor: pointer;
  outline: none;
  text-shadow: none;
  transition: color var(--transicion), filter var(--transicion);
}

.ojo:hover {
  color: var(--blanco);
}

.ojo:focus-visible {
  outline: none;
  color: var(--blanco);
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.85));
}

.ojo svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ojo__cerrado {
  display: none;
}

.ojo[aria-pressed="true"] .ojo__abierto {
  display: none;
}

.ojo[aria-pressed="true"] .ojo__cerrado {
  display: block;
}

/* ---------- Fila: Recordarme a la izquierda, recuperación a la derecha ---------- */

.fila {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--esp-8) var(--esp-12);
  min-width: 0;
  margin: 0;
}

.recordar {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--esp-8);
  color: var(--blanco);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  text-shadow: var(--sombra-texto);
  white-space: nowrap;
  cursor: pointer;
}

.recordar input {
  position: absolute;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  margin: 0;
  border: 0;
  background: none;
  opacity: 0;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
}

.recordar__caja {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 2px;
  background: none;
  transition: border-color var(--transicion);
}

/* El tilde es sólo trazo: 1,5 px blancos, sin relleno. */
.recordar__caja svg {
  display: block;
  width: 10px;
  height: 10px;
  fill: none;
  stroke: var(--blanco);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 120ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.recordar input:checked + .recordar__caja svg {
  opacity: 1;
}

.recordar input:focus-visible + .recordar__caja {
  outline: 1px solid var(--blanco);
  outline-offset: 2px;
}

.recordar__texto {
  text-shadow: var(--sombra-texto);
}

.olvido {
  color: var(--tinta-suave);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  text-decoration: none;
  text-shadow: var(--sombra-texto);
  white-space: nowrap;
  transition: color var(--transicion);
}

.olvido:hover {
  color: var(--blanco);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.olvido:focus-visible {
  outline: none;
  color: var(--blanco);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* ---------- Entrar: texto y una línea, nada más ---------- */

.btn-login {
  width: 100%;
  height: var(--alto-boton);
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--linea-boton);
  border-radius: 0;
  background: none;
  color: var(--blanco);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-shadow: var(--sombra-texto);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transicion), border-width var(--transicion);
}

.btn-login:hover {
  border-bottom-color: var(--blanco);
}

.btn-login:focus-visible {
  outline: none;
  border-bottom: 1.5px solid var(--blanco);
}

/* ---------- Separadora ---------- */

.separador {
  width: 100%;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--linea-separadora);
}

/* ---------- Alta y error: sólo texto ---------- */

.alta {
  margin: 0;
  color: var(--tinta-suave);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-shadow: var(--sombra-texto);
}

.alta a {
  color: var(--blanco);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: var(--blanco);
  transition: text-decoration-thickness var(--transicion);
}

.alta a:hover,
.alta a:focus-visible {
  outline: none;
  text-decoration-thickness: 2px;
}

.alta a:focus-visible {
  text-decoration-thickness: 2px;
}

.error {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--error-texto);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-shadow: var(--sombra-texto);
}

/* ---------- Central HCY · botón chiquito · pie (sin cambios) ---------- */

/* Detrás de todo el bloque de abajo, un degradado que nace del borde
   inferior de la pantalla. Sin borde y sin caja: sólo una sombra natural
   para que el pie se lea sobre las estrellas. */
body.hcy-acceso::after {
  content: "";
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  height: 150px;
  background: linear-gradient(
    to top,
    rgba(2, 4, 9, 0.72) 0%,
    rgba(2, 4, 9, 0.35) 55%,
    transparent 100%
  );
  pointer-events: none;
}

.barra {
  display: flex;
  flex-direction: column;
  gap: var(--esp-12);
  max-width: 100%;
}

.barra__fila {
  display: flex;
  align-items: center;
  gap: var(--esp-12);
}

.barra__marca {
  color: var(--tinta-marca);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.abrir {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--alto-boton-chico);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--tinta-boton-chico);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  outline: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  text-shadow: var(--sombra-texto);
  transition: color var(--transicion);
}

.abrir:hover,
.abrir:focus-visible {
  outline: none;
  color: var(--blanco);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.barra__pie {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--esp-8);
  margin: 0;
  color: var(--tinta-pie);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.barra__pie a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.barra__pie a:focus-visible {
  outline: none;
  color: var(--blanco);
  box-shadow: var(--halo-cobre);
  border-radius: 2px;
}

.barra__punto {
  color: inherit;
}

/* ---------- Pantallas muy bajas: la tarjeta se desplaza sin salir de cuadro ---------- */

@media (max-height: 560px) {
  .acceso {
    left: var(--esp-16);
    bottom: var(--esp-16);
    gap: var(--esp-8);
    max-width: calc(100vw - var(--esp-16) - var(--esp-16));
  }

  .panel {
    gap: var(--esp-8);
    max-height: calc(100svh - 104px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .panel::-webkit-scrollbar {
    display: none;
  }

  .form-signin {
    gap: var(--esp-8);
  }
}

/* ---------- Sin movimiento: fondo quieto y sin animaciones ---------- */

@media (prefers-reduced-motion: reduce) {
  .fondo__video {
    display: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
