:is(.upgrade-page, .legal-page) {
  --bg: #080910;
  --panel: #11111c;
  --panel-raised: #1b1929;
  --line: #2b2939;
  --line-strong: #4c4763;
  --text: #f3f1fc;
  --muted: #beb9cc;
  --subtle: #a59db4;
  --accent: #ae9eff;
  --cyan: #87efe1;
  color-scheme: dark;
  background-color: var(--bg);
  color: var(--text);
}
:is(.upgrade-page, .legal-page) .button.primary {
  background: #b6a9ff;
  border-color: #c9bdff;
  color: #171322;
}
:is(.upgrade-page, .legal-page) .button.primary:not(:disabled):hover { background: #cbbfff; }
:is(.auth-page, .upgrade-page, .legal-page) .button.secondary {
  background: var(--panel-raised); border-color: var(--line-strong); color: var(--text);
}
:is(.upgrade-page, .legal-page) .button.secondary:not(:disabled):hover { background: #2a243e; }
.auth-page .button.secondary:not(:disabled):hover { background: #233747; border-color: #79afbb; }

.access-header-actions { display: flex; align-items: center; justify-content: end; gap: clamp(.5rem, 1.8vw, 1.35rem); }
.access-header-actions :is(.button, .quiet-link) { white-space: nowrap; }
.access-header-actions :is(.access-locale, .access-locale select) { max-inline-size: 11rem; min-inline-size: 0; }
.auth-header, .access-header { min-height: 73px; border-color: var(--line); }
.auth-header {
  width: 100%; min-height: 67px; padding-inline: max(clamp(20px, 5vw, 77px), calc((100% - 1272px) / 2));
  background: var(--brand-header); border-color: #293345;
}
.auth-layout { width: min(100%, 1280px); }
.auth-header .brand { gap: .58rem; font-size: 1.36rem; font-weight: 680; letter-spacing: -.054em; }
.auth-stage .locale-select { background-color: var(--brand-header); border-color: var(--line); }
.auth-stage .locale-select:focus-visible { outline-color: var(--brand-mint); }
.auth-page .auth-stage {
  background: radial-gradient(ellipse at 12% 40%, #112c3d 0%, transparent 52%),
    radial-gradient(ellipse at 82% 23%, #292248a8, transparent 52%), var(--bg);
}
.auth-stage::before {
  background-image: radial-gradient(circle, #a9d1e4 0 .8px, transparent 1px);
  background-size: 22px 22px;
  opacity: .19;
  mask-image: radial-gradient(ellipse at 25% 35%, #000, transparent 72%);
}
.auth-page .auth-layout { gap: clamp(2rem, 8vw, 8rem); padding-block: clamp(2rem, 6vh, 5rem); }
.auth-context .auth-orbit {
  position: relative;
  isolation: isolate;
  width: min(100%, 27rem);
  height: clamp(158px, 25vh, 258px);
  margin-block-end: 1rem;
}
.auth-context .auth-orbit:has([data-intensity="off"]) { display: none; }
.auth-page .auth-context h2 {
  margin: 0;
  font-size: clamp(2.7rem, 4.5vw, 4.65rem);
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -.06em;
}
.auth-context h2 span:first-child { color: var(--text); }
.auth-page .auth-context h2 span:last-child {
  color: var(--brand-mint); background: var(--brand-highlight); background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-context h2:lang(zh), .auth-context h2:lang(ja), .auth-context h2:lang(ko) { line-height: 1.2; }
.auth-page .auth-context p { margin-top: 1.15rem; max-width: 27rem; color: var(--muted); }
.auth-page .auth-card {
  position: relative;
  max-width: 29rem;
  background: linear-gradient(138deg, #152534, #101a29 56%, #121929);
  border: 1px solid #3b5063;
  border-radius: 13px;
  box-shadow: 0 26px 70px #03030775;
}
.auth-card::before {
  position: absolute; content: ""; height: 1px; top: -1px; inset-inline: 10% 48%;
  background: linear-gradient(90deg, transparent, #8ddfcf 35%, #96c8e3 65%, transparent);
}
.auth-page .auth-switch {
  gap: 0; padding: 0; margin-block-end: 1.65rem;
  background: none; border: 0; border-block-end: 1px solid var(--line); border-radius: 0;
}
.auth-page .auth-switch button {
  position: relative; min-height: 44px; border-radius: 0; padding-block: .65rem; font-weight: 600; border: 0;
}
.auth-page .auth-switch button[aria-pressed="true"] { background: transparent; color: var(--brand-mint); }
.auth-page .auth-switch button[aria-pressed="true"]::after {
  content: ""; position: absolute; inset: auto 0 -1px; height: 2px; background: var(--accent);
}
.auth-page .auth-switch button:not(:disabled):hover { color: var(--text); background: #1a2c3c; }
.auth-page .auth-card h1 { font-weight: 640; line-height: 1.16; }
.auth-page .auth-form { gap: 1rem; margin-top: 1.6rem; }
.auth-connection { display: flex; align-items: flex-start; gap: .65rem; padding: .75rem .8rem; margin-top: 1.1rem; background: #183038a6; border: 1px solid #36575d; border-radius: 8px; }
.auth-connection strong { font-size: .83rem; font-weight: 550; color: var(--brand-ink); }
.auth-connection p { margin: .2rem 0 0; font-size: .78rem; line-height: 1.5; color: var(--muted); }
.auth-connection .text-button { margin-top: .35rem; font-size: .8rem; }
.auth-connection-signal { flex: 0 0 auto; width: 8px; height: 8px; margin-top: .35rem; border-radius: 50%; background: var(--brand-mint); box-shadow: 0 0 0 4px #8ee4c818; animation: auth-connecting 1.6s ease-in-out infinite; }
@keyframes auth-connecting { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .auth-connection-signal { animation: none; } }
.auth-page .auth-form input:not([type=checkbox]) {
  min-inline-size: 0; background: #0a1320; border-color: #566b80; border-radius: 8px;
}
.auth-form input::placeholder { color: #95a7bd; opacity: 1; }
.auth-form label:focus-within > span:first-child { color: var(--brand-mint); }
.auth-page .auth-form input:not([type=checkbox]):focus-visible {
  outline: 2px solid var(--brand-mint); outline-offset: 2px; border-color: var(--brand-mint);
}
.auth-page .auth-form input[type=email], .auth-page .auth-form input[name=code] { text-align: start; }
.auth-page .auth-form .button.primary { margin-block-start: .25rem; }
.auth-page .auth-legal { align-items: flex-start; gap: .65rem; }
.auth-page .auth-legal input { width: 18px; height: 18px; flex: none; accent-color: var(--brand-mint); }
.auth-page .auth-legal p { margin-top: .2rem; }
.auth-page .auth-legal a { color: #a6dff4; }
.auth-page .auth-legal a:hover, .auth-page .auth-email-tools button:hover { color: var(--brand-mint); }
.auth-page .auth-email-tools { flex-wrap: wrap; }
.auth-page .auth-email-tools button { min-height: 40px; }
.legal-page .legal-document a { color: var(--cyan); }
.legal-page .legal-document { max-width: 57rem; }
.legal-page .legal-language-note {
  padding: 1rem 1.1rem; border: 1px solid var(--line-strong); border-radius: .65rem;
  background: var(--panel); color: var(--muted);
}

@media (max-width: 810px) {
  .auth-page .auth-layout { align-content: center; gap: .5rem; padding-block: 1rem 2rem; }
  .auth-page .auth-context { display: block; justify-self: center; width: 100%; }
  .auth-page .auth-context :is(h2, p) { display: none; }
  .auth-context .auth-orbit { margin: 0 auto; width: min(100%, 17rem); height: clamp(78px, 13vh, 120px); }
}
@media (max-height: 680px) and (max-width: 810px) {
  .auth-page .auth-context { display: none; }
}
@media (max-width: 760px) { .access-header nav { display: none; } }
@media (max-width: 560px) {
  .auth-header, .access-header { min-height: 64px; }
  .auth-page .access-home-link { display: none; }
  .access-header-actions { gap: .5rem; }
  .access-header-actions :is(.access-locale, .access-locale select) { max-inline-size: 7.5rem; }
  .auth-page .auth-code-field { grid-template-columns: minmax(0, 1fr); }
  .auth-page .auth-code-field .button { justify-self: start; }
}
@media (max-width: 365px) {
  .access-header { padding-inline: .85rem; gap: .45rem; }
  .access-header .brand { font-size: 1.05rem; gap: .4rem; }
  .access-header-actions :is(.access-locale, .access-locale select) { max-inline-size: 5.5rem; }
  .access-header-actions .button { padding-inline: .6rem; }
}
@media (forced-colors: active) {
  .auth-page .auth-context h2 span:last-child { -webkit-text-fill-color: CanvasText; }
  .auth-page .auth-switch button[aria-pressed="true"] { border-block-end: 2px solid Highlight; }
}
