:root {
  font-family: "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif;
  color: #201b32;
  background: #fbfafe;
  --surface: #fff;
  --muted: #645e75;
  --line: #e5e0ed;
  --accent: #5535ac;
  --accent-hover: #452793;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 280px; }
a { color: var(--accent); }
button, input { font: inherit; }
button, .language-toggle summary, .locale-options a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid #7453d7;
  outline-offset: 4px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.125rem;
  height: 2.125rem;
  flex: 0 0 auto;
  border-radius: 0.625rem;
  background: #6d4dd1;
  color: #fff;
}

.brand-mark::before {
  content: "";
  width: 0.79rem;
  height: 0.79rem;
  border: 2px solid currentColor;
  border-radius: 50% 50% 50% 3px;
  transform: rotate(-45deg);
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  min-height: 100svh;
  background: var(--surface);
}

.brand-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fcfaff;
  background:
    radial-gradient(ellipse at 70% 92%, #452a76, transparent 65%),
    linear-gradient(132deg, #171029, #25163e 66%, #31204b);
}

.brand-panel {
  display: grid;
  align-content: start;
  min-height: 575px;
  margin: 16px 0 16px 16px;
  padding: clamp(24px, 4.1vw, 55px);
  border-radius: 23px;
}

.brand-panel .brand { justify-self: start; position: relative; z-index: 1; }
.brand-panel .brand-mark { background: #ece3ff; color: #432478; }

.art {
  position: absolute;
  top: 54%;
  left: 52%;
  width: min(83%, 560px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.art::before {
  content: "";
  position: absolute;
  inset: -30%;
  background-image:
    linear-gradient(#e6d7ff15 1px, transparent 1px),
    linear-gradient(90deg, #e6d7ff15 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse, #0009, transparent 66%);
}

.orbit,
.art-center,
.satellite { position: absolute; display: block; }
.orbit { border: 1px solid #e6d7ff38; border-radius: 50%; }
.orbit-outside { inset: 1%; border-style: dashed; }
.orbit-inside { inset: 14%; box-shadow: inset 0 0 48px #c9a6ff12; }
.orbit-tilted { inset: 26% 4%; transform: rotate(-26deg); border-color: #ddc6ff75; }

.art-center {
  inset: 30%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 24%, #f5dfff, #b998f1 27%, #7d54c9 49%, #3b2065 78%);
  box-shadow: 0 0 86px #b389f357, inset -7px -12px 24px #2412396b;
}

.satellite { width: 2.7%; aspect-ratio: 1; border-radius: 50%; }
.satellite-top { top: 15%; left: 68%; background: #ead9ff; box-shadow: 0 0 18px #e1ccffb0; }
.satellite-bottom { top: 70%; left: 14%; background: #a885dd; box-shadow: 0 0 16px #ac8aff80; }

.login-main {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.login-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 34px clamp(24px, 4.2vw, 60px) 0;
}

.mobile-brand { display: none; }

.language-toggle { position: relative; min-width: 0; }

.language-toggle summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f6fb;
  color: #452783;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 650;
  list-style: none;
}

.language-toggle summary::-webkit-details-marker { display: none; }
.language-toggle summary:hover, .language-toggle[open] summary { background: #efe8fa; }
.locale-name { display: block; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.language-globe {
  display: grid;
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(transparent calc(50% - 0.5px), currentColor calc(50% - 0.5px), currentColor calc(50% + 0.5px), transparent calc(50% + 0.5px));
}

.language-globe::before {
  content: "";
  width: 7px;
  height: 13px;
  border-inline: 1px solid currentColor;
  border-radius: 50%;
}

.language-chevron {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  margin: -3px 2px 0;
  transform: rotate(45deg);
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
}

.language-toggle[open] .language-chevron { margin-top: 3px; transform: rotate(225deg); }

.locale-options {
  position: absolute;
  z-index: 4;
  inset-block-start: calc(100% + 7px);
  inset-inline-end: 0;
  width: min(15rem, calc(100vw - 32px));
  max-height: min(23rem, 55svh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 10px 28px #21133926;
}

.locale-options a {
  display: block;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.locale-options a:focus-visible { outline-offset: -3px; }
.locale-options a:hover, .locale-options a[aria-current] { background: #ece5f9; color: #452783; }

.login-box {
  align-self: center;
  justify-self: center;
  width: min(100% - 48px, 410px);
  padding-block: 48px 86px;
}

h1, h2, p { margin: 0; }

h1 {
  font-size: clamp(2.45rem, 4vw, 3.6rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.06em;
}

:lang(zh-CN) h1 { letter-spacing: -0.035em; }
.intro { margin-top: 15px; color: var(--muted); line-height: 1.6; }
.credentials { display: grid; gap: 20px; margin-top: 31px; }
.field { display: grid; gap: 9px; }
.field label { font-size: 0.9375rem; font-weight: 650; }

.field input {
  width: 100%;
  min-height: 50px;
  padding: 10px 14px;
  border: 1px solid #d9d3e4;
  border-radius: 9px;
  color: inherit;
  background: var(--surface);
}

.field input:hover { border-color: #a49ab7; }
.field input:focus { border-color: var(--accent); }

.primary,
.secondary {
  min-height: 42px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 650;
  cursor: pointer;
}

.primary {
  min-height: 50px;
  margin-top: 5px;
  background: var(--accent);
  color: #fff;
}

.primary:hover { background: var(--accent-hover); }
.secondary { border-color: var(--line); background: var(--surface); color: #2e2540; }
.secondary:hover { background: #f4effc; }

.form-error {
  margin-top: 20px;
  padding: 11px 13px;
  border: 1px solid #f0c9ce;
  border-radius: 8px;
  background: #fff3f4;
  color: #913043;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.missing { width: min(100% - 48px, 550px); margin: 15vh auto 0; }
.missing a { display: inline-block; margin-top: 20px; }

@media (max-width: 730px) {
  .login-layout { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .mobile-brand { display: block; }
  .login-header { justify-content: space-between; padding-top: 24px; }
  .login-box { align-self: start; padding-block: clamp(72px, 14vh, 128px) 44px; }
}

@media (max-width: 460px) {
  .login-header { gap: 8px; padding-inline: 16px; }
  .login-box { width: calc(100% - 32px); }
  .brand { gap: 7px; }
  .brand-mark { width: 1.85rem; height: 1.85rem; }
}
