:root {
  --agentos-ink: #0a2240;
  --agentos-muted: #3b4e66;
  --agentos-soft: #f7f8fa;
  --agentos-line: #e7e8ea;
  --agentos-hover: #4f5f71;
  --agentos-focus: #1f82eb;
  --agentos-placeholder: #9ca3af;
  --agentos-subtle: #8b8f96;
}

.login-pf {
  background: #ffffff;
}

.login-pf body {
  min-height: 100vh;
  background: #ffffff;
  color: var(--agentos-ink);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    PingFang SC,
    Hiragino Sans GB,
    noto sans,
    Microsoft YaHei,
    Helvetica Neue,
    Helvetica,
    Arial,
    sans-serif;
  font-feature-settings: "rlig" 1, "calt" 1;
  letter-spacing: 0;
}

.login-pf-page {
  position: relative;
  min-height: 100vh;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
  align-items: stretch;
  background: #ffffff;
}

.login-pf-page::before {
  content: "";
  display: block;
  min-height: 100vh;
  width: 520px;
  background-image: url("../img/login-bg.jpg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.login-pf-page::after {
  content: "AI 重塑咨询\A智能交付未来";
  white-space: pre-line;
  position: absolute;
  left: 65px;
  bottom: 96px;
  z-index: 1;
  color: #3b4e66e6 !important;
  font-size: 16px;
  line-height: 32px;
  letter-spacing: 0.02em;
}

html[lang^="en"] .login-pf-page::after {
  content: "Reshaping Consulting with AI\A Delivering the Intelligent Future";
}

#kc-header {
  position: absolute;
  left: 65px;
  top: 76px;
  z-index: 2;
  width: 192px;
  height: 61.742px;
  margin: 0;
  background-image: url("../img/logo-with-text.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left center;
}

#kc-header-wrapper,
#kc-locale {
  display: none;
}

.login-pf-page .card-pf {
  align-self: center;
  justify-self: center;
  width: min(400px, calc(100vw - 48px));
  max-width: 400px;
  margin: 0;
  padding: 0;
  border: 0;
  transform: translateY(-14px);
  box-shadow: none;
  background: transparent;
}

.login-pf-page .login-pf-header {
  margin-bottom: 0;
}

#kc-content {
  width: 100%;
}

#kc-page-title {
  margin: 0 0 25px;
  color: var(--agentos-ink);
  font-family: inherit;
  font-size: 36px;
  line-height: 44px;
  font-weight: 500;
  letter-spacing: -0.32px;
  display: flex;
}

#kc-form,
#kc-form-wrapper,
#kc-social-providers {
  margin-top: 0;
}

.form-horizontal .form-group {
  margin-right: 0;
  margin-left: 0;
}

.agentos-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.agentos-login-tabs {
  display: flex;
  gap: 32px;
  margin: 0 0 32px;
}

.agentos-login-tab {
  min-width: 56px;
  padding: 0 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #4e5969;
  font-size: 14px;
  line-height: 24px;
  font-weight: 400;
  text-align: center;
  cursor: pointer;
}

.agentos-login-tab:hover {
  color: #5c6168;
}

.agentos-login-tab.is-active {
  border-bottom-color: var(--agentos-ink);
  color: var(--agentos-ink);
  font-weight: 500;
}

.agentos-field-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.agentos-field {
  margin-bottom: 0;
}

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

.pf-v5-c-form-control,
.pf-c-form-control,
#username,
#password {
  width: 100%;
  height: 52px;
  min-height: 52px;
  border-radius: 12px;
  border: 1px solid var(--agentos-line);
  background: var(--agentos-soft);
  color: #0d1b32;
  font-size: 14px;
  line-height: 20px;
  box-shadow: none;
}

#username,
#password {
  padding: 0 16px;
}

#password {
  padding-right: 48px;
}

.pf-v5-c-form-control::placeholder,
.pf-c-form-control::placeholder,
#username::placeholder,
#password::placeholder {
  color: var(--agentos-placeholder);
}

.pf-v5-c-form-control:focus,
.pf-c-form-control:focus,
#username:focus,
#password:focus {
  border-color: var(--agentos-focus);
  box-shadow: none;
  outline: none;
}

.agentos-password-toggle,
.pf-c-button.agentos-password-toggle {
  position: absolute;
  top: 50%;
  right: 14px;
  --pf-c-button--after--BorderWidth: 0;
  min-height: 24px;
  width: 24px;
  padding: 0;
  border: 0;
  transform: translateY(-50%);
  border-radius: 4px;
  background: transparent;
  color: var(--agentos-ink);
  box-shadow: none;
}

.agentos-password-toggle::after,
.pf-c-button.agentos-password-toggle::after {
  border: 0;
}

.agentos-password-toggle:hover,
.pf-c-button.agentos-password-toggle:hover {
  background: transparent;
  color: var(--agentos-ink);
}

.agentos-icon-eye,
.agentos-icon-eye-invisible {
  display: block;
  width: 12px;
  height: 12px;
  background-color: rgb(95 110 130);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 12px 12px;
  mask-size: 16px 16px;
}

.agentos-icon-eye {
  -webkit-mask-image: url("../img/arco-eye.svg");
  mask-image: url("../img/arco-eye.svg");
}

