:root {
  --night-950: #040a08;
  --night-925: #07100d;
  --night-900: #0a1310;
  --night-875: #0d1714;
  --mint-300: #9af3cf;
  --mint-400: #7ceec2;
  --mint-500: #59d9a8;
  --violet-500: #8d82e6;
  --text-primary: #ecf6f1;
  --text-secondary: #8da29a;
  --text-muted: #5f746c;
  --danger: #ef8f91;
  --line: rgba(154, 192, 177, 0.2);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
}

html {
  color-scheme: dark;
  background: var(--night-950);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text-primary);
  background: var(--night-900);
  font-family: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0 44% 0 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  background:
    radial-gradient(
      circle at 9% 14%,
      rgba(236, 246, 241, 0.5) 0 0.7px,
      transparent 1.2px
    ),
    radial-gradient(
      circle at 18% 36%,
      rgba(124, 238, 194, 0.6) 0 0.9px,
      transparent 1.5px
    ),
    radial-gradient(
      circle at 29% 21%,
      rgba(236, 246, 241, 0.36) 0 0.6px,
      transparent 1.1px
    ),
    radial-gradient(
      circle at 37% 67%,
      rgba(154, 243, 207, 0.5) 0 1px,
      transparent 1.7px
    ),
    radial-gradient(
      circle at 46% 45%,
      rgba(236, 246, 241, 0.42) 0 0.8px,
      transparent 1.35px
    ),
    radial-gradient(
      circle at 55% 18%,
      rgba(141, 130, 230, 0.42) 0 1px,
      transparent 1.7px
    ),
    radial-gradient(
      circle at 66% 61%,
      rgba(124, 238, 194, 0.5) 0 0.8px,
      transparent 1.4px
    ),
    radial-gradient(
      circle at 76% 34%,
      rgba(236, 246, 241, 0.42) 0 0.7px,
      transparent 1.3px
    ),
    radial-gradient(
      circle at 87% 77%,
      rgba(154, 243, 207, 0.45) 0 1px,
      transparent 1.65px
    ),
    radial-gradient(
      ellipse at 43% 56%,
      rgba(48, 158, 116, 0.14),
      transparent 28%
    ),
    radial-gradient(
      ellipse at 70% 36%,
      rgba(85, 76, 156, 0.07),
      transparent 25%
    ),
    linear-gradient(135deg, #030806, var(--night-950) 54%, #06100c);
  border-right: 1px solid rgba(147, 207, 184, 0.1);
}

body::after {
  z-index: 1;
  opacity: 0.55;
  background:
    radial-gradient(
      ellipse at 49% 57%,
      transparent 0 27%,
      rgba(124, 238, 194, 0.09) 27.2%,
      transparent 27.6%
    ),
    radial-gradient(
      ellipse at 49% 57%,
      transparent 0 38%,
      rgba(124, 238, 194, 0.05) 38.15%,
      transparent 38.45%
    ),
    radial-gradient(
      ellipse at 49% 57%,
      transparent 0 49%,
      rgba(141, 130, 230, 0.04) 49.15%,
      transparent 49.4%
    ),
    linear-gradient(
      90deg,
      rgba(2, 7, 5, 0.55),
      transparent 18%,
      transparent 77%,
      rgba(2, 7, 5, 0.62)
    ),
    linear-gradient(
      0deg,
      rgba(2, 7, 5, 0.75),
      transparent 25%,
      transparent 78%,
      rgba(2, 7, 5, 0.32)
    );
}

.gzf-starfield-canvas {
  position: fixed;
  z-index: 2;
  inset: 0 auto auto 0;
  display: block;
  pointer-events: none;
}

button,
input {
  font: inherit;
}

a,
button,
input {
  -webkit-tap-highlight-color: transparent;
}

.pf-v5-c-login,
.pf-c-login,
.login-pf-page {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  background: transparent;
}

.pf-v5-c-login__container,
.pf-c-login__container {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: clamp(52px, 7vh, 84px) clamp(48px, 7vw, 108px) clamp(48px, 7vh, 80px)
    calc(56% + clamp(42px, 6vw, 96px));
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.014), transparent 25%),
    radial-gradient(
      circle at 0 50%,
      rgba(67, 185, 139, 0.045),
      transparent 34%
    ),
    linear-gradient(90deg, transparent 0 56%, var(--night-900) 56%);
}

