/* WPHostee "Client Login" nav button.
   Adapted from https://codepen.io/cssparadise/pen/RNRBYXb - all class
   names and keyframes are prefixed with wph-login to avoid colliding
   with Bootstrap's .btn classes used everywhere else on the site. */

.wph-login-wrapper {
  position: relative;
  display: inline-block;
  margin-top: 4px;
}

.wph-login-btn {
  --border-radius: 24px;
  --padding: 4px;
  --transition: 0.4s;
  --button-color: #004562;
  --highlight-color-hue: 210deg;

  position: relative;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4em 0.5em 0.4em 0.7em;
  font-family: "Work Sans", "Poppins", "Segoe UI", sans-serif;
  font-size: 0.95em;
  font-weight: 400;
  text-decoration: none;

  background-color: var(--button-color);

  box-shadow:
    inset 0px 1px 1px rgba(255, 255, 255, 0.2),
    inset 0px 2px 2px rgba(255, 255, 255, 0.15),
    inset 0px 4px 4px rgba(255, 255, 255, 0.1),
    inset 0px 8px 8px rgba(255, 255, 255, 0.05),
    inset 0px 16px 16px rgba(255, 255, 255, 0.05),
    0px -1px 1px rgba(0, 0, 0, 0.02),
    0px -2px 2px rgba(0, 0, 0, 0.03), 0px -4px 4px rgba(0, 0, 0, 0.05),
    0px -8px 8px rgba(0, 0, 0, 0.06), 0px -16px 16px rgba(0, 0, 0, 0.08);

  border: solid 1px #fff2;
  border-radius: var(--border-radius);
  cursor: pointer;

  transition: box-shadow var(--transition), border var(--transition),
    background-color var(--transition);
}
.wph-login-btn::before {
  content: "";
  position: absolute;
  top: calc(0px - var(--padding));
  left: calc(0px - var(--padding));
  width: calc(100% + var(--padding) * 2);
  height: calc(100% + var(--padding) * 2);
  border-radius: calc(var(--border-radius) + var(--padding));
  pointer-events: none;
  background-image: linear-gradient(0deg, #0004, #000a);

  z-index: -1;
  transition: box-shadow var(--transition), filter var(--transition);
  box-shadow: 0 -8px 8px -6px #0000 inset, 0 -16px 16px -8px #00000000 inset,
    1px 1px 1px #fff2, 2px 2px 2px #fff1, -1px -1px 1px #0002,
    -2px -2px 2px #0001;
}
.wph-login-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
  background-image: linear-gradient(
    0deg,
    #fff,
    hsl(var(--highlight-color-hue), 100%, 70%),
    hsla(var(--highlight-color-hue), 100%, 70%, 50%),
    8%,
    transparent
  );
  background-position: 0 0;
  opacity: 0;
  transition: opacity var(--transition), filter var(--transition);
}

.wph-login-btn__letter {
  position: relative;
  display: inline-block;
  color: #fff5;
  animation: wphLoginLetterAnim 2s ease-in-out infinite;
  transition: color var(--transition), text-shadow var(--transition),
    opacity var(--transition);
}

@keyframes wphLoginLetterAnim {
  50% {
    text-shadow: 0 0 3px #fff8;
    color: #fff;
  }
}

