:root {
  --padm-ink: #17212b;
  --padm-muted: #66727f;
  --padm-line: #d8e0e7;
  --padm-surface: #ffffff;
  --padm-primary: #086d70;
  --padm-primary-hover: #075c5f;
  --padm-card-width: 568px;
  --padm-card-height: 600px;
  --padm-header-height: 76px;
  --padm-panel-height: 426px;
  --padm-nav-height: 96px;
  --padm-content-inline: 48px;
}

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

body#keycloak-bg {
  background:
    linear-gradient(90deg, rgb(4 18 25 / 10%), rgb(4 18 25 / 2%)),
    url("../img/padm-login-bg-20260728.webp") center / cover no-repeat,
    #0d2630;
  color: var(--padm-ink);
  overflow: hidden;
}

.pf-v5-c-login {
  align-items: center;
  box-sizing: border-box;
  min-height: 100dvh;
  justify-content: center;
  padding: 24px;
}

.pf-v5-c-login__container {
  display: block;
  margin: 0 auto;
  padding: 0;
  width: var(--padm-card-width);
}

#kc-header {
  left: clamp(32px, 4vw, 64px);
  margin: 0;
  position: fixed;
  text-align: left;
  top: 32px;
}

#kc-header-wrapper {
  align-items: center;
  color: transparent;
  display: flex;
  font-size: 0;
  gap: 12px;
  padding: 0;
}

#kc-header-wrapper::before {
  align-items: center;
  border: 2px solid #65d2ce;
  border-radius: 9px;
  color: #8ce0dc;
  content: "P";
  display: inline-flex;
  font-size: 16px;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  width: 32px;
}

#kc-header-wrapper::after {
  color: #fff;
  content: "PADM 统一认证";
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 12px rgb(0 0 0 / 24%);
}

.pf-v5-c-login__main {
  background: var(--padm-surface);
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 16px;
  box-shadow:
    0 28px 70px rgb(0 16 24 / 34%),
    0 2px 10px rgb(0 16 24 / 14%);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  grid-column: 1;
  height: var(--padm-card-height);
  margin: 0;
  overflow: hidden;
  width: 100%;
}

.pf-v5-c-login__main-header {
  box-sizing: border-box;
  flex: 0 0 var(--padm-header-height);
  height: var(--padm-header-height);
  padding: var(--padm-content-inline) var(--padm-content-inline) 0;
}

#kc-page-title {
  color: var(--padm-ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 28px;
  margin: 0;
  align-items: center;
  display: flex;
  gap: 8px;
  letter-spacing: 0;
}

#kc-page-title .padm-mode-title-icon {
  filter: none;
  flex: 0 0 24px;
  height: 24px;
  width: 24px;
}

.padm-logout-confirmation {
  display: grid;
  gap: 28px;
  padding: 40px var(--padm-content-inline);
}

.padm-logout-confirmation > p {
  color: var(--padm-muted);
  font-size: 16px;
  line-height: 1.75;
  margin: 0;
}

.padm-logout-actions {
  display: grid;
  gap: 12px;
}

.padm-logout-actions > a {
  text-align: center;
}

.pf-v5-c-login__main-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 0;
}

.pf-v5-c-login__main-body > .pf-v5-c-login__main-footer {
  order: 3;
}

.padm-auth-switch {
  align-items: center;
  background: var(--padm-surface);
  border-top: 1px solid var(--padm-line);
  box-shadow: 0 -12px 28px rgb(0 16 24 / 8%);
  box-sizing: border-box;
  color: var(--padm-ink);
  display: flex;
  flex: 0 0 var(--padm-nav-height);
  height: var(--padm-nav-height);
  justify-content: center;
  margin: 0;
  order: 2;
  padding: 0;
  position: relative;
  width: 100%;
}

.padm-auth-switch[hidden] {
  display: none;
}

.padm-auth-divider {
  align-items: center;
  background: transparent;
  color: #7b8794;
  display: flex;
  font-size: 12px;
  justify-content: center;
  left: 0;
  line-height: 1;
  position: absolute;
  top: 0;
  transform: translateY(-50%);
  width: 100%;
}

.padm-auth-divider::before,
.padm-auth-divider::after {
  display: none;
}

.padm-auth-divider span {
  background: var(--padm-surface);
  padding: 0 8px;
}

.padm-auth-methods {
  align-items: center;
  background: transparent;
  border: 0;
  display: flex;
  gap: 36px;
  justify-content: center;
  padding: 0;
}

.padm-auth-methods button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
  color: #52606d;
  cursor: pointer;
  display: inline-flex;
  height: 52px;
  justify-content: center;
  min-height: 52px;
  padding: 0;
  transition: box-shadow 160ms ease, color 160ms ease, transform 120ms ease;
  width: 52px;
}

.padm-auth-methods button:hover {
  color: var(--padm-ink);
}

.padm-auth-methods button:active {
  transform: translateY(1px);
}

.padm-auth-methods button:focus-visible {
  outline: 3px solid rgb(8 109 112 / 26%);
  outline-offset: 1px;
}

.padm-auth-methods button[aria-pressed="true"] {
  color: var(--padm-primary);
  box-shadow: none;
}

.padm-auth-icon {
  display: block;
  height: 30px;
  filter: grayscale(1) drop-shadow(0 2px 3px rgb(0 16 24 / 18%));
  opacity: 0.56;
  object-fit: contain;
  transition: filter 160ms ease, opacity 160ms ease;
  width: 30px;
}

.padm-auth-methods button[aria-pressed="true"] .padm-auth-icon {
  filter: drop-shadow(0 4px 8px rgb(0 16 24 / 22%));
  opacity: 1;
}

