/* Apartado dedicado de Inicio de Sesión 3D Glassmorphism · ARCHI-BOX Control de Maquinaria */
/* Anti-parpadeo al recargar sin sesión: oculta el panel desde el fotograma 0 */
html.auth-boot-login .sidebar,
html.auth-boot-login .main {
  visibility: hidden !important;
}
html.auth-boot-login .login-overlay {
  display: flex !important;
}

.login-overlay {
  position: fixed;
  inset: 0;
  background: #1b2218 url('/login/fondo-atardecer.jpg?v=2') center center / cover no-repeat;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  overflow: hidden;
  transition: opacity 0.35s ease;
}
.login-overlay.login-exiting {
  opacity: 0;
  pointer-events: none;
}
.login-overlay[hidden] {
  display: none !important;
}

.login-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Escenario 3D a pantalla completa */
.login-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.login-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* Capa de cadena metálica conectando el engranaje inferior con la excavadora 3D */
.login-rope-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 4;
}

.login-loader-pill {
  position: absolute;
  left: 24px;
  bottom: 24px;
  z-index: 6;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(10, 17, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fde68a;
  font-size: 0.74rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}
.login-loader-pill[hidden] {
  display: none !important;
}

/* Logo oficial ARCHI-BOX con contorno blanco pegado a la silueta (sin caja blanca) */
.login-hero-logo {
  position: absolute;
  top: 24px;
  left: 30px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  pointer-events: none;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.32));
}
.login-hero-isotipo {
  height: 56px;
  width: auto;
  display: block;
  object-fit: contain;
}
.login-hero-wordmark {
  height: 44px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Pantalla completa de Bienvenida sobre el mismo fondo del atardecer tras arrastrar el cuadro */
.login-welcome-splash {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 45%, rgba(12, 18, 24, 0.36) 0%, rgba(8, 12, 16, 0.62) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.42s ease;
  pointer-events: none;
}
.login-welcome-splash.shown {
  opacity: 1;
}
.login-welcome-splash[hidden] {
  display: none !important;
}
.login-welcome-inner {
  text-align: center;
  color: #ffffff;
  max-width: 780px;
  transform: translateY(14px) scale(0.97);
  transition: transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}
.login-welcome-splash.shown .login-welcome-inner {
  transform: translateY(0) scale(1);
}
.login-welcome-eyebrow {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.32);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #d9f99d;
  margin-bottom: 18px;
}
.login-welcome-title {
  margin: 0;
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: #ffffff;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
.login-welcome-title span {
  color: #a3e635;
}
.login-welcome-role {
  margin: 14px 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.38);
}

/* Recuadro de inicio de sesión FLOTANTE TRANSPARENTE (tal cual referencia Glassmorphism) */
.login-card-anchor {
  position: absolute;
  top: 50%;
  right: min(5.5vw, 76px);
  transform: translateY(-50%);
  width: min(390px, calc(100vw - 36px));
  z-index: 5;
  pointer-events: none;
}

.login-rig-wrap {
  position: relative;
  width: 100%;
  will-change: transform, opacity;
}
.login-rig-wrap.is-pulling {
  animation: none !important;
}
.login-rig-wrap.is-shake {
  animation: loginCardShake 0.38s ease !important;
}

.login-card {
  pointer-events: auto;
  width: 100%;
  background: linear-gradient(165deg, rgba(16, 16, 14, 0.72) 0%, rgba(10, 10, 10, 0.80) 100%);
  backdrop-filter: blur(18px) saturate(118%);
  -webkit-backdrop-filter: blur(18px) saturate(118%);
  border: 1.5px solid rgba(255, 203, 17, 0.50);
  border-radius: 24px;
  padding: 40px 34px 36px;
  box-shadow:
    0 30px 68px rgba(0, 0, 0, 0.56),
    inset 0 1px 0 rgba(255, 203, 17, 0.22);
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #ffffff;
}

@keyframes loginFloatIdle {
  0%, 100% { transform: translate3d(0, 0px, 0); }
  50%      { transform: translate3d(0, -6px, 0); }
}

@keyframes loginCardShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  20%      { transform: translate3d(-8px, 0, 0); }
  45%      { transform: translate3d(7px, 0, 0); }
  70%      { transform: translate3d(-5px, 0, 0); }
}

.login-card h2 {
  margin: 0;
  text-align: center;
  font-size: 2.05rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
}
.login-card .sub {
  margin: -8px 0 10px;
  text-align: center;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.4;
}

