/* /assets/css/login_styles.css */

:root {
  --airco-primary: #0b5e7e;
  --airco-primary-dark: #073d58;
  --airco-cyan: #38d7ff;
  --airco-glass: rgba(236, 247, 255, 0.22);
  --airco-glass-strong: rgba(255, 255, 255, 0.38);
  --airco-border: rgba(255, 255, 255, 0.36);
  --airco-text: #0f172a;
  --airco-muted: #42566f;
  --airco-shadow: rgba(2, 8, 23, 0.28);

  /* 4 imágenes x 10s = 40s de ciclo completo. */
  --airco-bg-cycle: 40s;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--airco-text);
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #06192f;
  overflow-x: hidden;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  content: '';
  pointer-events: none;
  z-index: 1;
}

body::before {
  background:
    radial-gradient(circle at 20% 20%, rgba(98, 211, 255, 0.16), transparent 28%),
    radial-gradient(circle at 82% 82%, rgba(131, 84, 255, 0.16), transparent 32%),
    linear-gradient(90deg, rgba(2, 8, 23, 0.24), rgba(2, 8, 23, 0.05) 52%, rgba(2, 8, 23, 0.34));
}

body::after {
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.26;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}

.login-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 56px);
}

.airco-login-background,
.airco-login-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.airco-login-background {
  z-index: 0;
  background-color: #06192f;
  background-image: url('/assets/img/login/airco_login_bg_01_cext_lab.png');
  background-position: center;
  background-size: cover;
}

.airco-login-bg {
  background-position: center;
  background-size: cover;
  opacity: 0;
  transform: scale(1.04);
  filter: brightness(0.76) saturate(1.04);
  animation: aircoBgCrossfade var(--airco-bg-cycle) ease-in-out infinite;
  will-change: opacity, transform, filter;
}

.airco-login-bg--01 {
  background-image: url('/assets/img/login/airco_login_bg_01_cext_lab.png');
  animation-delay: 0s;
}

.airco-login-bg--02 {
  background-image: url('/assets/img/login/airco_login_bg_02_flujo_laminar.png');
  animation-delay: 10s;
}

.airco-login-bg--03 {
  background-image: url('/assets/img/login/airco_login_bg_03_ventilacion_filtros.png');
  animation-delay: 20s;
}

.airco-login-bg--04 {
  background-image: url('/assets/img/login/airco_login_bg_04_laboratorio_corporativo.png');
  animation-delay: 30s;
}

@keyframes aircoBgCrossfade {
  0% {
    opacity: 0;
    transform: scale(1.045);
    filter: brightness(0.72) saturate(1.02);
  }

  10% {
    opacity: 1;
    transform: scale(1.026);
    filter: brightness(1.04) saturate(1.08);
  }

  26% {
    opacity: 1;
    transform: scale(1.008);
    filter: brightness(0.98) saturate(1.06);
  }

  42% {
    opacity: 0;
    transform: scale(1.028);
    filter: brightness(0.76) saturate(1.02);
  }

  100% {
    opacity: 0;
    transform: scale(1.045);
    filter: brightness(0.72) saturate(1.02);
  }
}

.contenedor-login {
  position: relative;
  z-index: 3;
  width: min(100%, 430px);
  padding: clamp(28px, 4vw, 42px);
  text-align: center;
  color: var(--airco-text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(218, 239, 249, 0.20)),
    rgba(255, 255, 255, 0.12);
  border: 1px solid var(--airco-border);
  border-radius: 28px;
  box-shadow:
    0 28px 70px var(--airco-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 0 0 1px rgba(56, 215, 255, 0.06);
  backdrop-filter: blur(22px) saturate(1.22);
  -webkit-backdrop-filter: blur(22px) saturate(1.22);
  overflow: hidden;
}

.contenedor-login::before {
  position: absolute;
  inset: 0;
  content: '';
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.28), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 46%);
  opacity: 0.52;
}

.contenedor-login > * {
  position: relative;
  z-index: 1;
}

.logo-login {
  display: block;
  width: 138px;
  height: auto;
  margin: 0 auto 18px;
  filter: drop-shadow(0 12px 24px rgba(2, 8, 23, 0.28));
}