.padm-auth-label {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

#padm-wecom-panel,
#padm-feishu-panel {
  background: var(--padm-surface);
  display: grid;
  flex: 0 0 var(--padm-panel-height);
  height: var(--padm-panel-height);
  order: 1;
  overflow: hidden;
  place-items: center;
  position: relative;
}

.padm-wecom-panel[hidden],
#padm-feishu-panel[hidden],
#kc-form-login[hidden],
#kc-social-providers[hidden] {
  display: none;
}

#padm-wecom-panel[data-loading="true"]::before,
#padm-feishu-panel[data-loading="true"]::before {
  animation:
    padm-qr-loading 0.8s linear infinite,
    padm-qr-loading-hide 0s 3s forwards;
  border: 2px solid #d7e2ea;
  border-top-color: var(--padm-primary);
  border-radius: 999px;
  content: "";
  height: 28px;
  left: calc(50% - 14px);
  position: absolute;
  top: calc(50% - 14px);
  width: 28px;
  z-index: 1;
}

@keyframes padm-qr-loading {
  to {
    transform: rotate(360deg);
  }
}

@keyframes padm-qr-loading-hide {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

#padm-wecom-frame,
#padm-feishu-frame {
  background: #fff;
  border: 0;
  display: block;
  transform-origin: center;
}

#padm-wecom-frame {
  height: 410px;
  width: 104.477612%;
  transform: translateY(16px) scale(0.9571428571);
}

#padm-feishu-frame {
  height: 87.313433%;
  width: 87.313433%;
  transform: scale(1.1452991453);
}

#kc-login,
#password-show-password,
#kc-form-login input,
#kc-social-providers a {
  min-height: 48px;
}

#kc-form-login {
  box-sizing: border-box;
  display: flex;
  flex: 0 0 var(--padm-panel-height);
  flex-direction: column;
  height: var(--padm-panel-height);
  justify-content: center;
  order: 1;
  margin: 0 auto;
  max-width: 400px;
  padding: 0;
  width: calc(100% - (var(--padm-content-inline) * 2));
}

#kc-form-login .pf-v5-c-form__group {
  margin-bottom: 12px;
}

#kc-form-login .pf-v5-c-form__group:last-child {
  margin-bottom: 0;
}

#kc-form-login label {
  color: var(--padm-ink);
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  margin-bottom: 8px;
}

#kc-form-login input[type="text"],
#kc-form-login input[type="password"] {
  border: 1px solid var(--padm-line);
  border-radius: 8px;
  background: #f7fafc;
  box-shadow: none;
  padding: 0 13px;
}

.padm-password-field {
  position: relative;
}

.padm-password-field input[type="password"],
.padm-password-field input[type="text"] {
  padding-right: 48px;
}

.padm-password-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: #66727f;
  cursor: pointer;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 6px;
  top: 6px;
  width: 36px;
}

.padm-password-toggle:hover,
.padm-password-toggle[aria-pressed="true"] {
  color: var(--padm-primary);
}

.padm-password-toggle:focus-visible {
  outline: 3px solid rgb(8 109 112 / 18%);
}

.padm-password-toggle svg {
  height: 21px;
  width: 21px;
}

#kc-form-login input[type="text"]:focus,
#kc-form-login input[type="password"]:focus {
  border-color: var(--padm-primary);
  outline: 3px solid rgb(8 109 112 / 15%);
  outline-offset: 0;
}

#kc-login {
  background: var(--padm-primary);
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 650;
  margin: 0 auto;
  transition: background-color 160ms ease, transform 120ms ease;
  width: 50%;
}

#kc-login:hover {
  background: var(--padm-primary-hover);
}

#kc-login:active {
  transform: translateY(1px);
}

#input-error {
  color: #b42318;
  display: block;
  font-size: 14px;
  margin: -4px 0 14px;
}

.padm-remember-row {
  align-items: center;
  color: #52606d;
  display: inline-flex;
  font-size: 14px;
  font-weight: 500;
  gap: 8px;
  margin: 0 0 2px;
}

.padm-remember-row input {
  accent-color: var(--padm-primary);
  height: 16px;
  min-height: 16px;
  width: 16px;
}

#kc-form-login .padm-remember-row input {
  flex: 0 0 auto;
  margin: 0 8px 0 0;
  min-height: 16px;
}

#kc-form-login .padm-remember-row {
  display: flex;
  line-height: 20px;
  margin: 0 0 24px;
}

#kc-social-providers svg {
  display: none;
}

#kc-locale,
#kc-info,
#kc-registration-container {
  display: none;
}

body::after {
  bottom: 8px;
  color: rgb(255 255 255 / 72%);
  content: "v0.1.0（ca4323e0）| 2026-08-20T14:55:33+08:00";
  display: block;
  font-size: 11px;
  line-height: 16px;
  position: fixed;
  right: 12px;
  text-shadow: 0 1px 4px rgb(0 0 0 / 30%);
}

@media (max-width: 700px) {
  :root {
    --padm-header-height: 52px;
    --padm-panel-height: 450px;
    --padm-content-inline: 24px;
  }
  body#keycloak-bg {
    overflow: auto;
  }

  .pf-v5-c-login {
    align-items: center;
    padding: 12px;
  }

  .pf-v5-c-login__container {
    max-width: calc(100vw - 24px);
    width: 100%;
  }

  #kc-header {
    left: 20px;
    top: 20px;
  }

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

  #padm-wecom-panel,
  #padm-feishu-panel {
    height: var(--padm-panel-height);
  }
}
