/* Desktop authentication: scene, branding, reusable fields, actions, expanded forms. */
/* Local atmosphere/containment revision: 20261015_atmosphere_containment. */
#login-screen {
  --auth-size: min(100vw, max(640px, 100dvh));
  --auth-unit: calc(var(--auth-size) / 1254);
  --auth-frame-unit: var(--auth-unit);
  --auth-cyan: #25dafa;
  --auth-violet: #a34ced;
  --auth-pink: #ef50eb;
  --auth-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='m19 13 11 11-11 11' fill='none' stroke='%23cf83f4' stroke-width='4'/%3E%3C/svg%3E");
  font-family: Arial, "Segoe UI", sans-serif;
}
#login-screen.login-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  padding: 0;
  background: #020316;
  overflow: auto;
}
#login-screen.hidden { display: none; }
#login-screen .login-bg {
  display: block;
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #03051c url("assets/auth/space-wallpaper-wide.png") center / cover no-repeat;
  pointer-events: none;
}
#login-screen .login-bg > span { display: none; }
#login-screen .auth-scene-effects {
  position: fixed;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#login-screen .login-stage {
  flex: none;
  width: var(--auth-size);
  min-height: var(--auth-size);
  padding: calc(var(--auth-unit) * 150) calc(var(--auth-unit) * 243) calc(var(--auth-unit) * 128);
  gap: 0;
  background: transparent;
}
#login-screen .login-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 0 solid transparent;
  border-image-source: url("assets/auth/frame-transparent.png");
  border-image-slice: 150 220 fill;
  border-image-width: calc(var(--auth-frame-unit) * 150) calc(var(--auth-frame-unit) * 220);
  border-image-repeat: stretch;
  pointer-events: none;
}
#login-screen .login-stage::before {
  content: "";
  position: absolute;
  inset: 10% 15.5% 8%;
  z-index: -1;
  background: linear-gradient(180deg, transparent, #03061de8 7%, #03061de8 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  pointer-events: none;
}
.auth-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The title is an independent decorative logo, with a real accessible heading. */
#login-screen .brand-block { width: 100%; gap: 0; }
#login-screen .brand-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--auth-unit) * 35);
  width: 100%;
  font-family: Arial, sans-serif;
  font-size: calc(var(--auth-unit) * 20);
  line-height: calc(var(--auth-unit) * 30);
  font-weight: 600;
  letter-spacing: calc(var(--auth-unit) * 8);
  color: #99c8ef;
  white-space: nowrap;
}
#login-screen .brand-kicker::before,
#login-screen .brand-kicker::after {
  content: "";
  width: calc(var(--auth-unit) * 138);
  height: calc(var(--auth-unit) * 6);
  background: radial-gradient(circle at 97% 50%, #22c9f3 0 2px, transparent 3px), linear-gradient(90deg, transparent, #317bab) left center / 90% 1px no-repeat;
}
#login-screen .brand-kicker::after { transform: scaleX(-1); }
#login-screen .logo {
  position: relative;
  flex: none;
  width: calc(var(--auth-unit) * 656);
  height: calc(var(--auth-unit) * 112);
  margin: calc(var(--auth-unit) * 8) 0 0;
  background: none;
  color: transparent;
  text-shadow: none;
}
#login-screen .logo::before {
  content: "";
  position: absolute;
  inset: -35.7143% -6.09756%;
  background: url("assets/auth/logo.png") 50% 13.93597% / 170.3804% auto no-repeat;
  pointer-events: none;
}
#login-screen .logo::after {
  content: "";
  position: absolute;
  inset: -35.7143% -6.09756%;
  background: linear-gradient(110deg, transparent 36%, #a9eeff66 44%, #ffffffed 48%, #ffb5fa99 51%, transparent 60%) 130% 0 / 280% 100% no-repeat;
  mask: url("assets/auth/logo.png") 50% 13.93597% / 170.3804% auto no-repeat;
  mix-blend-mode: screen;
  opacity: .8;
  animation: auth-logo-shimmer 7s cubic-bezier(.22, 1, .36, 1) infinite;
  animation-play-state: paused;
  pointer-events: none;
}
#login-screen.auth-motion-enabled .logo::after { animation-play-state: running; }
@keyframes auth-logo-shimmer {
  0%, 12% { background-position: 130% 0; opacity: 0; }
  18% { opacity: .85; }
  62% { opacity: .75; }
  75%, 100% { background-position: -120% 0; opacity: 0; }
}
#login-screen .brand-note {
  max-width: calc(var(--auth-unit) * 600);
  margin: calc(var(--auth-unit) * 14) 0 0;
  color: #a6a7bc;
  font-size: calc(var(--auth-unit) * 25.3);
  line-height: calc(var(--auth-unit) * 35);
  font-weight: 400;
}
#login-screen .login-shell {
  width: 100%;
  max-width: none;
  margin-top: calc(var(--auth-unit) * 23);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
}
#login-screen .login-shell::before,
#login-screen .login-shell::after { content: none; }