h1 {
  margin: 0 0 8px;
  color: #082f49;
  font-size: clamp(1.55rem, 2.8vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.subtitulo {
  margin: 0 0 28px;
  color: var(--airco-muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

form {
  width: 100%;
}

.login-field {
  display: block;
  margin: 0 0 16px;
  text-align: left;
}

.login-label {
  display: inline-block;
  margin: 0 0 7px 4px;
  color: #173b51;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.login-label::before {
  content: '*';
  margin-right: 4px;
  color: #b42318;
}

.input-wrap {
  position: relative;
  display: block;
}

.input-icon,
.password-toggle {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  color: rgba(7, 61, 88, 0.74);
}

.input-icon {
  left: 18px;
  pointer-events: none;
}

.input-icon svg,
.password-toggle svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 14px 52px;
  color: #0f172a;
  font-size: 1rem;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 0;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 10px 24px rgba(2, 8, 23, 0.08);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: rgba(30, 41, 59, 0.55);
}

input[type="text"]:focus,
input[type="password"]:focus {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(56, 215, 255, 0.75);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 3px rgba(56, 215, 255, 0.17),
    0 14px 28px rgba(2, 8, 23, 0.12);
}

.password-toggle {
  right: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  opacity: 0.72;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.password-toggle:hover,
.password-toggle:focus-visible,
.password-toggle.is-visible {
  color: var(--airco-primary);
  opacity: 1;
}

.password-toggle:focus-visible {
  outline: 2px solid rgba(56, 215, 255, 0.64);
  outline-offset: 4px;
}

button[type="submit"] {
  width: 100%;
  min-height: 58px;
  margin-top: 8px;
  padding: 15px 18px;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #020617, #0b5e7e 48%, #073d58);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(2, 8, 23, 0.28), 0 0 22px rgba(56, 215, 255, 0.12);
  transition: transform 0.16s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button[type="submit"]:hover {
  filter: brightness(1.08);
  box-shadow: 0 18px 34px rgba(2, 8, 23, 0.34), 0 0 26px rgba(56, 215, 255, 0.18);
}

button[type="submit"]:active {
  transform: translateY(1px) scale(0.992);
}

.nota {
  margin: 22px 0 0;
  padding-top: 15px;
  color: rgba(43, 65, 86, 0.78);
  font-size: 0.78rem;
  line-height: 1.45;
  border-top: 1px solid rgba(255, 255, 255, 0.36);
}

.login-copyright {
  margin: 10px 0 0;
  color: rgba(15, 39, 58, 0.75);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.error-mensaje {
  margin-bottom: 18px;
  padding: 12px 14px;
  color: #7f1d1d;
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: left;
  background: rgba(254, 226, 226, 0.86);
  border: 1px solid rgba(248, 113, 113, 0.42);
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(127, 29, 29, 0.12);
}

.pwa-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1rem;
}

.btn-install {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #084b69;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(11, 94, 126, 0.34);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.16s ease;
}

.btn-install[hidden] {
  display: none !important;
}

.btn-install:disabled {
  opacity: 0.68;
  cursor: not-allowed;
}

.btn-install:hover:not(:disabled) {
  background: rgba(240, 249, 255, 0.9);
  border-color: rgba(11, 94, 126, 0.58);
  transform: translateY(-1px);
}

.install-hint {
  display: block;
  width: 100%;
  color: rgba(66, 86, 111, 0.86);
  font-size: 0.78rem;
  line-height: 1.4;
}

.install-hint[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .login-shell {
    align-items: center;
    padding: 22px;
  }

  .contenedor-login {
    width: min(100%, 390px);
    border-radius: 24px;
  }

  .logo-login {
    width: 118px;
  }

  input[type="text"],
  input[type="password"] {
    min-height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .airco-login-bg {
    animation: none;
    opacity: 0;
    transform: none;
  }

  .airco-login-bg--01 {
    opacity: 1;
  }

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

@supports not ((backdrop-filter: blur(18px)) or (-webkit-backdrop-filter: blur(18px))) {
  .contenedor-login {
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(218, 239, 249, 0.38)),
      rgba(255, 255, 255, 0.42);
  }
}