*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: #f4f6fb;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-scene {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  isolation: isolate;
}

.login-bg {
  position: fixed;
  inset: 0;
  z-index: -3;
}

.login-bg::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 48px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 48px
    );
  animation: gridDrift 14s linear infinite;
  opacity: 0.45;
}

.login-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  z-index: -2;
  opacity: 0.5;
  animation: orbFloat 14s ease-in-out infinite alternate;
}

.login-float-icon {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 0;
  width: clamp(64px, 5vw, 110px);
  height: auto;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.2));
  will-change: transform, opacity;
  opacity: 0;
  transform: translate(-50%, 12vh);
}

/* Arriba: 5 % más rápido (26.6 s vs 28 s) */
.login-float-icon--a {
  animation: iconPathA 26.6s ease-in-out infinite;
}

.login-float-icon--b {
  animation: iconPathB 28s ease-in-out infinite;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 36px 32px 28px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: cardIn 0.7s ease-out both;
}

.login-product {
  margin: 0 0 18px;
  text-align: center;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  color: rgba(244, 246, 251, 0.78);
}

.login-title {
  margin: 0 0 6px;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 600;
}

.login-logo {
  display: block;
  max-width: 220px;
  height: auto;
  margin: 0 auto 24px;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

.login-logo--icono {
  max-width: 128px;
}

.login-meta--top {
  margin: 0 0 20px;
  padding-bottom: 4px;
}

.login-lead-title {
  margin: 0 0 8px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(244, 246, 251, 0.92);
}

.login-lead-text {
  margin: 0 0 20px;
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(244, 246, 251, 0.72);
}

.login-field {
  margin-bottom: 14px;
}

.login-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(244, 246, 251, 0.65);
}

.login-field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(7, 11, 24, 0.55);
  color: #fff;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-field input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.login-field input:focus {
  outline: none;
  background: rgba(7, 11, 24, 0.75);
}

.login-btn {
  width: 100%;
  margin-top: 8px;
  padding: 14px 18px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}

.login-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.login-btn:active {
  transform: translateY(0);
}

.login-meta {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(244, 246, 251, 0.78);
}

.login-meta strong {
  color: #fff;
  font-weight: 600;
}

.login-footer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.6;
  color: rgba(244, 246, 251, 0.62);
}

.login-footer a {
  text-decoration: none;
  font-weight: 600;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes orbFloat {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(24px, -18px) scale(1.08); }
}

@keyframes gridDrift {
  from { transform: translate(0, 0); }
  to { transform: translate(48px, 48px); }
}

/* Sale por debajo del cuadro → sube a la derecha → regresa por la derecha al centro → baja */
@keyframes iconPathA {
  0%, 100% {
    transform: translate(-50%, 12vh) rotate(0deg) scale(0.92);
    opacity: 0;
  }
  6%  { opacity: 0.26; }
  18% {
    transform: translate(calc(-50% + 12vw), -22vh) rotate(10deg) scale(1);
    opacity: 0.24;
  }
  38% {
    transform: translate(calc(-50% + 26vw), -10vh) rotate(6deg) scale(1.04);
    opacity: 0.22;
  }
  52% {
    transform: translate(calc(-50% + 30vw), 0vh) rotate(-4deg) scale(1.02);
    opacity: 0.24;
  }
  68% {
    transform: translate(calc(-50% + 18vw), 12vh) rotate(-8deg) scale(0.98);
    opacity: 0.2;
  }
  82% {
    transform: translate(calc(-50% + 6vw), 16vh) rotate(-4deg) scale(0.96);
    opacity: 0.16;
  }
  92% { opacity: 0.06; }
}