/* Every auth input reuses the same field and icon structure. */
#login-screen .login-form { gap: calc(var(--auth-unit) * 18); }
#login-screen .auth-field {
  --field-accent: var(--auth-cyan);
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: calc(var(--auth-unit) * 102);
  border: max(1px, calc(var(--auth-unit) * 2)) solid transparent;
  border-radius: calc(var(--auth-unit) * 22);
  background: linear-gradient(110deg, #07122e, #050a23 58%, #07091e) padding-box,
    linear-gradient(160deg, #49dbf5, #3863ad 44%, #4676bc 70%, #335f95) border-box;
  box-shadow: inset 0 3px 12px #213f7144, 0 0 15px #0b88f022;
}
#login-screen .auth-field--lock {
  --field-accent: #a958e9;
  height: calc(var(--auth-unit) * 100);
  background: linear-gradient(110deg, #0b102f, #070921 70%) padding-box,
    linear-gradient(120deg, #7cbded, #7f3eb4 42%, #7541a9 76%, #3da5be) border-box;
}
#login-screen .auth-field:focus-within { outline: 2px solid var(--field-accent); outline-offset: 3px; }
#login-screen .auth-field-icon {
  position: absolute;
  left: calc(var(--auth-unit) * 27);
  display: grid;
  place-items: center;
  width: calc(var(--auth-unit) * 75);
  height: calc(var(--auth-unit) * 75);
  border: calc(var(--auth-unit) * 2) solid transparent;
  border-radius: 50%;
  color: var(--field-accent);
  background: linear-gradient(#092249, #070d2b) padding-box,
    linear-gradient(var(--field-accent), #2941a4) border-box;
  box-shadow: 0 0 10px #176fe133, inset 0 0 9px #2267d033;
  pointer-events: none;
}
#login-screen .auth-field--lock .auth-field-icon {
  background: linear-gradient(#21103c, #0b082c) padding-box,
    linear-gradient(#c879f0, #56269d) border-box;
}
#login-screen .auth-field-icon svg { width: 60%; height: 60%; filter: drop-shadow(0 0 1px currentColor); }
#login-screen .auth-field input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 calc(var(--auth-unit) * 94) 0 calc(var(--auth-unit) * 137);
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: #e7e8f6;
  font: 400 calc(var(--auth-unit) * 27) / 1.25 Arial, sans-serif;
  box-shadow: none;
  transform: none;
}
#login-screen .auth-field input::placeholder { color: #9699b3; opacity: 1; }
#login-screen .auth-field input:focus { outline: 0; background: transparent; box-shadow: none; transform: none; }
#login-screen .auth-field input:-webkit-autofill { -webkit-text-fill-color: #e7e8f6; box-shadow: inset 0 0 0 1000px #080d29; }
#login-screen .login-form .auth-password-toggle {
  position: absolute;
  right: calc(var(--auth-unit) * 21);
  display: grid;
  place-items: center;
  width: max(44px, calc(var(--auth-unit) * 57));
  height: max(44px, calc(var(--auth-unit) * 57));
  min-height: 0;
  padding: calc(var(--auth-unit) * 7);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #78ccff;
  box-shadow: none;
}
#login-screen .auth-password-toggle svg { width: 100%; height: 100%; filter: drop-shadow(0 0 4px #438afa88); }
#login-screen .auth-password-toggle[aria-pressed="true"] { color: #f19cf2; }

/* Shared action geometry; pseudo-icons survive the existing toggle text updates. */
#login-screen .login-form > button,
#login-screen .register-toggle {
  width: 100%;
  font-family: Arial, sans-serif;
  letter-spacing: 0;
  transition: filter 150ms ease, background-color 150ms ease;
}
#login-screen .login-form > button {
  height: calc(var(--auth-unit) * 98);
  min-height: 0;
  margin-top: calc(var(--auth-unit) * 6);
  padding: 0 calc(var(--auth-unit) * 90);
  border: calc(var(--auth-unit) * 2) solid transparent;
  border-radius: calc(var(--auth-unit) * 22);
  background: radial-gradient(ellipse at 9% 0%, #06e5ff99, transparent 43%) padding-box,
    linear-gradient(110deg, #0069ef, #1645ed 34%, #7431f0 62%, #d000e5 94%) padding-box,
    linear-gradient(105deg, #6affff, #74a1ff 40%, #f9a8ff) border-box;
  color: #fff;
  font-size: calc(var(--auth-unit) * 36);
  font-weight: 700;
  box-shadow: inset 0 0 13px #4aeaff80, 0 0 20px #165dfa88, 6px 0 20px #df00f555;
}
#login-screen .login-form > button::before,
#login-screen .register-toggle::before { transform: none; transition: none; }
#login-screen .login-form > button::before {
  content: "";
  position: absolute;
  inset: auto 23% 22%;
  width: auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, #bda7ff33, transparent);
  filter: blur(1px);
}
#login-screen #login-form > button::after {
  content: "";
  position: absolute;
  right: calc(var(--auth-unit) * 22);
  top: 50%;
  transform: translateY(-50%);
  width: calc(var(--auth-unit) * 66);
  height: calc(var(--auth-unit) * 66);
  border: calc(var(--auth-unit) * 2) solid #fff;
  border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M10 24h27m-11-11 11 11-11 11' fill='none' stroke='white' stroke-width='3.5'/%3E%3C/svg%3E") center / 75% no-repeat;
  box-shadow: 0 0 7px #ffb0ff, inset 0 0 7px #ffb0ff;
}
#login-screen .auth-divider {
  display: flex;
  align-items: center;
  gap: calc(var(--auth-unit) * 32);
  margin: calc(var(--auth-unit) * 31) 0 calc(var(--auth-unit) * 24);
  color: #8ba6ce;
  font-size: calc(var(--auth-unit) * 16);
  line-height: calc(var(--auth-unit) * 24);
  letter-spacing: calc(var(--auth-unit) * 7);
  white-space: nowrap;
}
#login-screen .auth-divider::before,
#login-screen .auth-divider::after {
  content: "";
  flex: 1;
  height: 6px;
  background: radial-gradient(circle at 2% 50%, #8143b9 0 2px, transparent 3px), radial-gradient(circle at 98% 50%, #16c7eb 0 2px, transparent 3px), linear-gradient(90deg, #444581, #35466e55) center / 90% 1px no-repeat;
}
#login-screen .auth-divider::after { transform: scaleX(-1); }
#login-screen .register-block { margin: 0; gap: calc(var(--auth-unit) * 14); }
#login-screen .auth-action {
  --action-color: #c451e7;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='20' cy='15' r='8' fill='%23ce53ed'/%3E%3Cpath d='M5 41v-3c0-7 6-12 15-12 8 0 14 5 14 12v3Z' fill='%23ce53ed'/%3E%3Cpath d='M38 20v14m-7-7h14' stroke='%23ce53ed' stroke-width='3'/%3E%3C/svg%3E");
  height: calc(var(--auth-unit) * 90);
  min-height: 0;
  padding: 0 calc(var(--auth-unit) * 85) 0 calc(var(--auth-unit) * 137);
  border: max(1px, calc(var(--auth-unit) * 2)) solid transparent;
  border-radius: calc(var(--auth-unit) * 21);
  background: linear-gradient(110deg, #0a102d, #070820 75%) padding-box,
    linear-gradient(125deg, #57338b, #392967 52%, #62388a) border-box;
  color: #d1d1e5;
  text-align: left;
  font-size: calc(var(--auth-unit) * 27);
  font-weight: 400;
  box-shadow: inset 0 3px 10px #51247833;
}
#login-screen .auth-action--verify {
  --action-color: #22cfe9;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Crect x='7' y='12' width='34' height='26' rx='2' fill='none' stroke='%2322d3ee' stroke-width='3.5'/%3E%3Cpath d='m9 15 15 13 15-13' fill='none' stroke='%2322d3ee' stroke-width='3.5'/%3E%3C/svg%3E");
  color: #8bbfea;
  background: linear-gradient(110deg, #07132e, #070820 75%) padding-box, linear-gradient(125deg, #3d4895, #2c3066 52%, #573c95) border-box;
}
#login-screen .auth-action--reset {
  --action-color: #ea52d9;
  --action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='30' cy='16' r='10' fill='none' stroke='%23eb58dd' stroke-width='4'/%3E%3Cpath d='M23 23 9 39m4-5 6 5m-2-10 6 5' fill='none' stroke='%23eb58dd' stroke-width='4'/%3E%3C/svg%3E");
  background: linear-gradient(110deg, #0c102c, #070820 75%) padding-box, linear-gradient(125deg, #5c317b, #3c2b61 52%, #823383) border-box;
}
#login-screen .auth-action::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(var(--auth-unit) * 28);
  transform: translateY(-50%);
  width: calc(var(--auth-unit) * 74);
  height: calc(var(--auth-unit) * 74);
  border: calc(var(--auth-unit) * 2) solid var(--action-color);
  border-radius: 50%;
  background: var(--action-icon) center / 65% no-repeat, radial-gradient(circle, #30113e66, #080b28 70%);
  box-shadow: 0 0 8px #9144c744, inset 0 0 8px #9144c722;
}
#login-screen .auth-action::after {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(var(--auth-unit) * 28);
  transform: translateY(-50%);
  width: calc(var(--auth-unit) * 53);
  height: calc(var(--auth-unit) * 53);
  border: calc(var(--auth-unit) * 2) solid #b66bdd;
  border-radius: 50%;
  background: var(--auth-arrow) center / 75% no-repeat;
}
#login-screen #reset-toggle::before {
  background: var(--action-icon) center / 65% no-repeat, radial-gradient(circle, #30113e66, #080b28 70%);
}
#login-screen .auth-action--reset::after {
  border-color: #bd52b4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='m19 13 11 11-11 11' fill='none' stroke='%23e578d9' stroke-width='4'/%3E%3C/svg%3E");
}
#login-screen #reset-toggle:hover {
  background: linear-gradient(110deg, #0c102c, #070820 75%) padding-box, linear-gradient(125deg, #6c3a90, #463272 52%, #993c9a) border-box;
  color: #d1d1e5;
  box-shadow: inset 0 3px 10px #51247833;
}
#login-screen .login-form button:hover:not(:disabled),
#login-screen .register-toggle:hover,
#login-screen #reset-toggle:hover { transform: none; filter: brightness(1.15); }
#login-screen .login-form .auth-password-toggle:hover { background: #28417044; box-shadow: none; }
#login-screen .register-toggle:hover::before { transform: translateY(-50%); }
#login-screen .register-toggle:focus-visible,
#login-screen .login-form button:focus-visible { outline: 2px solid #a1eaff; outline-offset: 4px; }
#login-screen .auth-field { transition: box-shadow 180ms ease-out; }
#login-screen .auth-field:focus-within { box-shadow: inset 0 3px 12px #213f7144, 0 0 15px #438cff55; }
#login-screen .auth-action::after { transition: transform 180ms ease-out; }
#login-screen .auth-action:hover::after { transform: translate(2px, -50%); }
#login-screen .login-form button:disabled { opacity: .5; filter: saturate(.5); cursor: not-allowed; }
#login-screen .register-form { margin: calc(var(--auth-unit) * 4) 0 calc(var(--auth-unit) * 12); }
#login-screen .register-form > button { font-size: calc(var(--auth-unit) * 26); }
#login-screen .avatar-picker,
#login-screen .color-picker,
#login-screen .auth-feedback,
#login-screen .auth-hint,
#login-screen .login-captcha-panel { font-size: max(14px, calc(var(--auth-unit) * 19)); }
#login-screen .avatar-upload button { min-height: 36px; font-size: 14px; padding: 8px 12px; }
#login-screen .color-picker input { width: 48px; height: 36px; padding: 3px; }
#login-screen .login-captcha-panel { background: #070c25; border-color: #606ea8; }

