@view-transition {
  navigation: auto;
}

.login-shell,
.signup-shell {
  transition:
    opacity 170ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 170ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 180ms cubic-bezier(0.22, 1, 0.36, 1);
  view-transition-name: auth-shell;
}

.auth-switch {
  --auth-switch-position: 0;
  position: relative;
  display: grid;
  width: min(100%, 19rem);
  min-height: 2.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  margin: 0 auto 2rem;
  border: 1px solid rgba(32, 50, 39, 0.055);
  border-radius: 0.88rem;
  background: rgba(229, 232, 228, 0.72);
  padding: 0.23rem;
  box-shadow: inset 0 1px 2px rgba(23, 32, 25, 0.045);
  isolation: isolate;
  view-transition-name: auth-switch;
}

.auth-switch--signup {
  --auth-switch-position: 1;
}

.auth-switch__indicator {
  position: absolute;
  z-index: 0;
  top: 0.23rem;
  bottom: 0.23rem;
  left: 0.23rem;
  width: calc(50% - 0.23rem);
  border: 1px solid rgba(25, 43, 32, 0.08);
  border-radius: 0.68rem;
  background: #fcfcf9;
  box-shadow:
    0 1px 2px rgba(23, 32, 25, 0.09),
    0 7px 18px -15px rgba(23, 32, 25, 0.42);
  transform: translateX(calc(var(--auth-switch-position) * 100%));
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
  view-transition-name: auth-switch-indicator;
}

.auth-switch__tab {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  min-height: 2.3rem;
  place-items: center;
  border-radius: 0.68rem;
  color: #6b746e;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  transition: color 180ms ease;
}

.auth-switch__tab:hover,
.auth-switch__tab:focus-visible {
  color: #1d2a22;
  outline: none;
}

.auth-switch__tab:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(8, 124, 89, 0.22);
}

.auth-switch__tab.is-active {
  color: #152019;
}

html.auth-switch-is-leaving .login-shell,
html.auth-switch-is-leaving .signup-shell {
  opacity: 0;
  transform: translateY(-0.25rem) scale(0.988);
}

html.auth-switch-is-entering .login-shell,
html.auth-switch-is-entering .signup-shell {
  animation: auth-shell-fallback-enter 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

html.auth-switch-is-entering[data-auth-switch-from="login"] .signup-shell {
  animation: auth-shell-expand-enter 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: top center;
}

html.auth-switch-is-entering[data-auth-switch-from="signup"] .login-shell {
  animation: auth-shell-contract-enter 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: top center;
}

html.auth-switch-is-entering[data-auth-switch-from="login"] .signup-card,
html.auth-switch-is-entering[data-auth-switch-from="signup"] .login-card {
  animation: auth-content-fallback-enter 300ms 90ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

::view-transition-group(auth-shell) {
  animation-duration: 460ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

::view-transition-group(auth-switch),
::view-transition-group(auth-switch-indicator) {
  animation-duration: 380ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

::view-transition-image-pair(auth-shell),
::view-transition-image-pair(auth-switch),
::view-transition-image-pair(auth-switch-indicator) {
  isolation: auto;
}

::view-transition-old(auth-shell),
::view-transition-new(auth-shell) {
  height: 100%;
  overflow: clip;
  mix-blend-mode: normal;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
}

@keyframes auth-shell-fallback-enter {
  from { opacity: 0; transform: translateY(0.35rem) scale(0.988); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes auth-shell-expand-enter {
  from { opacity: 0.52; transform: translateY(-0.2rem) scale(0.72, 0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes auth-shell-contract-enter {
  from { opacity: 0.52; transform: translateY(0.2rem) scale(1.24, 1.06); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes auth-content-fallback-enter {
  from { opacity: 0; transform: translateY(0.2rem); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 560px) {
  .auth-switch {
    width: min(100%, 17rem);
    margin-bottom: 1.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-switch__indicator,
  .auth-switch__tab,
  .login-shell,
  .signup-shell {
    transition: none;
  }

  html.auth-switch-is-entering .login-shell,
  html.auth-switch-is-entering .signup-shell,
  html.auth-switch-is-entering .login-card,
  html.auth-switch-is-entering .signup-card {
    animation: none;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation-duration: 1ms !important;
  }
}