.wph-login-btn__svg {
  flex-grow: 1;
  height: 24px;
  margin-right: 0.5rem;
  fill: #e8e8e8;
  animation: wphLoginFlicker 2s linear infinite;
  animation-delay: 0.5s;
  filter: drop-shadow(0 0 2px #fff9);
  transition: fill var(--transition), filter var(--transition),
    opacity var(--transition);
}
@keyframes wphLoginFlicker {
  50% {
    opacity: 0.3;
  }
}

/* Focus state */
.wph-login-btn__txt-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 4.4em;
}
.wph-login-btn__txt-1,
.wph-login-btn__txt-2 {
  position: absolute;
  word-spacing: -1em;
}
.wph-login-btn__txt-1 {
  animation: wphLoginAppearAnim 1s ease-in-out forwards;
}
.wph-login-btn__txt-2 {
  opacity: 0;
}
@keyframes wphLoginAppearAnim {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
.wph-login-btn:focus .wph-login-btn__txt-1 {
  animation: wphLoginOpacityAnim 0.15s ease-in-out forwards;
  animation-delay: 0.3s;
}
.wph-login-btn:focus .wph-login-btn__txt-2 {
  animation: wphLoginOpacityAnim 0.15s ease-in-out reverse forwards;
  animation-delay: 0.3s;
}
@keyframes wphLoginOpacityAnim {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.wph-login-btn:focus .wph-login-btn__letter {
  animation: wphLoginFocusedLetterAnim 0.3s ease-in-out forwards,
    wphLoginLetterAnim 1.2s ease-in-out infinite;
  animation-delay: 0s, 0.3s;
}
@keyframes wphLoginFocusedLetterAnim {
  0%,
  100% {
    filter: blur(0px);
  }
  50% {
    transform: scale(2);
    filter: blur(10px) brightness(150%)
      drop-shadow(-36px 12px 12px hsl(var(--highlight-color-hue), 100%, 70%));
  }
}
.wph-login-btn:focus .wph-login-btn__svg {
  animation-duration: 1.2s;
  animation-delay: 0.1s;
}

.wph-login-btn:focus::before {
  box-shadow: 0 -8px 12px -6px #fff3 inset,
    0 -16px 16px -8px hsla(var(--highlight-color-hue), 100%, 70%, 20%) inset,
    1px 1px 1px #fff3, 2px 2px 2px #fff1, -1px -1px 1px #0002,
    -2px -2px 2px #0001;
}
.wph-login-btn:focus::after {
  opacity: 0.6;
  mask-image: linear-gradient(0deg, #fff, transparent);
  filter: brightness(100%);
}

/* Animation delays for .wph-login-btn__letter elements */
.wph-login-btn__letter:nth-child(1),
.wph-login-btn:focus .wph-login-btn__letter:nth-child(1) {
  animation-delay: 0s;
}
.wph-login-btn__letter:nth-child(2),
.wph-login-btn:focus .wph-login-btn__letter:nth-child(2) {
  animation-delay: 0.08s;
}
.wph-login-btn__letter:nth-child(3),
.wph-login-btn:focus .wph-login-btn__letter:nth-child(3) {
  animation-delay: 0.16s;
}
.wph-login-btn__letter:nth-child(4),
.wph-login-btn:focus .wph-login-btn__letter:nth-child(4) {
  animation-delay: 0.24s;
}
.wph-login-btn__letter:nth-child(5),
.wph-login-btn:focus .wph-login-btn__letter:nth-child(5) {
  animation-delay: 0.32s;
}
.wph-login-btn__letter:nth-child(6),
.wph-login-btn:focus .wph-login-btn__letter:nth-child(6) {
  animation-delay: 0.4s;
}
.wph-login-btn__letter:nth-child(7),
.wph-login-btn:focus .wph-login-btn__letter:nth-child(7) {
  animation-delay: 0.48s;
}
.wph-login-btn__letter:nth-child(8),
.wph-login-btn:focus .wph-login-btn__letter:nth-child(8) {
  animation-delay: 0.56s;
}
.wph-login-btn__letter:nth-child(9),
.wph-login-btn:focus .wph-login-btn__letter:nth-child(9) {
  animation-delay: 0.64s;
}
.wph-login-btn__letter:nth-child(10),
.wph-login-btn:focus .wph-login-btn__letter:nth-child(10) {
  animation-delay: 0.72s;
}
.wph-login-btn__letter:nth-child(11),
.wph-login-btn:focus .wph-login-btn__letter:nth-child(11) {
  animation-delay: 0.8s;
}
.wph-login-btn__letter:nth-child(12),
.wph-login-btn:focus .wph-login-btn__letter:nth-child(12) {
  animation-delay: 0.88s;
}
.wph-login-btn__letter:nth-child(13),
.wph-login-btn:focus .wph-login-btn__letter:nth-child(13) {
  animation-delay: 0.96s;
}

/* Active state */
.wph-login-btn:active {
  border: solid 1px hsla(var(--highlight-color-hue), 100%, 80%, 70%);
  background-color: hsla(var(--highlight-color-hue), 50%, 20%, 0.5);
}
.wph-login-btn:active::before {
  box-shadow: 0 -8px 12px -6px #fffa inset,
    0 -16px 16px -8px hsla(var(--highlight-color-hue), 100%, 70%, 80%) inset,
    1px 1px 1px #fff4, 2px 2px 2px #fff2, -1px -1px 1px #0002,
    -2px -2px 2px #0001;
}
.wph-login-btn:active::after {
  opacity: 1;
  mask-image: linear-gradient(0deg, #fff, transparent);
  filter: brightness(200%);
}
.wph-login-btn:active .wph-login-btn__letter {
  text-shadow: 0 0 1px hsla(var(--highlight-color-hue), 100%, 90%, 90%);
  animation: none;
}

/* Hover state */
.wph-login-btn:hover {
  border: solid 1px hsla(var(--highlight-color-hue), 100%, 80%, 40%);
}

.wph-login-btn:hover::before {
  box-shadow: 0 -8px 8px -6px #fffa inset,
    0 -16px 16px -8px hsla(var(--highlight-color-hue), 100%, 70%, 30%) inset,
    1px 1px 1px #fff2, 2px 2px 2px #fff1, -1px -1px 1px #0002,
    -2px -2px 2px #0001;
}

.wph-login-btn:hover::after {
  opacity: 1;
  mask-image: linear-gradient(0deg, #fff, transparent);
}

.wph-login-btn:hover .wph-login-btn__svg {
  fill: #fff;
  filter: drop-shadow(0 0 3px hsl(var(--highlight-color-hue), 100%, 70%))
    drop-shadow(0 -4px 6px #0009);
  animation: none;
}

@media (max-width: 991.98px) {
  .wph-login-wrapper {
    display: block;
    margin: 10px 0;
  }
}
