dialog#auth {
  width: auto;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  color: #f4f5f5;
  background: transparent;
  color-scheme: dark;
  box-shadow: none;
}

dialog#auth[open] {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100dvh;
  display: grid;
  place-items: safe center;
  padding: 16px;
  overflow: auto;
  overscroll-behavior: contain;
}

dialog#auth::backdrop {
  background:
    radial-gradient(ellipse at 31% 30%, #101720 0%, transparent 52%),
    linear-gradient(115deg, #101211, #080b07 74%);
  backdrop-filter: none;
}

#auth .auth-shell {
  position: relative;
  display: grid;
  grid-template-columns: 55% 45%;
  width: min(76vw, 1120px);
  min-height: 452px;
  aspect-ratio: 5 / 3;
  overflow: hidden;
  border: 1px solid #242624;
  border-radius: 24px;
  background: #050808;
}

#auth .auth-visual {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #0b0e12;
}

#auth .auth-art {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  min-width: 365px;
  aspect-ratio: 4 / 5;
  transform: translate(-50%, -50%);
  background: url("/fly/auth-art.webp") center / 100% 100% no-repeat;
}

#auth .auth-orb-window,
#auth .auth-orb-spin {
  position: absolute;
  inset: 0;
}

#auth .auth-orb-window {
  mask-image: radial-gradient(ellipse 27% 21.7% at 49.5% 35.4%, #000 76%, transparent 100%);
}

#auth .auth-orb-spin {
  background: url("/fly/auth-art.webp") center / 100% 100% no-repeat;
  transform-origin: 49.5% 35.4%;
  opacity: 0;
}

#auth[open] .auth-orb-spin {
  animation: auth-orb-current 8s linear infinite;
}

#auth[data-paused] .auth-orb-spin {
  animation-play-state: paused;
}

@keyframes auth-orb-current {
  0% { opacity: 0; transform: rotate(0turn); }
  14%, 86% { opacity: .96; }
  100% { opacity: 0; transform: rotate(1turn); }
}

#auth .auth-brand {
  position: absolute;
  z-index: 1;
  inset: 24px auto auto 28px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.035em;
  color: #fff;
}

#auth .auth-panel {
  display: grid;
  place-items: center;
  padding: 56px 12% 48px;
}

#auth .auth-inner {
  width: 100%;
  max-width: 400px;
}

#auth #auth-title {
  padding: 0;
  margin: 0 0 25px;
  text-align: center;
  color: #f4f5f5;
  font-size: clamp(23px, 2.3vw, 33px);
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -.035em;
}

#auth .auth-google,
#auth .primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 43px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
}

#auth .auth-google {
  border: 1px solid #8e918f;
  background: #131314;
  color: #e3e3e3;
}

#auth .auth-google img {
  flex: none;
  object-fit: contain;
}

#auth .auth-google:not(:disabled):hover {
  background: #242526;
}

#auth button:disabled {
  cursor: default;
  opacity: .67;
}

#auth .auth-divider {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 22px 0;
  color: #a7acad;
  font-size: 12px;
}

#auth .auth-divider::before,
#auth .auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #24282a;
}

#auth .dialog-form {
  display: grid;
  gap: 15px;
}

#auth .field {
  display: grid;
  gap: 6px;
  color: #e1e4e4;
  font-size: 13px;
}

#auth .field > span {
  margin: 0;
  color: inherit;
}

#auth .field input {
  width: 100%;
  min-height: 43px;
  border: 1px solid #2b2d2f;
  border-radius: 9px;
  padding: 0 12px;
  background: #191b1c;
  color: #fff;
  font-size: 16px;
}

#auth .field input::placeholder {
  color: #a6abad;
}

#auth .primary {
  border: 1px solid #fff;
  background: #f5f7f7;
  color: #101314;
}

#auth .primary:not(:disabled):hover {
  background: #dce7eb;
  border-color: #dce7eb;
}

#auth .dialog-actions {
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0;
}

#auth .dialog-actions button {
  min-height: 40px;
  border: 1px solid #343a3d;
  border-radius: 8px;
  background: transparent;
  color: #e1e4e4;
}

#auth .msg,
#auth .auth-note,
#auth #sent-to,
#auth #signed-email {
  text-align: center;
  overflow-wrap: anywhere;
}

#auth .msg {
  margin-top: 13px;
  color: #ffc4af;
  font-size: 13px;
}

#auth .msg:empty {
  display: none;
}

#auth .auth-note,
#auth #sent-to {
  color: #a7acad;
  font-size: 12px;
  line-height: 1.5;
}

#auth .auth-note {
  margin-top: 8px;
}

#auth .auth-switch {
  display: block;
  min-height: 44px;
  margin: 8px auto 0;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: #dbe4e7;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#auth #signed-email {
  margin-top: 23px;
}

#auth #signed-email {
  margin-bottom: 18px;
}

#auth .close {
  top: 10px;
  right: 10px;
  z-index: 2;
  border-radius: 50%;
  background: #141718;
  color: #e1e4e4;
}

#auth .close:hover {
  background: #292d2e;
}

#auth :is(button, input):focus-visible {
  outline: 2px solid #a0d7fc;
  outline-offset: 2px;
}

@media (max-width: 760px) {
  #auth .auth-shell {
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 460px);
    min-height: 0;
    aspect-ratio: auto;
  }

  #auth .auth-visual {
    height: clamp(128px, 29dvh, 215px);
  }

  #auth .auth-art {
    top: 51%;
    width: auto;
    height: 136%;
    min-width: 0;
    mask-image: linear-gradient(90deg, transparent, #000 13%, #000 89%, transparent);
  }

  #auth .auth-brand {
    inset: 15px auto auto 16px;
    font-size: 14px;
  }

  #auth .auth-panel {
    padding: 27px 24px 29px;
  }

  #auth #auth-title {
    margin-bottom: 19px;
  }

  #auth .auth-divider {
    margin: 16px 0;
  }
}

html[data-motion="off"] #auth[open] .auth-orb-spin {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  #auth[open] .auth-orb-spin,
  dialog#auth::backdrop {
    animation: none;
  }
}
