@import url('menu.css');
@import url('form.css');


.btn-gradient {
  position: relative;
  border: none;
}

.btn-gradient::before {
  content: "";
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  z-index: 1;
  position: absolute;
  inset: 0;
  padding: 2px; /* border thickness */
  border-radius: inherit;
  background: #ffffff;
  background-size: 300% 300%;
  opacity: 1;

  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
}

.btn-gradient::after {
  content: "";
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  z-index: 1;
  position: absolute;
  inset: 0;
  padding: 2px; /* border thickness */
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    #5fd3ff,
    #b47cff,
    #ff7ad9,
    #5fd3ff
  );
  background-size: 300% 300%;
  opacity: 0;
  animation: borderMove 4s linear infinite;

  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
}


/* Animate only when hovering */
.btn-gradient:hover::after {
  opacity: 1;
  animation: borderMove 3s linear infinite;
}

.btn-gradient span {
  position: relative;
  z-index: 1;
}

@keyframes borderMove {
  0%   { background-position:   0% 50%; }
  100% { background-position: 300% 50%; }
}