:root {
  color-scheme: light;
  --zy-ink: #141820;
  --zy-muted: #5f6774;
  --zy-line: #e4e0d8;
  --zy-line-strong: #cfc8bc;
  --zy-paper: #ffffff;
  --zy-bg: #f6f4ef;
  --zy-accent: #0c6e6b;
  --zy-accent-deep: #095955;
  --zy-night: #141820;
  --zy-danger: #b42318;
}

* { box-sizing: border-box; }

html,
body,
.login-pf,
.login-pf body,
.pf-v5-c-login {
  min-height: 100%;
  margin: 0;
  color: var(--zy-ink);
  background: var(--zy-bg) !important;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body,
.login-pf body {
  background: var(--zy-bg) !important;
}

.pf-v5-c-login {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 5vh, 56px) 24px;
  background: transparent !important;
}

.pf-v5-c-login__container,
.pf-v5-grid__item,
.container-fluid,
[class*="login-pf-page"] {
  display: block !important;
  width: min(100%, 430px) !important;
  max-width: 430px !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

.pf-v5-c-login__header,
.pf-v5-c-login__main,
.pf-v5-c-login__footer { width: 100% !important; max-width: 100% !important; }

#kc-header,
.pf-v5-c-login__header { margin: 0 0 16px; text-align: left; }

#kc-header-wrapper {
  margin: 0;
  padding: 0;
  color: var(--zy-ink) !important;
  font-size: 0 !important;
  line-height: 0;
  text-shadow: none;
}

#kc-header-wrapper::before {
  content: "智涌投研";
  display: block;
  color: var(--zy-night);
  font-size: 20px;
  font-weight: 760;
  letter-spacing: .04em;
  line-height: 1.2;
}

#kc-header-wrapper::after {
  content: "Research together · Decide with evidence";
  display: block;
  margin-top: 7px;
  color: var(--zy-muted);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: .055em;
  line-height: 1.45;
}

.pf-v5-c-login__main,
.card-pf,
.login-pf-page .card {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--zy-line) !important;
  border-radius: 10px !important;
  background: var(--zy-paper) !important;
  box-shadow: 0 2px 8px rgba(20, 24, 32, .06) !important;
}

.pf-v5-c-login__main::before {
  display: none;
}

.pf-v5-c-login__main-header { display: grid; gap: 8px; padding: 25px 28px 4px; }
.pf-v5-c-login__main-header-utilities { position: static; justify-self: end; }
.pf-v5-c-login__main-body { padding: 12px 28px 10px; }
.pf-v5-c-login__main-footer,
.pf-v5-c-login__main-footer-band { padding: 6px 28px 22px; border: 0 !important; background: transparent !important; }

#kc-page-title {
  margin: 0;
  color: var(--zy-ink) !important;
  font-size: 21px;
  font-weight: 720;
  letter-spacing: -.015em;
  line-height: 1.35;
}

.pf-v5-c-login__main-body p,
#kc-content-wrapper > p,
.pf-v5-c-form__helper-text { color: var(--zy-muted); font-size: 13.5px; line-height: 1.65; }

