/* 登录/注册卡 — 布局借鉴 outlive159.com Auth.tsx，配色适配 ViZNA */

.auth-page-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem clamp(1rem, 4vw, 1.5rem) 2.5rem;
  min-height: calc(100dvh - 52px);
}

.auth-card-159 {
  --auth-cream: #f4efe4;
  --auth-raise: #121820;
  --auth-muted: #8b938c;
  --auth-gold: #d4af37;
  --auth-gold-ink: #1a1404;
  --auth-paper: #efe6d4;
  --auth-stack: 0.625rem;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(244, 239, 228, 0.15);
  background: var(--auth-raise);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.45);
}

/* 登录：内容高度自适应，避免 480px + space-evenly 拉成大块空白 */
.auth-card-159.auth-mode-login {
  height: auto;
}

/* 注册字段多，保留 outlive 固定卡高并可滚动 */
.auth-card-159.auth-mode-register {
  height: 480px;
}

.auth-card-159.auth-mode-forgot,
.auth-card-159.auth-mode-account {
  height: auto;
  min-height: 360px;
}

.auth-card-159__nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0 0.85rem;
  height: 58px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(244, 239, 228, 0.15);
}

.auth-card-159__tab {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(244, 239, 228, 0.45);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition: color 0.18s ease;
}

.auth-card-159__tab:hover {
  color: rgba(244, 239, 228, 0.82);
}

.auth-card-159__tab.is-active {
  color: var(--auth-cream);
}

.auth-card-159__tab.is-active::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 0;
  height: 2px;
  background: var(--auth-gold);
  border-radius: 1px;
}

.auth-card-159__home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  align-self: center;
  text-decoration: none;
  border-radius: 50%;
}

.auth-mark {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 248, 220, 0.95), rgba(240, 200, 120, 0.85) 42%, rgba(200, 140, 60, 0.9));
  box-shadow:
    0 0 0 1px rgba(212, 175, 55, 0.45),
    0 0 18px rgba(240, 200, 120, 0.35);
}

.auth-card-159__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 1.35rem;
}

.auth-card-159.auth-mode-login .auth-card-159__body {
  flex: 0 0 auto;
}

.auth-panel:not(.hidden) {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.auth-card-159.auth-mode-login .auth-panel:not(.hidden) {
  flex: 0 0 auto;
}

.auth-card-159__form {
  display: flex;
  flex-direction: column;
  gap: var(--auth-stack);
  padding: 0.55rem 0 0.35rem;
}

.auth-card-159__form.is-login {
  flex: 0 0 auto;
  padding: 0.55rem 0 0.25rem;
}

.auth-card-159__form.is-register {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.35rem 0 0.25rem;
  gap: 0.5rem;
  scrollbar-width: thin;
}

.auth-oauth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  flex-shrink: 0;
}

.auth-oauth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 38px;
  border-radius: 18px;
  border: 1px solid rgba(244, 239, 228, 0.2);
  background: var(--auth-cream);
  color: var(--auth-gold-ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.auth-oauth-btn:hover {
  filter: brightness(1.04);
}

.auth-oauth-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  font-size: 0.875rem;
  color: var(--auth-muted);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(244, 239, 228, 0.15);
}

.auth-field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--auth-muted);
  line-height: 1.3;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-shrink: 0;
}

.auth-field input,
.auth-field select {
  margin-top: 0;
  width: 100%;
  height: 2.75rem;
  border-radius: 10px;
  border: 1px solid rgba(244, 239, 228, 0.15);
  background: var(--auth-raise);
  color: var(--auth-cream);
  font-size: 16px;
  padding: 0 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s ease;
}

.auth-field.is-compact {
  gap: 0.2rem;
}

.auth-field.is-compact input,
.auth-field.is-compact select {
  height: 2.05rem;
  border-radius: 8px;
  padding: 0 0.75rem;
  font-size: 16px;
  line-height: 1.25;
}

.auth-field input:focus,
.auth-field select:focus {
  border-color: var(--auth-gold);
}

.auth-field select option {
  background: #121820;
  color: var(--auth-cream);
}

.auth-password-wrap {
  position: relative;
}

.auth-password-wrap input {
  margin-top: 0;
  padding-right: 4rem;
}

.auth-password-toggle {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  padding: 0 0.75rem;
  border: none;
  background: transparent;
  color: var(--auth-muted);
  font-size: 0.875rem;
  cursor: pointer;
  font-family: inherit;
}

.auth-password-toggle:hover {
  color: var(--auth-cream);
}

.auth-agree {
  flex-shrink: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--auth-muted);
}

.auth-status {
  flex-shrink: 0;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--auth-gold);
}

.auth-status:empty {
  display: none;
}

.auth-submit {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: var(--auth-paper);
  color: var(--auth-gold-ink);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.auth-submit.is-register {
  height: 38px;
  border-radius: 8px;
}

.auth-submit:hover:not(:disabled) {
  filter: brightness(1.05);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

.auth-card-159__foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 3rem;
  margin-top: 0;
  border-top: 1px solid rgba(244, 239, 228, 0.15);
  font-size: 13px;
}

.auth-mode-login #panel-login .auth-card-159__foot {
  margin-top: 0;
}

.auth-card-159__foot a {
  font-weight: 600;
  color: var(--auth-cream);
  text-decoration: none;
}

.auth-card-159__foot a:hover {
  text-decoration: underline;
}

.auth-panel-account {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.25rem 0;
  color: var(--auth-cream);
}

.auth-panel-account .auth-note {
  margin: 0;
  color: var(--auth-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.auth-panel-account .btn {
  align-self: flex-start;
}

.auth-panel-forgot .auth-field-label {
  margin-bottom: 0;
}

.auth-panel-forgot {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem 0 1rem;
}

.auth-forgot-lead {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--auth-muted);
}

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

body.auth-page .site-topbar {
  flex-shrink: 0;
}

body.auth-page .wrap.auth-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  max-width: none;
}

@media (max-width: 420px) {
  .auth-card-159.auth-mode-register {
    height: auto;
    max-height: min(480px, calc(100dvh - 5rem));
  }

  .auth-card-159__form.is-register {
    max-height: calc(100dvh - 12rem);
  }
}