.agentos-icon-eye-invisible {
  -webkit-mask-image: url("../img/arco-eye-invisible.svg");
  mask-image: url("../img/arco-eye-invisible.svg");
}

.agentos-agreement {
  margin-top: 40px;
}

.agentos-agreement-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  color: var(--agentos-subtle);
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  cursor: pointer;
}

.agentos-agreement-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.agentos-agreement-box {
  display: flex;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex: 0 0 16px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbcbcb;
  border-radius: 4px;
  background: #ffffff;
  color: transparent;
}

.agentos-agreement-box svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.agentos-agreement-input:checked + .agentos-agreement-box {
  border-color: #162d3a;
  background: #162d3a;
  color: #ffffff;
}

.agentos-agreement-input[aria-invalid="true"] + .agentos-agreement-box {
  border-color: #a8071a;
}

.agentos-agreement-error {
  min-height: 18px;
  margin-top: 6px;
  padding-left: 24px;
  color: #a8071a;
  font-size: 13px;
  line-height: 18px;
}

.agentos-agreement-text a,
.login-pf a {
  color: var(--agentos-focus);
  font-weight: 700;
  text-decoration: none;
}

.agentos-agreement-text a:hover,
.login-pf a:hover {
  color: #176fc9;
}

#kc-login,
.pf-v5-c-button.pf-m-primary,
.pf-c-button.pf-m-primary {
  min-height: 52px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--agentos-ink);
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  box-shadow: none;
}

#kc-login:hover,
.pf-v5-c-button.pf-m-primary:hover,
.pf-c-button.pf-m-primary:hover {
  background: var(--agentos-hover);
  color: #ffffff;
}

#kc-form-buttons {
  margin-top: 20px;
  margin-bottom: 0;
}

#kc-form-buttons.form-group {
  margin-bottom: 0;
}

.pf-c-form__helper-text,
.kc-feedback-text {
  margin-top: 6px;
  color: #a8071a;
  font-size: 13px;
  line-height: 18px;
}

.pf-c-alert,
.alert {
  margin: 0 0 18px;
  border-radius: 10px;
  border: 1px solid #f6c5c5;
  background: #fff2f2;
  color: #a8071a;
}

#kc-social-providers {
  margin-top: 28px;
}

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

#kc-social-providers h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
  color: #6b778c;
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  text-align: center;
  letter-spacing: 0;
  white-space: nowrap;
}

#kc-social-providers h2::before,
#kc-social-providers h2::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--agentos-line);
}

#kc-social-providers ul {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#kc-social-providers ul.agentos-social-list-multiple {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#kc-social-providers li {
  min-width: 0;
  margin: 0;
}

#kc-social-providers a.agentos-social-button {
  box-sizing: border-box;
  display: flex;
  min-height: 54px;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid #d9e1ee;
  border-radius: 12px;
  background: #ffffff;
  color: var(--agentos-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  text-decoration: none;
  box-shadow:
    0 1px 2px rgb(10 34 64 / 6%),
    0 10px 24px rgb(10 34 64 / 4%);
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

#kc-social-providers a.agentos-social-button::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  opacity: 0.36;
  transform: rotate(45deg);
}

#kc-social-providers a.agentos-social-button:hover {
  border-color: #bfd3ed;
  background: #fbfdff;
  color: var(--agentos-ink);
  box-shadow:
    0 2px 5px rgb(10 34 64 / 8%),
    0 14px 28px rgb(10 34 64 / 6%);
  transform: translateY(-1px);
}

#kc-social-providers a.agentos-social-button:active {
  box-shadow: 0 1px 2px rgb(10 34 64 / 6%);
  transform: translateY(0);
}

#kc-social-providers a.agentos-social-button:focus-visible {
  outline: 3px solid rgb(31 130 235 / 18%);
  outline-offset: 3px;
  border-color: var(--agentos-focus);
}

#kc-social-providers a.agentos-social-button[aria-disabled="true"],
#kc-social-providers a.agentos-social-button.pf-m-disabled {
  pointer-events: none;
  opacity: 0.62;
  transform: none;
}

.agentos-social-mark {
  display: flex;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8e7fb;
  border-radius: 8px;
  background: linear-gradient(135deg, #eaf4ff 0%, #f6f8ff 100%);
  color: var(--agentos-focus);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.agentos-social-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1023px) {
  .login-pf-page {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100vh;
    padding: 48px 24px;
  }

  .login-pf-page::before,
  .login-pf-page::after {
    display: none;
  }

  #kc-header {
    position: static;
    width: 192px;
    height: 61.742px;
    margin: 0 0 32px;
  }

  .login-pf-page .card-pf {
    width: 100%;
    align-self: flex-start;
    margin: 20px auto 0;
    transform: none;
  }

  #kc-page-title {
    margin-bottom: 32px;
    font-size: 36px;
    line-height: 40px;
    font-weight: 600;
  }
}

@media (max-width: 520px) {
  #kc-social-providers h2 {
    gap: 10px;
    font-size: 12px;
  }

  #kc-social-providers ul.agentos-social-list-multiple {
    grid-template-columns: 1fr;
  }
}
