/*
 * Panel de marca del login: logo de FirmaDoc con trazos de firma animados.
 * Sustituye la imagen de la puerta (.login__panel__door).
 *
 * Cada trazo nace pequeño en el centro (detrás del logo), viaja en diagonal
 * hacia su esquina mientras se dibuja, se queda un momento y se desvanece.
 * Son 5 trazos escalonados cada 1.4s sobre un ciclo de 7s.
 * Con .is-done (al enviar el formulario) todos se completan y quedan visibles.
 */

.brand-firmas {
  position: relative;
  width: 100%;
  max-width: 30rem;
  aspect-ratio: 460 / 340;
}

.brand-firmas__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Posición del logo calculada sobre el lienzo de 460x340 del SVG. */
.brand-firmas__logo {
  position: absolute;
  left: 10.87%;
  top: 37.6%;
  width: 78.26%;
  height: auto;
  animation: bf-float 6s ease-in-out infinite;
}

@keyframes bf-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* Trazo: se dibuja con stroke-dashoffset (pathLength="100"). */
.bf-sg {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  opacity: 0;
  animation: bf-draw 7s ease-in-out infinite;
}

@keyframes bf-draw {
  0%        { stroke-dashoffset: 100; opacity: 0; }
  4%        { opacity: 1; }
  34%       { stroke-dashoffset: 0; }
  72%       { stroke-dashoffset: 0; opacity: 1; }
  88%, 100% { stroke-dashoffset: 0; opacity: 0; }
}

/* Desplazamiento centro -> esquina. --dx / --dy van en cada grupo (index.php). */
.bf-fly {
  transform-box: fill-box;
  transform-origin: center;
  animation: bf-fly 7s cubic-bezier(.2, .7, .3, 1) infinite;
}

@keyframes bf-fly {
  0%        { transform: translate(var(--dx), var(--dy)) scale(.35); }
  32%, 100% { transform: translate(0, 0) scale(1); }
}

.bf-d2 { animation-delay: 1.4s; }
.bf-d3 { animation-delay: 2.8s; }
.bf-d4 { animation-delay: 4.2s; }
.bf-d5 { animation-delay: 5.6s; }

/* Estado final al enviar el formulario: todos salen juntos y quedan completos. */
.brand-firmas.is-done .bf-sg {
  animation: bf-draw-done 1s ease-out forwards;
}

.brand-firmas.is-done .bf-fly {
  animation: bf-fly-done 1s cubic-bezier(.2, .7, .3, 1) forwards;
}

@keyframes bf-draw-done {
  from { stroke-dashoffset: 100; opacity: .3; }
  to   { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes bf-fly-done {
  from { transform: translate(var(--dx), var(--dy)) scale(.35); }
  to   { transform: translate(0, 0) scale(1); }
}

/* Usuarios con "reducir movimiento": trazos estáticos, sin animación. */
/* @media (prefers-reduced-motion: reduce) {
  .brand-firmas__logo,
  .bf-fly,
  .bf-sg {
    animation: none;
  }

  .bf-sg {
    stroke-dashoffset: 0;
    opacity: .85;
  }
} */
