:root {
  color-scheme: dark;
  --night: #020814;
  --text: #edf4fb;
  --muted: #8ea4ba;
  --blue: #79c1ff;
  --line: rgba(118, 187, 249, 0.27);
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --sans: "Yu Gothic", "Hiragino Kaku Gothic ProN", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: #01050b; }
body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: #01050b;
  font-family: var(--serif);
}
button, input, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.login-background {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 32% 46%, rgba(17, 57, 94, 0.88), transparent 34%),
    radial-gradient(circle at 76% 42%, rgba(10, 39, 68, 0.64), transparent 28%),
    linear-gradient(135deg, #061426, var(--night) 55%, #01050b);
}
.login-background::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 20%, rgba(0, 4, 10, 0.64));
  box-shadow: inset 0 0 15vw rgba(0, 4, 10, 0.68);
}
.grid {
  position: absolute;
  inset: 0;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(83, 146, 204, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 146, 204, 0.08) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 42% 50%, black, transparent 74%);
}
.halo {
  position: absolute;
  aspect-ratio: 1;
  border: 1px solid rgba(96, 174, 241, 0.09);
  border-radius: 50%;
  box-shadow: 0 0 100px rgba(57, 133, 203, 0.08), inset 0 0 70px rgba(57, 133, 203, 0.03);
}
.halo-one { left: 13vw; top: 10vh; width: min(62vw, 780px); }
.halo-two { right: -16vw; bottom: -34vw; width: min(58vw, 720px); opacity: 0.5; }
.orbit {
  position: absolute;
  left: 27%;
  top: 51%;
  width: min(40vw, 520px);
  aspect-ratio: 1;
  border: 1px solid rgba(103, 190, 255, 0.07);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.orbit i {
  position: absolute;
  left: 50%;
  top: -2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9bd5ff;
  box-shadow: 0 0 18px 5px rgba(89, 175, 248, 0.48);
}
.stars i {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #9bd5ff;
  box-shadow: 0 0 9px rgba(98, 184, 255, 0.9);
  animation: star-pulse 4s ease-in-out infinite alternate;
}
.stars i:nth-child(1) { left: 9%; top: 22%; animation-delay: -1s; }
.stars i:nth-child(2) { left: 44%; top: 17%; animation-delay: -2.3s; }
.stars i:nth-child(3) { left: 73%; top: 14%; animation-delay: -0.4s; }
.stars i:nth-child(4) { left: 83%; top: 72%; animation-delay: -3s; }
.stars i:nth-child(5) { left: 17%; top: 78%; animation-delay: -1.8s; }
.stars i:nth-child(6) { left: 54%; top: 84%; animation-delay: -2.6s; }

.login-header, .login-main, .login-footer { position: relative; z-index: 2; }
.login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 clamp(24px, 4.5vw, 72px);
  background: linear-gradient(to bottom, rgba(1, 7, 15, 0.74), transparent);
}
.login-brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font: 10px var(--sans);
  letter-spacing: 0.25em;
  text-decoration: none;
}
.login-brand img { display: block; width: 88px; height: auto; }
.brand-divider { width: 1px; height: 14px; margin: 0 18px; background: rgba(142, 164, 186, 0.34); }
.brand-product { color: #a8b8c8; }
.language-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(118, 187, 249, 0.18);
  border-radius: 999px;
  background: rgba(5, 20, 35, 0.58);
  backdrop-filter: blur(10px);
}
.language-switch button {
  min-height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  color: #71879c;
  background: transparent;
  cursor: pointer;
  font: 10px var(--sans);
  letter-spacing: 0.08em;
  transition: color 0.2s, background 0.2s;
}
.language-switch button.active { color: #dcebf7; background: rgba(40, 93, 139, 0.42); }
.language-switch button:focus-visible, .login-brand:focus-visible, .login-footer a:focus-visible { outline: 1px solid var(--blue); outline-offset: 4px; }

.login-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  align-items: center;
  gap: clamp(54px, 8vw, 130px);
  width: min(1240px, calc(100% - 64px));
  min-height: calc(100svh - 152px);
  margin: 0 auto;
  padding: 48px 0 62px;
}
.login-intro { max-width: 670px; animation: intro-in 0.9s ease-out both; }
.intro-kicker, .panel-heading > p { margin: 0; color: var(--blue); font: 9px var(--sans); letter-spacing: 0.24em; }
.login-intro h1 {
  margin: 22px 0 24px;
  font-size: clamp(36px, 3.6vw, 56px);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.09em;
  text-shadow: 0 0 45px rgba(93, 175, 244, 0.08);
}
.intro-copy { margin: 0; color: #a9bac9; font-size: clamp(13px, 1.15vw, 16px); line-height: 2; letter-spacing: 0.06em; }
.intro-flow { display: flex; align-items: center; gap: 14px; margin-top: 42px; color: #567088; font: 8px var(--sans); letter-spacing: 0.14em; }
.intro-flow i { width: 34px; height: 1px; background: linear-gradient(90deg, rgba(121, 193, 255, 0.56), transparent); }

.login-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 3.2vw, 42px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(9, 31, 53, 0.93), rgba(3, 15, 27, 0.9));
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.35), inset 0 0 44px rgba(60, 135, 204, 0.045);
  backdrop-filter: blur(16px);
  animation: panel-in 0.8s 0.08s ease-out both;
}
.panel-glow { position: absolute; right: -90px; top: -100px; width: 220px; height: 220px; border-radius: 50%; background: rgba(75, 160, 234, 0.1); filter: blur(55px); }
.panel-heading, #loginForm { position: relative; z-index: 1; }
.panel-heading h2 { margin: 13px 0 10px; font-size: clamp(30px, 3vw, 40px); font-weight: 400; letter-spacing: 0.13em; }
.panel-heading > span { color: var(--muted); font: 12px var(--sans); line-height: 1.7; }
#loginForm { display: grid; gap: 21px; margin-top: 32px; }
.login-field { display: grid; gap: 9px; color: #90a7bb; font: 11px var(--sans); letter-spacing: 0.08em; }
.login-field input {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  border: 1px solid rgba(101, 170, 234, 0.24);
  border-radius: 8px;
  outline: 0;
  color: #eaf3fb;
  background: rgba(2, 14, 27, 0.72);
  caret-color: var(--blue);
  font: 13px var(--sans);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.login-field input::placeholder { color: #4f667b; }
.login-field input:hover { border-color: rgba(101, 170, 234, 0.4); }
.login-field input:focus { border-color: rgba(124, 196, 255, 0.72); background: rgba(3, 18, 34, 0.9); box-shadow: 0 0 0 3px rgba(72, 154, 228, 0.1), 0 0 24px rgba(77, 164, 244, 0.08); }
.login-field input:-webkit-autofill { -webkit-text-fill-color: #eaf3fb; box-shadow: 0 0 0 1000px #041529 inset; }
.password-control { position: relative; display: block; }
.password-control input { padding-right: 66px; }
.password-toggle {
  position: absolute;
  right: 7px;
  top: 50%;
  min-width: 48px;
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  color: #7490a8;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
  font: 10px var(--sans);
}
.password-toggle:hover, .password-toggle:focus-visible { color: #bddbf3; background: rgba(76, 144, 204, 0.09); outline: 0; }
.login-error {
  margin: -4px 2px -2px;
  color: #ff9b9b;
  font: 11px var(--sans);
  line-height: 1.6;
}
.login-error[hidden] { display: none; }
.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  min-height: 52px;
  margin-top: 7px;
  padding: 0 24px;
  border: 1px solid rgba(133, 190, 241, 0.58);
  border-radius: 999px;
  color: #edf6fd;
  background: linear-gradient(105deg, rgba(13, 45, 73, 0.92), rgba(18, 62, 98, 0.92));
  cursor: pointer;
  font: 12px var(--sans);
  letter-spacing: 0.09em;
  transition: opacity 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.login-submit:not(:disabled):hover, .login-submit:not(:disabled):focus-visible { border-color: #9bd5ff; box-shadow: 0 0 28px rgba(77, 164, 244, 0.25); outline: 0; transform: translateY(-1px); }
.login-submit:disabled { opacity: 0.42; cursor: not-allowed; }
.submit-arrow { color: var(--blue); font-size: 16px; }
.submit-spinner { display: none; width: 16px; height: 16px; border: 1px solid rgba(205, 232, 252, 0.28); border-top-color: #b8e0ff; border-radius: 50%; animation: spin 0.7s linear infinite; }
.login-submit.loading .submit-arrow { display: none; }
.login-submit.loading .submit-spinner { display: block; }

.login-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 clamp(24px, 4.5vw, 72px);
  color: #4f667a;
  font: 9px var(--sans);
  letter-spacing: 0.08em;
}
.login-footer a { display: inline-flex; align-items: center; gap: 10px; color: #7890a5; text-decoration: none; transition: color 0.2s; }
.login-footer a:hover { color: #c4dcec; }

@keyframes intro-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes panel-in { from { opacity: 0; transform: translateY(22px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes star-pulse { from { opacity: 0.28; transform: scale(0.8); } to { opacity: 0.9; transform: scale(1.25); } }

@media (max-width: 820px) {
  .login-main { grid-template-columns: 1fr; justify-items: center; width: min(100% - 40px, 480px); min-height: calc(100svh - 140px); padding: 34px 0 46px; }
  .login-intro { display: none; }
  .login-panel { width: 100%; }
  .orbit { left: 50%; width: min(100vw, 560px); }
  .halo-one { left: 50%; top: 14%; width: 80vw; transform: translateX(-50%); }
}

@media (max-width: 560px) {
  .login-header { min-height: 64px; padding-inline: 18px; }
  .brand-divider, .brand-product { display: none; }
  .language-switch button { min-height: 28px; padding-inline: 10px; }
  .login-main { width: min(100% - 28px, 440px); min-height: calc(100svh - 128px); padding: 24px 0 34px; }
  .login-panel { padding: 30px 22px; border-radius: 16px; }
  .panel-heading h2 { font-size: 31px; }
  .login-footer { min-height: 64px; padding: 0 18px; }
  .login-footer > span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
