/* ==========================================================
   WIRTZ MARKETING · LOGIN MOTION 5.0
   Fondo interactivo + estilo profesional
   ========================================================== */

body.wm-login-motion-active {
  --lm-bg: #09090b;
  --lm-surface: rgba(16,16,19,.91);
  --lm-field: #1a1a1e;
  --lm-border: #39393f;
  --lm-text: #f7f7f8;
  --lm-muted: #a1a1aa;

  min-height: 100dvh;
  background: var(--lm-bg) !important;
  overflow-x: hidden !important;
}

/* Canvas, siempre detrás del formulario */

#wm-login-motion {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100vw;
  height: 100dvh;
  pointer-events: none;
}

/* Fondo editorial con profundidad muy discreta */

body.wm-login-motion-active::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  background:
    radial-gradient(
      ellipse 65% 70% at 10% 15%,
      rgba(110,110,125,.055),
      transparent 75%
    ),
    linear-gradient(
      135deg,
      rgba(255,255,255,.018),
      transparent 55%
    );
}

/* El formulario existente pasa a ser una tarjeta premium */

body.wm-login-motion-active .wm-login-motion-form {
  position: relative;
  z-index: 2;

  width: min(100%, 430px);
  max-width: 430px;
  min-width: 0;

  margin-inline: auto;

  padding: clamp(22px, 3vw, 34px);

  color: var(--lm-text);
  background: var(--lm-surface);

  border: 1px solid var(--lm-border);
  border-radius: 15px;

  box-shadow:
    0 24px 70px rgba(0,0,0,.24);

  animation: lm-enter 470ms cubic-bezier(.22,1,.36,1) both;
}

.wm-login-motion-form,
.wm-login-motion-form * {
  box-sizing: border-box;
}

.wm-login-motion-form h1,
.wm-login-motion-form h2 {
  color: var(--lm-text);
  font-weight: 800;
  letter-spacing: -.65px;
  line-height: 1.2;
}

.wm-login-motion-form p,
.wm-login-motion-form small {
  color: var(--lm-muted);
  line-height: 1.55;
}

.wm-login-motion-form label {
  color: var(--lm-text);
  font-size: 12px;
  font-weight: 750;
}

.wm-login-motion-form input:not(
  [type="checkbox"]
):not([type="radio"]),
.wm-login-motion-form select {
  width: 100%;
  min-width: 0;
  min-height: 45px;

  padding: 11px 13px;

  color: var(--lm-text);
  background: var(--lm-field);

  border: 1px solid var(--lm-border);
  border-radius: 8px;

  font: inherit;
  font-size: 13px;
  outline: none;

  transition:
    border-color 170ms ease,
    background 170ms ease;
}

.wm-login-motion-form input::placeholder {
  color: #7e7e87;
}

.wm-login-motion-form input:focus,
.wm-login-motion-form select:focus {
  border-color: #e7e7e9 !important;
  outline: none;
}

.wm-login-motion-form button[type="submit"] {
  width: 100%;
  min-height: 45px;

  padding: 11px 15px;

  color: #101012;
  background: #f3f3f4;

  border: 1px solid #f3f3f4;
  border-radius: 8px;

  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;

  transition:
    transform 170ms ease,
    background 170ms ease;
}

.wm-login-motion-form button[type="submit"]:hover:not(:disabled) {
  background: #dcdce0;
  transform: translateY(-1px);
}

.wm-login-motion-form button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.wm-login-motion-form :focus-visible {
  outline: 2px solid #f3f3f4;
  outline-offset: 3px;
}

/* Mantener el contenido del login encima de las capas */

body.wm-login-motion-active
:is(main, #app, #root, .app, .login-page, .login-container) {
  position: relative;
  z-index: 1;
}

/* Adaptación a notebooks y tablets */

@media (max-width: 900px) {
  body.wm-login-motion-active .wm-login-motion-form {
    max-width: 410px;
    padding: 25px;
  }
}

/* Móviles */

@media (max-width: 600px) {
  body.wm-login-motion-active .wm-login-motion-form {
    width: min(100%, 400px);
    max-width: calc(100vw - 28px);
    margin-inline: auto;
    padding: 22px 19px;

    border-radius: 12px;
    box-shadow: 0 12px 35px rgba(0,0,0,.20);
  }

  .wm-login-motion-form h1,
  .wm-login-motion-form h2 {
    font-size: clamp(21px, 6vw, 27px);
  }

  .wm-login-motion-form input:not(
    [type="checkbox"]
  ):not([type="radio"]) {
    min-height: 44px;
    font-size: 16px;
  }
}

/* Dispositivos bajos en altura */

@media (max-height: 650px) {
  body.wm-login-motion-active .wm-login-motion-form {
    padding-block: 18px;
  }
}

@keyframes lm-enter {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  #wm-login-motion,
  .wm-login-motion-form,
  .wm-login-motion-form * {
    animation: none !important;
    transition: none !important;
  }
}
