.auth-modal-overlay[hidden] {
  display: none !important;
}

.auth-modal-overlay {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: block;
  padding: 0;
  color-scheme: light;
  color: #f1f5fb;
  background: transparent;
  pointer-events: none;
}

.auth-modal-dialog {
  position: fixed;
  z-index: 1;
  top: 16px;
  right: 0;
  bottom: 16px;
  display: flex;
  width: min(620px, 100vw);
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px);
  max-height: none;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-right: 0;
  border-radius: 26px 0 0 26px;
  background: linear-gradient(145deg, rgba(35, 42, 54, 0.94), rgba(14, 19, 29, 0.9));
  box-shadow: -28px 0 84px rgba(0, 0, 0, 0.4), inset 1px 0 0 rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(34px) saturate(145%) brightness(0.82);
  backdrop-filter: blur(34px) saturate(145%) brightness(0.82);
  pointer-events: auto;
}

.auth-modal-dialog::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  height: auto;
  background: linear-gradient(180deg, #63e7ff, #3978ff);
  content: "";
}

.auth-modal-dialog::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.075), transparent 34%, rgba(57, 120, 255, 0.035));
  content: "";
  pointer-events: none;
}

.auth-modal-close {
  position: absolute;
  z-index: 2;
  top: 24px;
  right: 24px;
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: rgba(241, 245, 251, 0.64);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.auth-modal-close:hover,
.auth-modal-close:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.auth-modal-body {
  width: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(54px, 8vh, 88px) clamp(28px, 5vw, 72px) 40px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.auth-modal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(44px, 7vh, 72px);
  color: #ffffff;
  font-size: 20px;
  font-weight: 680;
  letter-spacing: 0;
}

.auth-modal-brand img {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.auth-modal-overlay[data-auth-mode="register"] .auth-modal-brand {
  display: none;
}

.auth-modal-overlay[data-auth-mode="register"] .auth-modal-body {
  overflow-y: scroll;
}

.auth-modal-body::-webkit-scrollbar {
  width: 10px;
}

.auth-modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.auth-modal-body::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.auth-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.34);
}

.auth-modal-kicker {
  margin: 0 0 12px;
  color: #3978ff;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.12em;
}

.auth-page-required {
  color: #ff7868;
}

.auth-page-optional,
.auth-page-field-meta {
  color: rgba(241, 245, 251, 0.62);
  font-size: 10px;
  font-weight: 500;
}

.auth-modal-heading {
  max-width: 620px;
  margin: 0;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 520;
  line-height: 1.02;
  letter-spacing: 0;
}

.auth-modal-lead {
  max-width: 620px;
  margin: 12px 0 24px;
  color: rgba(241, 245, 251, 0.64);
}

.auth-modal-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.auth-modal-tab {
  min-width: 92px;
  min-height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: rgba(241, 245, 251, 0.62);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 680;
}

.auth-modal-tab.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.auth-modal-panel[hidden] {
  display: none !important;
}

.auth-modal-overlay[data-auth-mode="login"] [data-auth-panel="login"] {
  margin-top: 48px;
}

.auth-modal-overlay[data-auth-mode="login"] [data-auth-panel="login"] .auth-modal-field-full label {
  font-size: 15px;
  font-weight: 680;
}

.auth-modal-overlay[data-auth-mode="login"] [data-auth-panel="login"] .auth-modal-field-full input {
  min-height: 54px;
  font-size: 16px;
}

.auth-modal-overlay[data-auth-mode="login"] [data-auth-panel="login"] .auth-modal-options,
.auth-modal-overlay[data-auth-mode="login"] [data-auth-panel="login"] .auth-modal-foot {
  font-size: 14px;
  line-height: 1.5;
}

.auth-modal-overlay[data-auth-mode="login"] [data-auth-panel="login"] .auth-modal-options input {
  width: 16px;
  height: 16px;
}

.auth-modal-overlay[data-auth-mode="login"] [data-auth-panel="login"] .auth-modal-foot {
  margin-top: 12px;
}