/* Compact Desktop browser widths keep the same actions with readable hit targets. */
@media (max-width: 600px) {
  #login-screen { --auth-size: 100vw; --auth-unit: 1px; --auth-frame-unit: calc(132vw / 1254); }
  #login-screen .login-stage { width: 100%; min-height: 100dvh; padding: 42px 22px 44px; background-size: auto 100%; overflow: clip; }
  #login-screen .login-stage::after { left: -16%; right: -16%; }
  #login-screen .brand-kicker { font-size: 12px; line-height: 22px; letter-spacing: 4px; gap: 12px; }
  #login-screen .brand-kicker::before, #login-screen .brand-kicker::after { width: 48px; flex: 1; }
  #login-screen .logo { width: min(100%, 348px); height: auto; aspect-ratio: 656 / 112; margin-top: 8px; }
  #login-screen .brand-note { max-width: 340px; font-size: 16px; line-height: 23px; margin-top: 14px; }
  #login-screen .login-shell { margin-top: 24px; }
  #login-screen .login-form { gap: 12px; }
  #login-screen .auth-field, #login-screen .auth-field--lock { height: 58px; border-radius: 14px; }
  #login-screen .auth-field-icon { left: 10px; width: 40px; height: 40px; }
  #login-screen .auth-field input { padding: 0 52px 0 64px; font-size: 16px; }
  #login-screen .login-form .auth-password-toggle { width: 44px; height: 44px; right: 6px; padding: 8px; }
  #login-screen .login-form > button { height: 58px; margin-top: 4px; border-radius: 14px; font-size: 22px; padding: 0 60px; }
  #login-screen #login-form > button::after { width: 38px; height: 38px; right: 11px; }
  #login-screen .auth-divider { margin: 23px 0 20px; font-size: 10px; letter-spacing: 3px; line-height: 18px; gap: 14px; }
  #login-screen .register-block { gap: 12px; }
  #login-screen .auth-action { height: 58px; border-radius: 14px; font-size: 16px; padding: 0 48px 0 64px; }
  #login-screen .auth-action::before { width: 42px; height: 42px; left: 9px; }
  #login-screen .auth-action::after { width: 30px; height: 30px; right: 12px; }
  #login-screen .register-form > button { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  #login-screen *, #login-screen *::before, #login-screen *::after { animation: none; transition: none; }
  #login-screen .auth-scene-effects, #login-screen .logo::after { display: none; }
  #login-screen .logo::after { animation: none; }
}