#kc-header {
  position: fixed;
  z-index: 8;
  top: clamp(28px, 4.8vw, 68px);
  left: clamp(28px, 5vw, 76px);
  width: calc(56vw - 56px);
  color: rgba(236, 246, 241, 0.92);
  text-align: left;
  pointer-events: none;
}

#kc-header-wrapper {
  padding: 0;
  color: inherit;
  font-family: "Songti SC", "STSong", serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.18em;
  text-transform: none;
  white-space: nowrap;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
}

.pf-v5-c-login__main,
.pf-c-login__main {
  width: min(100%, 480px);
  max-width: 480px;
  margin: 0;
  padding: clamp(30px, 3vw, 44px);
  color: var(--text-primary);
  background: rgba(7, 16, 13, 0.62);
  border: 1px solid rgba(154, 192, 177, 0.16);
  border-radius: 14px;
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.32),
    inset 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(18px);
}

.pf-v5-c-login__main-header,
.pf-c-login__main-header,
.pf-v5-c-login__main-body,
.pf-c-login__main-body,
.pf-v5-c-login__main-footer,
.pf-c-login__main-footer {
  padding: 0;
  color: inherit;
  background: transparent;
}

#kc-page-title {
  margin: 0 0 36px;
  color: var(--text-primary);
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(34px, 3vw, 46px);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.035em;
  text-align: left;
}

#kc-form,
#kc-form-login {
  width: 100%;
}

.form-group,
.pf-v5-c-form__group,
.pf-c-form__group {
  margin: 0 0 22px;
}

label,
.pf-v5-c-form__label-text,
.pf-c-form__label-text {
  display: block;
  margin: 0 0 9px;
  color: #b7c8c1;
  font-size: 12px;
  font-weight: 570;
  line-height: 1.5;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 0 16px;
  color: var(--text-primary);
  caret-color: var(--mint-400);
  background: rgba(4, 11, 8, 0.46);
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.018);
  font-size: 14px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder {
  color: #52675f;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  background: rgba(6, 16, 12, 0.72);
  border-color: rgba(124, 238, 194, 0.72);
  box-shadow:
    0 0 0 3px rgba(89, 217, 168, 0.1),
    0 12px 34px rgba(0, 0, 0, 0.18);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary);
  caret-color: var(--mint-400);
  -webkit-box-shadow: 0 0 0 1000px #07110d inset;
  border-color: rgba(124, 238, 194, 0.55);
  transition: background-color 9999s ease-out 0s;
}

.pf-v5-c-input-group,
.pf-c-input-group {
  width: 100%;
}

.pf-v5-c-form-control,
.pf-c-form-control {
  width: 100%;
  min-width: 0;
  color: var(--text-primary);
  background: transparent;
}

.pf-v5-c-input-group__item.pf-m-fill,
.pf-c-input-group__item.pf-m-fill {
  width: auto;
  min-width: 0;
  flex: 1 1 auto;
}

.pf-v5-c-input-group__item:not(.pf-m-fill),
.pf-c-input-group__item:not(.pf-m-fill) {
  width: auto;
  flex: 0 0 auto;
}

button[data-password-toggle],
.pf-v5-c-button.pf-m-control,
.pf-c-button.pf-m-control {
  min-width: 48px;
  color: #739087;
  background: rgba(4, 11, 8, 0.46);
  border-color: var(--line);
}

button[data-password-toggle]:hover,
.pf-v5-c-button.pf-m-control:hover,
.pf-c-button.pf-m-control:hover {
  color: var(--mint-400);
  background: rgba(6, 16, 12, 0.72);
}

