.login-body {
  min-height: 100svh;
  position: relative;
  isolation: isolate;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  font-family: Inter, 'Segoe UI', 'Noto Sans JP', 'Yu Gothic UI', sans-serif;
}

.login-body::before,
.login-body::after {
  content: '';
  position: fixed;
  z-index: -2;
  inset: 0;
  pointer-events: none;
}

.login-body::before {
  background: url('/assets/login/background.jpg') center / cover no-repeat;
}

.login-body::after {
  z-index: -1;
  background:
    radial-gradient(circle at 50% 45%, rgba(69, 37, 98, .08), transparent 42%),
    linear-gradient(rgba(3, 3, 4, .58), rgba(3, 3, 4, .72));
}

html[data-theme='light'] .login-body::after {
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .12), transparent 42%),
    linear-gradient(rgba(245, 243, 248, .28), rgba(237, 233, 241, .5));
}

.login-header {
  width: min(calc(100% - 40px), 1320px);
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px auto 0;
  padding: 0 14px 0 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(5, 5, 6, .76);
  backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .22);
}

html[data-theme='light'] .login-header {
  background: rgba(248, 246, 250, .78);
}

.login-header .theme-toggle {
  display: grid;
}

.login-main {
  min-height: calc(100svh - 102px);
  display: grid;
  place-items: center;
  padding: 40px 20px 72px;
}

.login-card {
  width: min(100%, 430px);
  padding: 42px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 24px;
  background: rgba(10, 9, 13, .82);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .52);
  text-align: center;
  backdrop-filter: blur(26px) saturate(118%);
}

.login-card.is-register {
  width: min(100%, 470px);
}

html[data-theme='light'] .login-card {
  border-color: rgba(23, 17, 31, .12);
  background: rgba(250, 248, 252, .84);
  box-shadow: 0 30px 90px rgba(37, 27, 45, .22);
}

.discord-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  border-radius: 16px;
  background: #5865f2;
  color: #fff;
}

.discord-mark.is-user-avatar {
  overflow: hidden;
  background: rgba(255, 255, 255, .08);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .14), 0 12px 30px rgba(0, 0, 0, .28);
}

.discord-mark.is-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discord-mark img,
.discord-button-icon img {
  width: 29px;
  height: 29px;
  display: block;
}

.login-card h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 2.65rem);
  line-height: 1.15;
  letter-spacing: -.055em;
}

.login-card > p:not(.auth-status) {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .94rem;
}

.discord-login-button {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-top: 30px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: #5865f2;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, filter .2s ease;
}

.discord-login-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.register-form {
  margin-top: 28px;
  text-align: left;
}

.register-field-label {
  display: block;
  margin-bottom: 9px;
  color: var(--text);
  font-size: .82rem;
  font-weight: 800;
}

.register-input-shell {
  min-height: 56px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, .055);
  transition: background .2s ease;
}

html[data-theme='light'] .register-input-shell {
  background: rgba(255, 255, 255, .62);
}

.register-input-shell:focus-within {
  background: rgba(255, 255, 255, .09);
}

html[data-theme='light'] .register-input-shell:focus-within {
  background: rgba(255, 255, 255, .86);
}

.register-prefix {
  flex: 0 0 auto;
  padding-left: 16px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}

.register-username-input {
  width: 100%;
  min-width: 0;
  height: 54px;
  padding: 0 16px 0 2px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
}

.register-username-input::placeholder {
  color: color-mix(in srgb, var(--muted) 68%, transparent);
}

.register-hint {
  min-height: 1.35em;
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.5;
}

.register-hint.is-error {
  color: #ff7d88;
}

.register-hint.is-available {
  color: #7ee787;
  font-weight: 700;
}

html[data-theme='light'] .register-hint.is-available {
  color: #137333;
}

.register-form .discord-login-button {
  margin-top: 20px;
}

.register-legal {
  margin: 12px 4px 0;
  color: var(--faint);
  font-size: .66rem;
  line-height: 1.7;
  text-align: center;
}

.register-legal a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 3px;
}

.register-legal a:hover { color: var(--text); }

.auth-switch {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: .3em;
  margin-top: 20px;
  color: var(--muted);
  font-size: .78rem;
  text-align: center;
}

.auth-switch[hidden] {
  display: none;
}

.auth-switch a {
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.auth-switch a:hover {
  color: var(--accent);
}

.discord-button-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
}

.discord-button-icon img {
  width: 24px;
  height: 24px;
}

.auth-status {
  margin: 13px 0 0;
  color: #ff9aa3;
  font-size: .78rem;
  line-height: 1.55;
}

.auth-status.is-progress {
  color: var(--muted);
}

.back-home {
  display: inline-block;
  margin-top: 22px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.back-home:hover {
  color: var(--text);
}

.discord-login-button:focus-visible,
.auth-switch a:focus-visible,
.back-home:focus-visible,
.login-header a:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.register-username-input:focus-visible {
  outline: none;
}

@media (max-width: 620px) {
  .login-header {
    width: calc(100% - 24px);
    height: 62px;
    margin-top: 10px;
    padding: 0 12px 0 16px;
    border-radius: 16px;
  }

  .login-header .brand {
    font-size: .92rem;
  }

  .login-header .brand-mark {
    width: 22px;
    height: 22px;
  }

  .login-main {
    min-height: calc(100svh - 72px);
    padding: 24px 12px 48px;
  }

  .login-body::before {
    background-position: 62% center;
  }

  .login-card {
    padding: 32px 22px;
    border-radius: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .discord-login-button {
    transition: none;
  }
}