.auth-modal-form {
  display: grid;
  gap: 16px;
}

.auth-modal-register-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 390px);
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.auth-modal-register-steps::before {
  position: absolute;
  top: 15px;
  left: 16px;
  width: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
  content: "";
}

.auth-modal-register-steps li {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: start;
  gap: 6px;
  color: rgba(241, 245, 251, 0.58);
}

.auth-modal-register-steps li > span {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: #171d28;
  font-size: 11px;
  font-weight: 740;
}

.auth-modal-register-steps li > strong {
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.auth-modal-register-steps li.is-active,
.auth-modal-register-steps li.is-complete {
  color: #63e7ff;
}

.auth-modal-register-steps li.is-active > span,
.auth-modal-register-steps li.is-complete > span {
  border-color: #3978ff;
  color: #ffffff;
  background: #3978ff;
}

.auth-modal-register-stage {
  display: grid;
  gap: 16px;
}

.auth-modal-register-stage[hidden],
.auth-modal-access-method[hidden] {
  display: none !important;
}

.auth-modal-form-groups {
  display: grid;
  gap: 16px;
}

.auth-modal-group {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.auth-modal-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.auth-modal-group-head p {
  margin: 0;
  color: #f1f5fb;
  font-size: 13px;
  font-weight: 720;
}

.auth-modal-group-head span {
  color: rgba(241, 245, 251, 0.6);
  font-size: 11px;
  white-space: nowrap;
}

.auth-modal-activation {
  gap: 16px;
}

.auth-modal-access-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.auth-modal-access-options label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.auth-modal-access-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
}

.auth-modal-access-options label > span {
  display: grid;
  min-height: 76px;
  padding: 13px 14px;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.auth-modal-access-options strong {
  font-size: 13px;
  font-weight: 720;
}

.auth-modal-access-options small {
  overflow-wrap: anywhere;
  color: rgba(241, 245, 251, 0.58);
  font-size: 10px;
  line-height: 1.45;
}

.auth-modal-access-options input:checked + span {
  border-color: #3978ff;
  color: #ffffff;
  background: rgba(57, 120, 255, 0.14);
  box-shadow: 0 0 0 3px rgba(57, 120, 255, 0.11);
}

.auth-modal-access-options input:focus-visible + span {
  outline: 2px solid #63e7ff;
  outline-offset: 3px;
}

.auth-modal-access-method {
  display: grid;
  gap: 7px;
}

.auth-modal-access-method > label {
  color: #f1f5fb;
  font-size: 12px;
  font-weight: 650;
}

.auth-modal-access-method > input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #f1f5fb;
  background: rgba(255, 255, 255, 0.09);
  outline: none;
}

.auth-modal-access-method > input:focus {
  border-color: #3978ff;
  box-shadow: 0 0 0 3px rgba(57, 120, 255, 0.14);
}

.auth-modal-payment-panel {
  grid-template-columns: 148px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.auth-modal-payment-panel > img {
  display: block;
  width: 148px;
  height: 148px;
  border-radius: 7px;
}

.auth-modal-payment-panel > div {
  display: grid;
  gap: 6px;
}

.auth-modal-payment-panel strong {
  color: #ffffff;
  font-size: 14px;
}

.auth-modal-payment-panel span,
.auth-modal-payment-panel small {
  color: rgba(241, 245, 251, 0.64);
  font-size: 11px;
  line-height: 1.5;
}

.auth-modal-payment-panel small {
  font-size: 10px;
}

.auth-modal-step-actions {
  display: grid;
  grid-template-columns: minmax(112px, 0.7fr) minmax(0, 1.3fr);
  gap: 10px;
}

.auth-modal-step-actions .auth-modal-secondary {
  width: 100%;
}

.auth-modal-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.auth-modal-field,
.auth-modal-field-full {
  display: grid;
  gap: 7px;
}

.auth-modal-field-full {
  grid-column: 1 / -1;
}

.auth-modal-field label,
.auth-modal-field-full label {
  color: #f1f5fb;
  font-size: 12px;
  font-weight: 650;
}

.auth-modal-field input,
.auth-modal-field select,
.auth-modal-field-full input,
.auth-modal-field-full textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #f1f5fb;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  outline: none;
}

.auth-modal-field select {
  background: rgba(255, 255, 255, 0.09);
}

.auth-modal-field-full textarea {
  min-height: 104px;
  padding-top: 12px;
  resize: vertical;
}

.auth-modal-field input:focus,
.auth-modal-field select:focus,
.auth-modal-field-full input:focus,
.auth-modal-field-full textarea:focus {
  border-color: #3978ff;
  box-shadow: 0 0 0 3px rgba(57, 120, 255, 0.14);
}

.auth-modal-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.auth-modal-secondary,
.auth-modal-primary {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.auth-modal-secondary {
  padding: 0 13px;
  color: #f1f5fb;
  background: rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.auth-modal-secondary:disabled {
  opacity: 0.62;
  cursor: default;
}

.auth-modal-primary {
  width: 100%;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #3978ff 58%, #63e7ff);
  box-shadow: 0 18px 38px rgba(57, 120, 255, 0.2);
}

.auth-modal-primary:hover,
.auth-modal-primary:focus-visible {
  background: linear-gradient(135deg, #2563eb, #3978ff 52%, #7beeff);
  box-shadow: 0 22px 46px rgba(57, 120, 255, 0.28);
}

.auth-modal-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: rgba(241, 245, 251, 0.64);
  font-size: 12px;
}

.auth-modal-options a,
.auth-modal-foot button {
  color: #3978ff;
}

.auth-modal-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.auth-modal-hint {
  margin-top: -2px;
  color: rgba(241, 245, 251, 0.62);
  font-size: 10px;
  line-height: 1.4;
}

.auth-modal-plan {
  display: inline-flex;
  width: max-content;
  padding: 5px 9px;
  border: 1px solid rgba(57, 120, 255, 0.26);
  border-radius: 999px;
  color: #3978ff;
  background: rgba(57, 120, 255, 0.06);
  font-size: 11px;
  font-weight: 720;
}

.auth-modal-plan[hidden],
.auth-modal-feedback[hidden] {
  display: none !important;
}

.auth-modal-feedback {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  color: #9eeaff;
  background: rgba(99, 231, 255, 0.1);
  font-size: 12px;
}

.auth-modal-feedback[data-state="error"] {
  color: #ffaaa0;
  background: rgba(255, 107, 87, 0.12);
}

.auth-modal-foot {
  margin: 6px 0 0;
  color: rgba(241, 245, 251, 0.62);
  font-size: 12px;
  text-align: center;
}

.auth-modal-foot button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 720;
}

@media (max-width: 720px) {
  .auth-modal-overlay {
    display: block;
  }

  .auth-modal-dialog {
    width: 100%;
    top: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    border-right: 0;
    border-radius: 20px 0 0 20px;
  }

  .auth-modal-overlay[data-auth-mode="register"] .auth-modal-dialog {
    height: 100%;
  }

  .auth-modal-body {
    padding: 64px 18px 36px;
  }

  .auth-modal-overlay[data-auth-mode="login"] [data-auth-panel="login"] {
    margin-top: 36px;
  }

  .auth-modal-field-grid {
    grid-template-columns: 1fr;
  }

  .auth-modal-group {
    padding: 16px;
  }

  .auth-modal-access-options {
    grid-template-columns: 1fr;
  }

  .auth-modal-payment-panel {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 13px;
  }

  .auth-modal-payment-panel > img {
    width: 112px;
    height: 112px;
  }

  .auth-modal-group-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-modal-inline {
    grid-template-columns: 1fr;
  }

  .auth-modal-options {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .auth-modal-overlay {
    animation: auth-modal-fade 160ms ease both;
  }

  .auth-modal-dialog {
    animation: auth-modal-slide 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

@keyframes auth-modal-fade {
  from {
    opacity: 0;
  }
}

@keyframes auth-modal-slide {
  from {
    transform: translateX(100%);
  }
}