/* Inputs transparentes con ícono sólido a la izquierda (usuario / candado) */
.login-field {
  position: relative;
  display: flex;
  align-items: center;
}
.login-field-icon-left {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: rgba(255, 255, 255, 0.88);
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.login-field input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 46px;
  border: 1.3px solid rgba(255, 255, 255, 0.34);
  border-radius: 12px;
  font-size: 0.94rem;
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.login-field input::placeholder {
  color: rgba(218, 218, 212, 0.78);
}
.login-field input:focus {
  outline: none;
  border-color: #ffcb11;
  background: rgba(13, 13, 13, 0.48);
  box-shadow: 0 0 0 3px rgba(255, 203, 17, 0.24);
}
.login-eye-btn {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #ffcb11;
  cursor: pointer;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}
.login-eye-btn:hover {
  color: #ffe066;
  background: rgba(255, 203, 17, 0.14);
}

/* Checkbox Recordar mi sesión en amarillo maquinaria (#FFCB11) */
.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 4px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.90);
  cursor: pointer;
  user-select: none;
  width: fit-content;
}
.login-remember input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.login-remember-box {
  width: 19px;
  height: 19px;
  border-radius: 5px;
  border: 1.4px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.10);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease, border-color 0.16s ease;
  position: relative;
}
.login-remember input:checked + .login-remember-box {
  background: #ffcb11;
  border-color: #ffcb11;
}
.login-remember input:checked + .login-remember-box::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid #0d0d0d;
  border-width: 0 2.4px 2.4px 0;
  transform: rotate(42deg) translate(-0.5px, -1px);
}

/* Botón principal amarillo maquinaria (#FFCB11) con texto negro igual al aplicativo */
.login-submit-glass {
  width: 100%;
  height: 50px;
  margin-top: 2px;
  border: 0;
  border-radius: 13px;
  background: #ffcb11;
  color: #0d0d0d;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 12px 26px rgba(255, 203, 17, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}
.login-submit-glass:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(255, 203, 17, 0.38);
}
.login-submit-glass:disabled {
  opacity: 0.78;
  cursor: wait;
}

/* Descarga del aplicativo Android: solo visible en celulares y tablets. */
.login-apk-box {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 6px;
}
.login-apk-box[hidden] {
  display: none;
}
.login-apk-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}
.login-apk-divider::before,
.login-apk-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.28);
}
.login-apk-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 50px;
  border-radius: 13px;
  border: 1.5px solid rgba(255, 203, 17, 0.85);
  background: rgba(13, 13, 13, 0.38);
  color: #ffcb11;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.16s ease, transform 0.16s ease;
}
.login-apk-btn:hover,
.login-apk-btn:active {
  background: rgba(255, 203, 17, 0.16);
  transform: translateY(-1px);
}
.login-apk-btn[aria-disabled='true'] {
  opacity: 0.55;
  pointer-events: none;
}
.login-apk-hint {
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.78);
}

.login-error {
  background: rgba(220, 38, 38, 0.32);
  border: 1px solid rgba(252, 165, 165, 0.65);
  color: #fff1f2;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 600;
  text-align: center;
}

.login-footer-brand {
  margin-top: 4px;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.86);
}
.login-footer-brand strong {
  color: #9ce16b;
  font-weight: 700;
}

/* Engranaje gigante de acero forjado hiperrealista sobresaliendo por todo el costado izquierdo */
.login-gear-anchor {
  position: absolute;
  left: -135px;
  top: 50%;
  transform: translateY(-50%);
  width: 396px;
  height: 396px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(-8px 14px 20px rgba(0, 0, 0, 0.62));
}
.login-gear-svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center;
}
.login-rig-wrap.is-pulling .login-gear-svg {
  animation: loginGearSpin 1.4s linear infinite;
}
.login-chain-origin {
  position: absolute;
  left: -102px;
  top: 63%;
  width: 10px;
  height: 10px;
  pointer-events: none;
  z-index: 3;
}
@keyframes loginGearSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}

@media (max-width: 860px) {
  .login-overlay {
    overflow-y: auto;
    align-items: flex-start;
  }
  .login-shell {
    height: auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 14px 44px;
    gap: 14px;
  }
  .login-stage {
    position: relative;
    width: 100%;
    height: 36vh;
    min-height: 230px;
    border-radius: 16px;
  }
  .login-rope-canvas {
    display: none;
  }
  .login-card-anchor {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    width: 100%;
    max-width: 400px;
  }
  .login-card {
    animation: none;
    padding: 30px 24px 36px;
  }
}