.pf-v5-c-form { display: grid; gap: 5px; }
.pf-v5-c-form__group { display: grid; margin-bottom: 11px; }
label,
.pf-v5-c-form__label-text { margin-bottom: 5px; color: #3d4553; font-size: 13px; font-weight: 650; }

.pf-v5-c-form-control { display: block; background: transparent; }
.pf-v5-c-form-control::before,
.pf-v5-c-form-control::after { border: 0 !important; }
.pf-v5-c-input-group { display: flex; align-items: stretch; gap: 4px; }
.pf-v5-c-input-group__item { display: block; min-width: 0; }
.pf-v5-c-input-group__item.pf-m-fill { flex: 1; }
.pf-v5-c-input-group__item:not(.pf-m-fill) { flex: 0 0 auto; }
.pf-v5-c-input-group button { width: 44px; min-height: 46px; border-radius: 6px; }

/* The password control uses the shared focus ring, without a second PF underline. */
#password-show-password.pf-v5-c-button.pf-m-control::before,
#password-show-password.pf-v5-c-button.pf-m-control::after,
.pf-v5-c-input-group .pf-v5-c-button.pf-m-control::before,
.pf-v5-c-input-group .pf-v5-c-button.pf-m-control::after {
  border: 0 !important;
  border-block-end-width: 0 !important;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input:not([type]),
select {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--zy-line-strong) !important;
  border-radius: 6px !important;
  outline: none;
  background: var(--zy-paper) !important;
  box-shadow: none !important;
  color: var(--zy-ink) !important;
  font: inherit;
  font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

input:focus,
select:focus {
  border-color: var(--zy-accent) !important;
  background: var(--zy-paper) !important;
  box-shadow: 0 0 0 3px rgba(12, 110, 107, .16) !important;
}

input::placeholder { color: #7b8490; }
input:disabled,
select:disabled {
  border-color: var(--zy-line) !important;
  background: var(--zy-bg) !important;
  color: var(--zy-muted) !important;
  cursor: not-allowed;
  opacity: .72;
}

#kc-login,
input[type="submit"],
button.pf-m-primary,
.pf-m-primary {
  width: 100%;
  min-height: 46px;
  margin-top: 6px;
  border: 0 !important;
  border-radius: 6px !important;
  background: var(--zy-accent) !important;
  box-shadow: none !important;
  color: #fff !important;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  transition: background .15s ease, transform .1s ease;
}

#kc-login:hover,
input[type="submit"]:hover,
button.pf-m-primary:hover,
.pf-m-primary:hover { background: var(--zy-accent-deep) !important; }

#kc-login:disabled,
input[type="submit"]:disabled,
button.pf-m-primary:disabled,
.pf-m-primary:disabled { background: var(--zy-muted) !important; cursor: not-allowed; opacity: .58; }

#kc-login:active,
input[type="submit"]:active { transform: translateY(1px); }

a,
.pf-v5-c-button.pf-m-link,
#kc-try-another-way { color: var(--zy-accent) !important; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }

#kc-social-providers { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--zy-line); }
#kc-social-providers ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
#kc-social-providers a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--zy-line-strong);
  border-radius: 6px;
  background: var(--zy-paper);
  color: var(--zy-ink) !important;
  font-size: 13.5px;
  font-weight: 650;
}
#kc-social-providers a:hover { border-color: var(--zy-accent); text-decoration: none; }

.pf-v5-c-button.pf-m-link,
#kc-try-another-way,
button:not(.pf-m-primary):not([aria-expanded]) {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
  font-size: 13px;
}

.pf-v5-c-alert.pf-m-danger,
.pf-m-error,
.pf-m-error .pf-v5-c-helper-text__item-text,
.kc-feedback-text,
#input-error {
  border-radius: 6px;
  background: #fef3f2 !important;
  color: var(--zy-danger) !important;
  font-size: 13px;
}

.pf-v5-c-alert.pf-m-danger { border: 1px solid #f5c2c0; }
.pf-v5-c-helper-text__item,
.pf-v5-c-helper-text__item-text { color: var(--zy-muted); font-size: 12.5px; }

#kc-locale-dropdown .pf-v5-c-form-control__utilities,
#kc-locale-dropdown .pf-v5-c-form-control__toggle-icon,
.pf-v5-c-login__main-header-utilities .pf-v5-c-form-control__utilities,
.pf-v5-c-login__main-header-utilities .pf-v5-c-form-control__toggle-icon { display: none !important; }

#kc-locale select,
.pf-v5-c-login__main-header-utilities select {
  width: auto;
  min-height: 28px;
  padding: 2px 7px;
  border: 0 !important;
  background: transparent !important;
  color: var(--zy-muted) !important;
  font-size: 12px;
}

.kc-login-tooltip { position: relative; }
.kc-login-tooltip .kc-tooltip-text {
  position: absolute;
  z-index: 10;
  top: -3px;
  left: 160%;
  display: none;
  padding: 3px 7px;
  border-radius: 4px;
  background: #000;
  color: #fff;
  white-space: nowrap;
}
.kc-login-tooltip:hover .kc-tooltip-text,
.kc-login-tooltip:focus-within .kc-tooltip-text { display: block; }

:is(a, button, input, select):focus-visible {
  outline: 2px solid var(--zy-accent);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  body,
  .login-pf body {
    background: var(--zy-bg) !important;
  }
  .pf-v5-c-login__container,
  .pf-v5-grid__item,
  .container-fluid,
  [class*="login-pf-page"] { margin: 0 auto !important; }
}

@media (max-width: 480px) {
  .pf-v5-c-login { align-items: flex-start; padding: 18px 14px; }
  .pf-v5-c-login__main-header { padding: 22px 20px 4px; }
  .pf-v5-c-login__main-body { padding: 10px 20px 8px; }
  .pf-v5-c-login__main-footer,
  .pf-v5-c-login__main-footer-band { padding: 5px 20px 18px; }
}

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