.auth-brand {
  position: fixed;
  top: 0;
  left: 20px;
  z-index: 110;
  height: 44px;
}

body.page-auth {
  overflow: hidden;
}

body.page-auth .site-main {
  padding-top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.auth-page {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

.auth-page__left {
  flex: 1;
  min-width: 0;
  background: var(--color-bg, #f7f8fa);
}

.auth-bing {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background-color: #1d2129;
  background-image: var(--auth-bing-image);
  background-size: cover;
  background-position: center;
}

.auth-bing--fallback {
  background-image: linear-gradient(135deg, #1d2129 0%, #4e5969 100%);
}

.auth-bing__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.18) 0%, rgba(15, 23, 42, 0.08) 38%, rgba(15, 23, 42, 0.72) 100%),
    linear-gradient(90deg, rgba(15, 23, 42, 0.28) 0%, rgba(15, 23, 42, 0) 42%);
  pointer-events: none;
}

.auth-bing__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  padding: 48px 40px 44px;
  color: #fff;
}

.auth-bing__badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-bing__title {
  margin-top: 16px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.auth-bing__desc {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.88);
}

.auth-bing__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 18px;
}

.auth-bing__meta-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.auth-bing__meta-item dt {
  flex-shrink: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.58);
}

.auth-bing__meta-item dd {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
}

.auth-bing__link {
  display: inline-flex;
  align-items: center;
  margin-top: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  opacity: 0.92;
}

.auth-bing__link:hover {
  opacity: 1;
  text-decoration: underline;
}

body.page-auth .auth-brand .topbar__logo-img {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.28));
}

.auth-panel {
  flex: 0 0 380px;
  width: 380px;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.04);
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 36px 40px;
  box-shadow: none;
}

.auth-card__head {
  margin-bottom: 20px;
}

.auth-card__title {
  font-size: 22px;
  font-weight: 700;
  color: #1d2129;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.auth-card__brand {
  font-weight: 700;
}

.auth-card__subtitle {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 400;
  color: #86909c;
  line-height: 1.55;
}

.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  height: 38px;
  margin: 16px 0 14px;
  padding: 3px;
  background: #f2f3f5;
  border-radius: 9px;
  box-sizing: border-box;
  --tab-index: 0;
}

.auth-tabs__indicator {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / 2);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  transform: translateX(calc(var(--tab-index, 0) * 100%));
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  will-change: transform;
}

.auth-tabs__btn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #86909c;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.auth-tabs__btn:hover:not(.is-active) {
  color: #4e5969;
}

.auth-tabs__btn.is-active {
  color: #1677ff;
}

.auth-panels {
  min-height: 248px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.auth-field--row {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.auth-float {
  position: relative;
  width: 100%;
}

.auth-float--grow {
  flex: 1;
  min-width: 0;
}

.auth-float--icon .auth-float__input {
  padding-left: 38px;
}

.auth-float__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #86909c;
  pointer-events: none;
  transition: color 0.2s ease;
}

.auth-float__icon svg {
  display: block;
  width: 16px;
  height: 16px;
}

.auth-float--icon:focus-within .auth-float__icon {
  color: #1677ff;
}

.auth-float--icon .auth-float__label {
  left: 38px;
}

.auth-float--icon .auth-float__input:focus + .auth-float__label,
.auth-float--icon .auth-float__input:not(:placeholder-shown) + .auth-float__label,
.auth-float--icon .auth-float__input.has-value + .auth-float__label {
  left: 34px;
}

.auth-float__input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font-size: 13px;
  line-height: 44px;
  color: #1d2129;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-float__input:focus,
.auth-float__input:not(:placeholder-shown),
.auth-float__input.has-value {
  padding-top: 15px;
  padding-bottom: 5px;
  line-height: 22px;
}

.auth-float__input::placeholder {
  color: transparent;
}

.auth-float__input:hover {
  border-color: rgba(22, 119, 255, 0.35);
}

.auth-float__input:focus {
  outline: none;
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

.auth-float__label {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 4px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  color: #86909c;
  background: #fff;
  pointer-events: none;
  transform-origin: left center;
  transition: top 0.18s ease, transform 0.18s ease, font-size 0.18s ease, color 0.18s ease;
}

.auth-float__input:focus + .auth-float__label,
.auth-float__input:not(:placeholder-shown) + .auth-float__label,
.auth-float__input.has-value + .auth-float__label {
  top: 0;
  transform: translateY(-50%) scale(1);
  font-size: 11px;
  color: #86909c;
}

.auth-float__input:focus + .auth-float__label {
  color: #1677ff;
}

.auth-code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.auth-code-row .auth-btn {
  flex-shrink: 0;
  height: 44px;
  padding: 0 14px;
}

.auth-code-row .auth-float__input {
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

.auth-btn {
  height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.auth-btn--primary {
  background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
  color: #fff;
}

.auth-btn--primary:hover {
  filter: brightness(1.03);
}

.auth-btn--code {
  background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
  color: #fff;
}

.auth-btn--code:hover:not(:disabled) {
  filter: brightness(1.03);
}

.auth-btn--ghost {
  padding: 0 14px;
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
  color: #1677ff;
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-hint {
  font-size: 12px;
  color: #86909c;
  line-height: 1.6;
}

.auth-hint--top {
  margin-bottom: 4px;
}

.auth-alert {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.auth-alert--error {
  background: #fff1f0;
  color: #cf1322;
  border: 1px solid #ffccc7;
}

.auth-alert--success {
  background: #f6ffed;
  color: #389e0d;
  border: 1px solid #b7eb8f;
}

.auth-actions-footer {
  margin: 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: #86909c;
}

.auth-actions-footer a {
  color: #86909c;
  text-decoration: none;
}

.auth-actions-footer a:hover {
  color: #4e5969;
}

.auth-actions-footer__sep {
  margin: 0 6px;
  color: #c9cdd4;
}

.auth-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: #86909c;
}

.auth-link {
  color: #1677ff;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: #fff;
  background: rgba(29, 33, 41, 0.92);
  z-index: 9999;
}

.auth-toast.is-error {
  background: rgba(207, 19, 34, 0.95);
}

.auth-toast.is-success {
  background: rgba(56, 158, 13, 0.95);
}

body.page-auth .toast-host {
  top: 12px;
}

@media (max-width: 768px) {
  body.page-auth {
    overflow: auto;
  }

  body.page-auth .site-main {
    height: auto;
    overflow: visible;
  }

  .auth-page {
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .auth-page__left {
    flex: 0 0 auto;
    min-height: 220px;
  }

  .auth-bing__content {
    max-width: none;
    padding: 28px 24px 24px;
  }

  .auth-bing__title {
    font-size: 22px;
  }

  .auth-bing__desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .auth-bing__meta {
    margin-top: 14px;
  }

  .auth-bing__link {
    margin-top: 14px;
  }

  .auth-panel {
    flex: 1;
    width: 100%;
    min-height: 0;
    border-left: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: none;
  }

  .auth-card {
    padding: 32px 24px 40px;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 28px 20px 36px;
  }

  .auth-code-row {
    flex-direction: column;
  }
}
