.auth-page,
.auth-page * { box-sizing: border-box; }

body:has(.auth-page) { background: #f4f4f4; }

.auth-page {
  min-height: 100dvh;
  width: min(100%, 850px);
  margin: 0 auto;
  display: block;
  background: #f4f4f4;
}

.auth-top-tabs {
  height: 106px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  padding: 0 10px;
  background: #fff;
}

.auth-top-tabs a {
  color: #090909;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.auth-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding: 0 10px 38px;
}

.auth-art {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: calc(100dvh - 144px);
  padding: 0;
  overflow: hidden;
  color: #fff;
  border-radius: 14px;
  background: #636980;
}

.auth-art::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(112deg, rgba(25, 24, 31, .84) 3%, rgba(31, 30, 38, .48) 47%, rgba(40, 36, 44, .1) 100%);
}

.auth-art::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 58%;
  aspect-ratio: 1;
  right: -18%;
  bottom: -24%;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
}

.auth-art > img {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.025);
}

.auth-art > .auth-art__content {
  align-self: flex-end;
  width: min(100%, 620px);
  margin: auto auto 0;
  padding: clamp(42px, 7vw, 104px);
  padding-top: 160px;
}

.auth-art__eyebrow,
.auth-form__eyebrow {
  display: block;
  color: #ffd7c6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  line-height: 1.4;
}