#kc-login,
input[type="submit"],
.pf-v5-c-button.pf-m-primary,
.pf-c-button.pf-m-primary {
  width: 100%;
  min-height: 58px;
  margin-top: 6px;
  color: #06110d;
  background: var(--mint-400);
  border: 1px solid var(--mint-400);
  border-radius: 7px;
  box-shadow: 0 12px 36px rgba(51, 185, 137, 0.14);
  font-size: 14px;
  font-weight: 680;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

#kc-login:hover,
input[type="submit"]:hover,
.pf-v5-c-button.pf-m-primary:hover,
.pf-c-button.pf-m-primary:hover {
  color: #06110d;
  background: var(--mint-300);
  border-color: var(--mint-300);
  box-shadow: 0 16px 42px rgba(51, 185, 137, 0.2);
  transform: translateY(-1px);
}

#kc-login:disabled,
input[type="submit"]:disabled {
  color: rgba(6, 17, 13, 0.62);
  cursor: wait;
  transform: none;
}

a {
  color: var(--text-secondary);
  text-decoration-color: rgba(124, 238, 194, 0.25);
  text-underline-offset: 4px;
}

a:hover {
  color: var(--mint-400);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(124, 238, 194, 0.32);
  outline-offset: 3px;
}

#kc-form-options,
.login-pf-settings {
  margin: -4px 0 18px;
  color: var(--text-secondary);
  font-size: 12px;
}

#kc-registration,
.login-pf-signup,
.pf-v5-c-login__main-footer-band,
.pf-c-login__main-footer-band {
  display: none;
}

.alert,
.pf-v5-c-alert,
.pf-c-alert {
  margin: 0 0 24px;
  padding: 12px 14px;
  color: #e6b8b9;
  background: rgba(239, 143, 145, 0.07);
  border: 0;
  border-left: 2px solid var(--danger);
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.6;
}

.gzf-login-status {
  min-height: 18px;
  margin: -22px 0 16px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.gzf-field-error {
  margin: 7px 0 0;
  color: var(--danger);
  font-size: 11px;
  line-height: 1.5;
}

.gzf-field-error[hidden] {
  display: none;
}

[aria-invalid="true"] {
  border-color: rgba(239, 143, 145, 0.72) !important;
}

.gzf-login-footer {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 12px;
  line-height: 1.5;
}

.gzf-login-footer__link {
  color: var(--text-secondary);
}

#kc-info,
.pf-v5-c-login__main-footer,
.pf-c-login__main-footer {
  color: var(--text-secondary);
  font-size: 12px;
}

@media (max-width: 980px) {
  body::before,
  body::after {
    right: 52%;
  }

  .pf-v5-c-login__container,
  .pf-c-login__container {
    padding-right: 44px;
    padding-left: calc(48% + 44px);
    background: linear-gradient(90deg, transparent 0 48%, var(--night-900) 48%);
  }

  #kc-header {
    width: calc(48vw - 48px);
  }
}

@media (max-width: 720px) {
  body::before,
  body::after {
    inset: 0 0 auto;
    height: 210px;
    border-right: 0;
    border-bottom: 1px solid rgba(147, 207, 184, 0.1);
  }

  .gzf-starfield-canvas {
    right: 0;
  }

  .pf-v5-c-login__container,
  .pf-c-login__container {
    min-height: 100dvh;
    padding: 255px 24px 56px;
    display: block;
    background: var(--night-900);
  }

  #kc-header {
    top: 25px;
    left: 24px;
    width: calc(100vw - 48px);
  }

  #kc-header-wrapper {
    font-size: 13px;
  }

  .pf-v5-c-login__main,
  .pf-c-login__main {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 30px 24px;
    border-radius: 12px;
  }

  #kc-page-title {
    margin-bottom: 30px;
    font-size: 34px;
  }
}

@media (max-width: 360px), (max-height: 720px) and (max-width: 720px) {
  body::before,
  body::after {
    height: 146px;
  }

  .pf-v5-c-login__container,
  .pf-c-login__container {
    padding-top: 178px;
    padding-right: 16px;
    padding-left: 16px;
  }

  #kc-header {
    top: 20px;
    left: 20px;
    width: calc(100vw - 40px);
  }

  .pf-v5-c-login__main,
  .pf-c-login__main {
    padding: 26px 20px;
  }

  .form-group,
  .pf-v5-c-form__group,
  .pf-c-form__group {
    margin-bottom: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }

  .gzf-starfield-canvas {
    display: none !important;
  }
}
