.auth-page {
  color-scheme: light;
  --auth-blue: #1976ed;
  --auth-ink: #182b46;
  --auth-muted: #7a8aa0;
  background: #f4f7fc;
  color: var(--auth-ink);
}

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

.auth-shell {
  min-height: 100svh;
  background: #f4f7fc;
}

.auth-shell .ambient { display: none; }

.auth-page .auth-phone {
  max-width: 462px;
  min-height: 100svh;
  padding: 18px 22px calc(32px + env(safe-area-inset-bottom));
  border: 0;
  box-shadow: none;
  background: #fff;
}

.auth-topbar { min-height: 38px; display: flex; align-items: center; justify-content: space-between; }

.auth-icon-button,
.auth-language-toggle,
.password-toggle,
.auth-options button,
.auth-submit,
.auth-switch button,
.agreement-option button {
  border: 0;
  color: inherit;
  font: inherit;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.auth-icon-button {
  width: 34px;
  height: 34px;
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #e3ebf5;
  border-radius: 11px;
  color: #425771;
  background: #f7faff;
}

.auth-language-toggle {
  min-width: 42px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #e3ebf5;
  border-radius: 10px;
  color: #3974bd;
  background: #f7faff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .2px;
}

.auth-language-toggle:active { transform: scale(.97); }

.auth-back-glyph { width: 10px; height: 10px; position: relative; display: block; margin-left: 4px; border-bottom: 2px solid currentColor; border-left: 2px solid currentColor; transform: rotate(45deg); }
.auth-back-glyph::after { content: ""; width: 14px; height: 2px; position: absolute; left: -3px; bottom: -2px; border-radius: 99px; background: currentColor; transform: rotate(-45deg); transform-origin: left center; }

.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 36px; }
.auth-brand.compact { margin-top: 22px; }
.auth-brand-mark { width: 52px; height: 52px; flex-shrink: 0; display: grid; place-items: center; border-radius: 15px; color: #fff; background: var(--auth-blue); box-shadow: 0 7px 16px #1976ed1c; font-size: 21px; font-weight: 800; line-height: 1; letter-spacing: .3px; }
.auth-brand > span:last-child { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.auth-brand strong { max-width: 100%; font-size: 19px; line-height: 1.4; letter-spacing: 1.6px; overflow-wrap: anywhere; }
.auth-brand strong b { color: var(--auth-blue); }
.auth-brand small { color: var(--auth-muted); font-size: 10px; letter-spacing: .7px; }

.auth-heading { margin-top: 32px; text-align: center; }
.auth-heading.compact { margin-top: 24px; }
.auth-heading > span { color: #4ae1f6; font-size: 10px; letter-spacing: 1.6px; }
.auth-heading h1 { margin: 0; color: var(--auth-ink); font-size: 28px; line-height: 1.35; font-weight: 750; letter-spacing: -.5px; }
.auth-heading p { margin: 8px 0 0; color: var(--auth-muted); font-size: 13px; line-height: 1.7; }

.auth-card {
  margin-top: 24px;
  padding: 22px 19px 19px;
  border: 1px solid #e7eef7;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px #264e7d08;
}
.register-card { margin-top: 22px; padding-top: 19px; }
.auth-field { display: block; }
.auth-field + .auth-field { margin-top: 18px; }
.register-card .auth-field + .auth-field { margin-top: 14px; }
.auth-label { display: flex; align-items: center; gap: 5px; margin: 0 0 8px; color: #4d6079; font-size: 13px; line-height: 1.5; font-weight: 500; }
.auth-label small { color: #8a99ad; font-size: 10px; font-weight: 400; }
.auth-input-wrap { height: 50px; display: flex; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid #e2eaf5; border-radius: 11px; background: #f7faff; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.auth-input-wrap:focus-within { border-color: #7baff2; background: #fff; box-shadow: 0 0 0 3px #1976ed0c; }
.auth-input-wrap.error { border-color: #df687b; box-shadow: 0 0 0 3px #df687b0d; }
.auth-input-wrap input { min-width: 0; flex: 1; padding: 0; border: 0; outline: 0; color: var(--auth-ink); background: transparent; font: 500 14px/1.4 Inter, "PingFang SC", "Microsoft YaHei", sans-serif; }
.auth-input-wrap input::placeholder { color: #9aa9bc; font-weight: 400; }
.auth-field-icon { width: 18px; height: 18px; position: relative; flex: 0 0 18px; display: grid; place-items: center; color: #7996b9; font-style: normal; }
.user-field-icon::before { content: ""; width: 6px; height: 6px; position: absolute; top: 1px; border: 1.6px solid currentColor; border-radius: 50%; }
.user-field-icon::after { content: ""; width: 14px; height: 8px; position: absolute; bottom: 0; border: 1.6px solid currentColor; border-bottom: 0; border-radius: 10px 10px 0 0; }
.phone-field-icon::before { content: ""; width: 10px; height: 16px; position: absolute; top: 1px; left: 3px; border: 1.6px solid currentColor; border-radius: 3px; }
.phone-field-icon::after { content: ""; width: 3px; height: 1.5px; position: absolute; bottom: 3px; left: 7.5px; border-radius: 99px; background: currentColor; }
.lock-field-icon::before { content: ""; width: 13px; height: 11px; position: absolute; bottom: 1px; border: 1.6px solid currentColor; border-radius: 3px; }
.lock-field-icon::after { content: ""; width: 8px; height: 7px; position: absolute; top: 0; border: 1.6px solid currentColor; border-bottom: 0; border-radius: 7px 7px 0 0; }
.mail-field-icon { border: 1.6px solid currentColor; border-radius: 3px; }
.mail-field-icon::before,
.mail-field-icon::after { content: ""; width: 10px; height: 1.4px; position: absolute; top: 6px; background: currentColor; }
.mail-field-icon::before { left: 0; transform: rotate(32deg); }
.mail-field-icon::after { right: 0; transform: rotate(-32deg); }
.invite-field-icon::before,
.invite-field-icon::after { content: ""; width: 9px; height: 5px; position: absolute; border: 1.6px solid currentColor; border-radius: 6px; transform: rotate(-38deg); }
.invite-field-icon::before { top: 3px; right: 1px; }
.invite-field-icon::after { bottom: 3px; left: 1px; }
.password-toggle { width: 31px; height: 31px; position: relative; flex: 0 0 31px; display: grid; place-items: center; padding: 0; border-radius: 9px; color: #91a1b6; }
.password-toggle:active { background: #eaf2fd; transform: scale(.94); }
.eye-icon { width: 19px; height: 14px; position: relative; display: block; }
.eye-icon::before { content: ""; width: 15px; height: 10px; position: absolute; top: 1px; left: 2px; border: 1.6px solid currentColor; border-radius: 75% 18%; transform: rotate(45deg); }
.eye-icon::after { content: ""; width: 4px; height: 4px; position: absolute; top: 5px; left: 7px; border: 1.5px solid currentColor; border-radius: 50%; background: #f7faff; }
.password-toggle::after { content: ""; width: 22px; height: 1.6px; position: absolute; top: 15px; left: 4px; border-radius: 99px; background: currentColor; box-shadow: 0 0 0 2px #f7faff; transform: rotate(-45deg); transition: opacity .18s ease; }
.password-toggle.is-visible { color: var(--auth-blue); }
.password-toggle.is-visible::after { opacity: 0; }

.auth-options { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.auth-options > button { padding: 4px 0 4px 8px; color: #51dff5; font-size: 10px; }
.remember-option,
.agreement-option { display: flex; align-items: center; color: #8192af; font-size: 10px; cursor: pointer; }
.remember-option input,
.agreement-option input { position: absolute; opacity: 0; pointer-events: none; }
.remember-option > span,
.agreement-option > span { width: 15px; height: 15px; position: relative; flex: 0 0 15px; margin-right: 7px; border: 1px solid rgba(91,142,187,.5); border-radius: 4px; background: rgba(3,15,31,.8); }
.remember-option input:checked + span,
.agreement-option input:checked + span { border-color: #43ddf3; background: #26b8d2; }
.remember-option input:checked + span::after,
.agreement-option input:checked + span::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #07152b; font-size: 11px; font-weight: 900; }
.agreement-option { flex-wrap: wrap; margin-top: 15px; line-height: 1.55; }
.agreement-option button { padding: 0 2px; color: #4edff5; font-size: 10px; }

.auth-submit { width: 100%; height: 50px; display: grid; place-items: center; margin-top: 24px; border-radius: 11px; color: #fff; background: var(--auth-blue); box-shadow: 0 6px 14px #1976ed1c; font-size: 15px; font-weight: 650; letter-spacing: 1px; }
.auth-submit:disabled { opacity: .65; cursor: wait; }
.auth-switch { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid #edf2f8; color: var(--auth-muted); text-align: center; font-size: 12px; line-height: 1.6; }
.auth-switch button { padding: 4px; color: var(--auth-blue); font-weight: 500; }
.auth-security { margin: 22px 0 0; color: #94a1b3; text-align: center; font-size: 11px; line-height: 1.6; }
.auth-security span { color: #568ac8; }
.auth-page button:focus-visible { outline: 3px solid #a9cef9; outline-offset: 3px; }
.auth-page .toast { max-width: calc(100% - 40px); width: max-content; bottom: 28px; padding: 10px 16px; border: 1px solid #dfe8f4; border-radius: 12px; color: #35506f; background: #fff; box-shadow: 0 8px 28px #18375a1a; font-size: 12px; line-height: 1.6; text-align: center; white-space: normal; }
.auth-submit:active,
.auth-icon-button:active { transform: scale(.97); }

@media (max-width: 355px) {
  .auth-page .auth-phone { padding-inline: 16px; }
  .auth-brand { margin-top: 28px; }
  .auth-heading { margin-top: 26px; }
  .auth-card { padding-inline: 16px; }
  .register-phone .auth-brand { margin-top: 18px; }
  .register-phone .auth-heading { margin-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page *, .auth-page *::before, .auth-page *::after { transition: none !important; }
}