.auth-art h1 {
  max-width: 560px;
  margin: 16px 0 16px;
  font-size: clamp(38px, 4vw, 60px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.08;
}

.auth-art h1 em { color: #ffad90; font-style: normal; }

.auth-art p {
  max-width: 320px;
  margin: 0;
  color: rgba(255, 255, 255, .78);
  font-size: 15px;
  line-height: 1.7;
}

.auth-art__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 30px;
  color: rgba(255, 255, 255, .82);
  font-size: 12px;
}

.auth-art__badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.auth-form {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  align-self: stretch;
  min-width: 0;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 38px clamp(22px, 3.8vw, 42px);
  border-radius: 14px;
  background: #fff;
}

.auth-form__shell {
  width: min(100%, 408px);
  animation: auth-reveal .52s cubic-bezier(.16, 1, .3, 1) both;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  margin-bottom: 38px;
  color: #817c83;
  font-size: 13px;
  transition: color .24s cubic-bezier(.16, 1, .3, 1), transform .24s cubic-bezier(.16, 1, .3, 1);
}

.back i { font-size: 17px; line-height: 1; }
.back:hover { color: #2a282d; }
.back:active { transform: translateY(1px); }

.auth-form__intro { margin-bottom: 28px; }

.auth-logo {
  display: block;
  width: 54px;
  height: 54px;
  margin-bottom: 24px;
  border-radius: 17px;
  object-fit: cover;
  box-shadow: 0 12px 24px -16px rgba(95, 64, 67, .45);
}

.auth-form__eyebrow { color: #dd806d; }

.auth-form h2 {
  margin: 9px 0 8px;
  color: #211f24;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
}

.auth-form .muted {
  margin: 0;
  color: #827d84;
  font-size: 14px;
  line-height: 1.65;
}

.auth-form__message {
  display: none;
  margin: 0 0 20px;
  padding: 11px 13px;
  border: 1px solid #f3ceca;
  border-radius: 10px;
  background: #fff4f3;
  color: #bf5555;
  font-size: 13px;
  line-height: 1.5;
}

.auth-form__message.is-visible { display: block; }

.auth-login-methods { display: grid; gap: 14px; }
.auth-login-method { min-width: 0; }
.auth-login-method__content[hidden] { display: none; }
.auth-login-method.is-active > .auth-method-toggle { display: none; }

.auth-method-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: background .22s cubic-bezier(.16, 1, .3, 1), border-color .22s cubic-bezier(.16, 1, .3, 1), color .22s cubic-bezier(.16, 1, .3, 1), transform .22s cubic-bezier(.16, 1, .3, 1);
}

.auth-method-toggle:active { transform: translateY(1px); }
.auth-method-toggle i:first-child { font-size: 19px; line-height: 1; }
.auth-method-toggle i:last-child { margin-left: auto; font-size: 19px; line-height: 1; }

.auth-method-toggle--wechat {
  justify-content: flex-start;
  padding: 0 15px;
  border: 1px solid #a7dfbd;
  background: #f2fbf5;
  color: #078b46;
}

.auth-method-toggle--wechat:hover { border-color: #74c995; background: #eaf8ef; }

.auth-method-toggle--phone {
  min-height: 38px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #928c93;
  font-size: 13px;
}

.auth-method-toggle--phone::before,
.auth-method-toggle--phone::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ebe5e4;
}

.auth-method-toggle--phone::before { order: -1; }
.auth-method-toggle--phone span { padding: 0 3px; }
.auth-method-toggle--phone i { margin-left: 0; color: #aaa3aa; }
.auth-method-toggle--phone:hover { color: #5e585f; }
.auth-method-toggle--phone:hover::before,
.auth-method-toggle--phone:hover::after { background: #d9d1d1; }

.wechat-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  border: 1px solid #06a658;
  border-radius: 12px;
  background: #07c160;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  transition: background .24s cubic-bezier(.16, 1, .3, 1), transform .24s cubic-bezier(.16, 1, .3, 1), box-shadow .24s cubic-bezier(.16, 1, .3, 1);
}

.wechat-login-btn i { font-size: 20px; line-height: 1; }
.wechat-login-btn:hover { background: #06ad56; color: #fff; box-shadow: 0 12px 24px -18px rgba(6, 135, 71, .65); }
.wechat-login-btn:active { transform: translateY(1px); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 4px;
  color: #9b969d;
  font-size: 12px;
  line-height: 1;
}

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

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

.auth-field { display: grid; gap: 8px; margin-top: 0 !important; color: #38353b; }
.auth-field__label { font-size: 13px; font-weight: 750; line-height: 1.3; }

.auth-form input {
  width: 100%;
  min-height: 52px;
  border: 1px solid #e6e0e0;
  border-radius: 12px;
  padding: 0 14px;
  background: #fcfbfb;
  color: #242127;
  font-size: 15px;
  outline: none;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.auth-form input::placeholder { color: #b2adb2; }
.auth-form input:hover { border-color: #d6cece; }
.auth-form input:focus { border-color: #dd806d; background: #fff; box-shadow: 0 0 0 3px rgba(221, 128, 109, .12); }
.auth-form input.is-invalid { border-color: #d66b69; background: #fff8f7; box-shadow: 0 0 0 3px rgba(214, 107, 105, .1); }

.code-row { display: grid; grid-template-columns: minmax(0, 1fr) 124px; gap: 9px; }

.code-btn {
  min-height: 52px;
  padding: 0 10px;
  border: 1px solid #e8b9cc;
  border-radius: 12px;
  background: #fff5f9;
  color: #c95d8a;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease, opacity .2s ease;
}

.code-btn:hover:not(:disabled) { border-color: #d88eae; background: #ffedf5; }
.code-btn:active:not(:disabled) { transform: translateY(1px); }
.code-btn:disabled { cursor: wait; opacity: .7; }

.primary-btn.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  margin-top: 4px;
  border: 1px solid #c55f8c;
  border-radius: 12px;
  padding: 0 18px;
  background: #d66e99;
  color: #fff;
  font-size: 15px;
  transition: background .22s ease, transform .22s cubic-bezier(.16, 1, .3, 1), box-shadow .22s ease;
}

.primary-btn.auth-submit i { font-size: 18px; line-height: 1; }
.primary-btn.auth-submit:hover:not(:disabled) { background: #c85e8b; box-shadow: 0 14px 24px -19px rgba(167, 75, 113, .72); }
.primary-btn.auth-submit:active:not(:disabled) { transform: translateY(1px); }
.primary-btn.auth-submit:disabled { cursor: wait; opacity: .78; }
.auth-form--submitting .auth-field { opacity: .72; }

.form-tip { display: block; min-height: 20px; margin-top: 13px; color: #9c969d; font-size: 12px; line-height: 1.65; text-align: center; }

.auth-method-note { margin-top: 4px; padding: 14px; border: 1px solid #e9e3e2; border-radius: 12px; background: #faf8f8; color: #777178; font-size: 13px; line-height: 1.65; text-align: center; }

@keyframes auth-reveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-form__shell { animation: none; }
  .back, .wechat-login-btn, .code-btn, .primary-btn.auth-submit { transition: none; }
}

@media (max-width: 900px) {
  .auth-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .auth-art > .auth-art__content { padding: 42px; padding-top: 130px; }
  .auth-art h1 { font-size: 44px; }
  .auth-form { padding: 48px 38px; }
}

@media (max-width: 700px) {
  .auth-page { display: block; min-height: 100dvh; }
  .auth-top-tabs { height: 74px; padding: 0 4px; }
  .auth-top-tabs a { font-size: 16px; }
  .auth-stage { display: block; padding: 0 10px 38px; }
  .auth-art { min-height: 282px; height: 35dvh; max-height: 330px; }
  .auth-art::before { background: linear-gradient(105deg, rgba(25, 24, 31, .82), rgba(32, 29, 37, .28)); }
  .auth-art > .auth-art__content { align-self: flex-end; width: 100%; margin: auto 0 0; padding: 32px 24px 28px; }
  .auth-art h1 { margin: 10px 0 8px; font-size: 33px; line-height: 1.14; }
  .auth-art p { font-size: 13px; }
  .auth-art__meta { margin-top: 16px; }
  .auth-art__badge { min-height: 27px; }
  .auth-form { display: block; padding: 30px 24px max(42px, env(safe-area-inset-bottom)); }
  .auth-form__shell { width: 100%; max-width: 460px; margin: 0 auto; }
  .back { margin-bottom: 32px; }
  .auth-logo { width: 48px; height: 48px; margin-bottom: 19px; border-radius: 15px; }
  .auth-form__intro { margin-bottom: 25px; }
  .auth-form h2 { font-size: 30px; }
}

@media (max-width: 380px) {
  .auth-art { min-height: 260px; }
  .auth-art > .auth-art__content { padding-inline: 20px; }
  .auth-form { padding-inline: 20px; }
  .code-row { grid-template-columns: minmax(0, 1fr) 112px; gap: 7px; }
  .code-btn { font-size: 12px; }
}