/* Sale por debajo del cuadro → baja a la izquierda → regresa por el centro inferior → se mete abajo */
@keyframes iconPathB {
  0%, 100% {
    transform: translate(calc(-50% - 6vw), 12vh) rotate(0deg) scale(0.9);
    opacity: 0;
  }
  6%  { opacity: 0.22; }
  20% {
    transform: translate(calc(-50% - 16vw), 24vh) rotate(-12deg) scale(1);
    opacity: 0.22;
  }
  42% {
    transform: translate(calc(-50% - 26vw), 32vh) rotate(-6deg) scale(1.05);
    opacity: 0.2;
  }
  58% {
    transform: translate(calc(-50% - 4vw), 20vh) rotate(4deg) scale(1);
    opacity: 0.22;
  }
  72% {
    transform: translate(calc(-50% + 4vw), 16vh) rotate(6deg) scale(0.98);
    opacity: 0.18;
  }
  86% {
    transform: translate(calc(-50% - 2vw), 13vh) rotate(2deg) scale(0.94);
    opacity: 0.1;
  }
  94% { opacity: 0.04; }
}

/* Trayectorias acortadas — tablet / ventana angosta */
@keyframes iconPathA-tab {
  0%, 100% { transform: translate(-50%, 10vh) scale(0.92); opacity: 0; }
  6%  { opacity: 0.24; }
  20% { transform: translate(calc(-50% + 9vw), -14vh) rotate(8deg); opacity: 0.22; }
  45% { transform: translate(calc(-50% + 18vw), -4vh) rotate(4deg); opacity: 0.22; }
  60% { transform: translate(calc(-50% + 20vw), 4vh) rotate(-4deg); opacity: 0.22; }
  78% { transform: translate(calc(-50% + 8vw), 12vh); opacity: 0.16; }
  92% { opacity: 0.05; }
}

@keyframes iconPathB-tab {
  0%, 100% { transform: translate(calc(-50% - 4vw), 10vh) scale(0.9); opacity: 0; }
  6%  { opacity: 0.2; }
  22% { transform: translate(calc(-50% - 12vw), 16vh) rotate(-10deg); opacity: 0.2; }
  45% { transform: translate(calc(-50% - 18vw), 22vh) rotate(-5deg); opacity: 0.18; }
  60% { transform: translate(calc(-50% - 3vw), 14vh) rotate(4deg); opacity: 0.2; }
  78% { transform: translate(calc(-50% + 2vw), 11vh); opacity: 0.14; }
  92% { opacity: 0.04; }
}

/* Trayectorias cortas — móvil (siempre dentro del viewport) */
@keyframes iconPathA-mob {
  0%, 100% { transform: translate(-50%, 8vh) scale(0.9); opacity: 0; }
  8%  { opacity: 0.28; }
  25% { transform: translate(calc(-50% + 11vw), -8vh) rotate(8deg); opacity: 0.26; }
  50% { transform: translate(calc(-50% + 14vw), 2vh) rotate(-4deg); opacity: 0.26; }
  72% { transform: translate(calc(-50% + 6vw), 10vh); opacity: 0.2; }
  90% { opacity: 0.06; }
}

@keyframes iconPathB-mob {
  0%, 100% { transform: translate(calc(-50% - 3vw), 8vh) scale(0.9); opacity: 0; }
  8%  { opacity: 0.26; }
  25% { transform: translate(calc(-50% - 11vw), 12vh) rotate(-10deg); opacity: 0.24; }
  50% { transform: translate(calc(-50% - 3vw), 10vh) rotate(4deg); opacity: 0.24; }
  72% { transform: translate(calc(-50% + 2vw), 8vh); opacity: 0.18; }
  90% { opacity: 0.05; }
}

/* Tablet / ventana estrecha */
@media (max-width: 1024px) {
  .login-float-icon {
    width: clamp(52px, 7vw, 80px);
  }
  .login-float-icon--a { animation-name: iconPathA-tab; }
  .login-float-icon--b { animation-name: iconPathB-tab; }
}

/* Móvil */
@media (max-width: 768px) {
  .login-float-icon {
    width: clamp(44px, 11vw, 60px);
  }
  .login-float-icon--a {
    animation-name: iconPathA-mob;
    animation-duration: 22s;
  }
  .login-float-icon--b {
    animation-name: iconPathB-mob;
    animation-duration: 23.2s;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 28px 22px 22px;
    border-radius: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-bg::before,
  .login-orb,
  .login-card,
  .login-float-icon,
  .login-float-icon--a,
  .login-float-icon--b {
    animation: none;
  }
}
