:root {
  --astrastaff-brand: #2f5bea;
  --astrastaff-brand-strong: #2446b8;
  --astrastaff-ink: #101828;
  --astrastaff-muted: #526074;
  --astrastaff-surface: #f6f8fb;
  --astrastaff-border: #dde3ec;
}

body.login-pf {
  background: var(--astrastaff-surface);
  color: var(--astrastaff-ink);
  font-family: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

#kc-header-wrapper {
  color: var(--astrastaff-brand-strong);
  font-size: 1.1rem;
  font-weight: 760;
  letter-spacing: -0.01em;
  padding: 2rem 0 1.25rem;
}

#kc-header-wrapper::before {
  align-items: center;
  background: var(--astrastaff-brand-strong);
  border-radius: 0.55rem;
  color: #fff;
  content: "A";
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  height: 1.55rem;
  justify-content: center;
  margin-right: 0.55rem;
  width: 1.55rem;
}

.login-pf-page {
  padding-top: min(12vh, 7rem);
}

.card-pf {
  border: 1px solid var(--astrastaff-border);
  border-radius: 0.9rem;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.08);
}

#kc-page-title {
  color: var(--astrastaff-ink);
  font-size: 1.45rem;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.pf-v5-c-form-control,
.pf-v5-c-form-control:focus {
  border-color: var(--astrastaff-border);
  border-radius: 0.55rem;
  box-shadow: none;
}

.pf-v5-c-form-control:focus {
  border-color: var(--astrastaff-brand);
  box-shadow: 0 0 0 3px rgba(47, 91, 234, 0.16);
}

#kc-form-buttons input[type="submit"],
.pf-v5-c-button.pf-m-primary {
  background: var(--astrastaff-brand);
  border-radius: 0.55rem;
  border: 0;
  font-weight: 700;
}

#kc-form-buttons input[type="submit"]:hover,
.pf-v5-c-button.pf-m-primary:hover {
  background: var(--astrastaff-brand-strong);
}

.login-pf a {
  color: var(--astrastaff-brand-strong);
  font-weight: 650;
}

/*
 * Keep authentication visually continuous with the customer workspace.
 * The parent Keycloak theme paints its own dark background, so neutralize
 * every parent-theme background layer explicitly rather than relying on one
 * body selector.
 */
html,
body,
body.login-pf,
.login-pf,
.login-pf body,
.login-pf-page {
  background: #f6f8fb !important;
  background-color: #f6f8fb !important;
  background-image: none !important;
}

body.login-pf::before,
body.login-pf::after,
.login-pf::before,
.login-pf::after,
.login-pf-page::before,
.login-pf-page::after {
  background-image: none !important;
  content: none !important;
}

.login-pf-page {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: clamp(1.25rem, 5vw, 3rem);
}

.login-pf-page .login-pf-page-header {
  margin-bottom: 1.25rem;
}

#kc-header {
  margin: 0 auto 1.25rem;
  max-width: 30rem;
}

#kc-header-wrapper {
  color: var(--astrastaff-brand-strong);
  font-size: clamp(1.15rem, 4vw, 1.4rem);
  justify-content: flex-start;
  padding: 0;
}

#kc-header-wrapper::before {
  border-radius: 0.65rem;
  height: 2rem;
  width: 2rem;
}

.login-pf-page .card-pf,
.card-pf {
  background: #fff !important;
  border: 1px solid var(--astrastaff-border);
  border-radius: 1rem;
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.08);
  margin-inline: auto;
  max-width: 30rem;
  padding: clamp(1.5rem, 5vw, 2.25rem);
}

#kc-page-title {
  font-size: clamp(1.45rem, 5vw, 1.8rem);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
  .login-pf-page {
    align-items: flex-start;
    padding: 2.25rem 1rem 1.5rem;
  }

  #kc-header {
    margin-bottom: 1rem;
    width: 100%;
  }

  .login-pf-page .card-pf,
  .card-pf {
    border-radius: 0.9rem;
    box-shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
    width: 100%;
  }
}


/*
 * AstraStaff's current customer login is Simplified-Chinese only.
 * Hide Keycloak's locale control defensively so its popover can never cover
 * username/password fields even if realm/theme locale metadata drifts.
 */
#kc-locale,
#kc-locale-dropdown,
.kc-locale,
.kc-locale-dropdown {
  display: none !important;
}
