.auth-page {
  --auth-ink: #0f172a;
  --auth-copy: #475569;
  --auth-muted: #64748b;
  --auth-line: #dbe3ef;
  --auth-paper: #fff;
  --auth-teal: #2dd4bf;
  --auth-link: #0f766e;
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100svh;
  margin: 0;
  padding: clamp(16px, 4vw, 48px);
  background: #eff2f6;
  color: var(--auth-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

.auth-page *, .auth-page *::before, .auth-page *::after { box-sizing: inherit; }

.auth-canvas, .auth-brand-background {
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.auth-canvas { position: fixed; z-index: -1; color: var(--auth-ink); }

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  width: min(100%, 1000px);
  min-height: 600px;
  overflow: hidden;
  border: 1px solid #d7dde7;
  border-radius: 20px;
  background: var(--auth-paper);
  box-shadow: 0 2px 4px #0f172a08, 0 22px 46px -12px #0f172a2b;
}

.auth-brand {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  padding: 38px clamp(28px, 3.5vw, 42px);
  overflow: hidden;
  background: linear-gradient(155deg, #0c1420, #111d2d);
  color: #f8fafc;
}

.auth-brand-background { position: absolute; z-index: -1; }

.auth-beta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  border: 1px solid #ffffff16;
  border-radius: 999px;
  background: #ffffff0d;
  color: #cbd5e1;
  font-size: 15px;
  font-weight: 600;
  line-height: 21px;
}

.auth-beta span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--auth-teal);
  box-shadow: 0 0 9px #2dd4bf99;
}

.auth-wordmark {
  color: #f8fafc;
  font-size: clamp(36px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1;
}
.auth-wordmark span { color: var(--auth-teal); }
.auth-wordmark::after {
  content: "";
  display: block;
  width: 35px;
  height: 2px;
  margin-block: 17px 20px;
  border-radius: 2px;
  background: var(--auth-teal);
}

.auth-brand-description {
  max-width: 358px;
  margin: 0;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1.56;
}
.auth-brand-subtitle {
  margin: 16px 0 0;
  color: #a5b4c6;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: .02em;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 46px clamp(28px, 4vw, 52px);
}
.auth-content { width: min(100%, 420px); }

.auth-content h1 {
  margin: 0 0 28px;
  font-size: 30px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.02em;
}

.auth-field { margin-block-end: 20px; }
.auth-field:last-of-type { margin-block-end: 24px; }
.auth-field label { display: block; color: #334155; font-size: 15px; font-weight: 500; line-height: 24px; }
.auth-field > label, .auth-label-row { margin-block-end: 6px; }
.auth-label-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.auth-forgot {
  padding: 0 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--auth-copy);
  font-size: 14px;
  line-height: 24px;
  cursor: pointer;
}
.auth-forgot:hover { color: var(--auth-ink); text-decoration: underline; text-underline-offset: .18em; }

.auth-field input {
  display: block;
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--auth-line);
  border-radius: 11px;
  padding: 10px 17px;
  background: var(--auth-paper);
  color: var(--auth-ink);
  caret-color: var(--auth-ink);
  font-size: 17px;
}
.auth-field input::placeholder { color: var(--auth-muted); }
.auth-field input:hover { border-color: #aebcd0; }
.auth-field input:focus { border-color: var(--auth-link); outline: 2px solid #0f766e38; outline-offset: 1px; }
.auth-field input[aria-invalid="true"] { border-color: var(--danger); }

.auth-password { position: relative; }
.auth-password input { padding-inline-end: 55px; }
.auth-password input::-ms-reveal { display: none; }
.password-toggle {
  position: absolute;
  inset-block: 4px;
  inset-inline-end: 6px;
  display: grid;
  place-items: center;
  width: 44px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
}
.password-toggle:hover { background: #f1f5f9; color: var(--auth-ink); }
.password-toggle .auth-eye-off, .password-visible .auth-eye { display: none; }
.password-visible .auth-eye-off { display: block; }

.auth-hint, .field-error { margin: 7px 0 0; font-size: 13px; line-height: 1.5; }
.auth-hint { color: var(--auth-copy); }
.auth-recovery { padding: 8px 12px; border-radius: 7px; background: #f1f5f9; }
.auth-recovery a { color: var(--auth-ink); text-underline-offset: .18em; }
.field-error, .form-status { color: var(--danger); }
.form-status { margin: 0 0 16px; font-size: 14px; line-height: 1.5; }
.form-status:empty { margin: 0; }

.auth-submit {
  width: 100%;
  min-height: 50px;
  padding: 10px 16px;
  border: 0;
  border-radius: 11px;
  background: #101728;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}
.auth-submit:hover:not(:disabled) { background: #1e293b; }
.auth-submit:disabled { opacity: .7; cursor: wait; }
.auth-content :is(a, button):focus-visible { outline: 2px solid #294c73; outline-offset: 3px; }

.auth-switch { margin: 24px 0 0; color: var(--auth-muted); font-size: 16px; line-height: 24px; }
.auth-switch a { margin-inline-start: 8px; color: var(--auth-link); font-weight: 500; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; text-underline-offset: .2em; }

.auth-notice {
  width: 100%;
  padding: 15px 20px;
  border: 1px solid #ffffff12;
  border-radius: 10px;
  background: #ffffff08;
  color: #a5b4c6;
  font-size: 15px;
  line-height: 1.6;
}
.auth-notice h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: #cbd5e1;
  font-size: 15px;
  font-weight: 600;
  line-height: 24px;
}
.auth-notice h2 svg { flex: none; color: #a5b4c6; }
.auth-notice ol { margin: 0; padding: 0; list-style-position: inside; }
.auth-notice li + li { margin-block-start: 8px; }
.auth-notice a {
  color: #5eead4;
  font: 15px/1.6 var(--mono);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.auth-notice a:hover { text-decoration: underline; text-underline-offset: .18em; }
.auth-notice a:focus-visible { outline: 2px solid #5eead4; outline-offset: 3px; }

@media (max-width: 820px) {
  .auth-layout {
    width: min(100%, 480px);
    min-height: auto;
    grid-template-columns: minmax(0, 1fr);
    border-radius: 16px;
  }
  .auth-brand { gap: 18px; padding: 22px 24px; }
  .auth-beta { min-height: 26px; padding: 2px 10px; font-size: 12px; }
  .auth-wordmark { font-size: 34px; }
  .auth-wordmark::after { width: 28px; margin-block: 12px; }
  .auth-brand-description { font-size: 14px; }
  .auth-brand-subtitle { margin-top: 9px; font-size: 13px; }
  .auth-notice { padding: 10px 12px; font-size: 13px; }
  .auth-notice h2 { margin-bottom: 4px; font-size: 14px; }
  .auth-notice a { font-size: 13px; }
  .auth-panel { padding: 28px 24px 32px; }
  .auth-content h1 { margin-block-end: 24px; font-size: 24px; }
  .auth-field, .auth-field:last-of-type { margin-block-end: 18px; }
  .auth-field input, .auth-submit { min-height: 48px; }
  .auth-switch { margin-block-start: 18px; }
}
