/* Presentation adapter for Casdoor v1.900.0. Tokens come exclusively from the validated API projection. */
body[data-te-auth-pending] .panel-logo,
body[data-te-auth-pending] #footer {
  visibility: hidden;
}

body[data-te-auth-brand='active'],
body[data-te-auth-brand='active'] #root {
  background: var(--tk-canvas, #fff) !important;
  color: var(--tk-text, #111) !important;
}

body[data-te-auth-brand='active'] :is(.login-content, .forget-content) {
  position: relative;
  width: min(420px, calc(100% - 32px)) !important;
  margin: 24px auto !important;
  padding: 24px !important;
  color: var(--tk-text, #111) !important;
  font-family: var(--tk-font-sans, Arial, sans-serif) !important;
  letter-spacing: var(--tk-tracking-body, normal) !important;
  background: var(--tk-surface, #fff) !important;
  border: 1px solid var(--tk-border, #d8d8d8) !important;
  box-sizing: border-box;
  box-shadow: none !important;
  border-radius: var(--tk-radius-lg, 0) !important;
}

/* Native .login-content is a flex row. Keep the added return link below the form;
   Casdoor application styles may also assign a fixed width to .login-form. */
body[data-te-auth-brand='active'] .login-content {
  flex-direction: column !important;
  align-items: stretch !important;
  min-width: 0;
  justify-content: flex-start !important;
}
body[data-te-auth-brand='active'] .loginBackground {
  min-width: 0 !important;
  width: 100% !important;
}
body[data-te-auth-brand='active'] .login-content .login-panel {
  flex: none !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
body[data-te-auth-brand='active'] .login-content .login-form {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding: 0 !important;
}
body[data-te-auth-brand='active'] .login-content .login-form form {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
/* Providers leave an empty native Form.Item when no provider is enabled. Collapse
   only its own empty control, retaining labels, validation/extra text and all real controls. */
body[data-te-auth-brand='active']
  .login-content
  .ant-form-item:has(
    > .ant-form-item-row > .ant-form-item-control > .ant-form-item-control-input:empty,
    > .ant-form-item-row
      > .ant-form-item-control
      > .ant-form-item-control-input
      > .ant-form-item-control-input-content:empty
  ):not(:has(.ant-form-item-label, .ant-form-item-explain, .ant-form-item-extra)) {
  display: none !important;
}
body[data-te-auth-brand='active'] .login-content .login-form form > br {
  display: none;
}
/* The pinned signup footer renders an empty final div when signup is disabled. */
body[data-te-auth-brand='active']
  .login-content
  .login-signup-link:has(> div:last-child:empty):not(:has(a, button, input)) {
  display: none;
}
body[data-te-auth-brand='active'] .login-content .login-forget-password {
  width: 100% !important;
  min-width: 0;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-te-auth-brand='active'] :is(.login-panel, .login-form) {
  background: var(--tk-surface, #fff) !important;
  border-color: var(--tk-border, #d8d8d8) !important;
  box-shadow: none !important;
  border-radius: var(--tk-radius-lg, 0) !important;
}

body[data-te-auth-brand='active'] :is(.login-content, .forget-content) .panel-logo {
  width: 200px !important;
  max-width: 100% !important;
  height: 32px !important;
  max-height: 32px !important;
  margin: 0 !important;
  object-fit: contain !important;
  object-position: left center;
}

body[data-te-auth-brand='active'] .login-content .login-logo-box {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 0 24px !important;
  text-align: left;
}
body[data-te-auth-brand='active'] .login-content .login-languages {
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
}

/* These structural selectors match the pinned ForgetPage header/form wrappers,
   including its inline 80px/40px margins. They never select hidden form items. */
body[data-te-auth-brand='active'] .forget-content > .ant-btn {
  position: absolute !important;
  left: 18px !important;
  top: 18px !important;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--tk-text-secondary, #333);
  box-shadow: none;
}
body[data-te-auth-brand='active'] .forget-content > .ant-btn .anticon {
  font-size: 18px !important;
}
body[data-te-auth-brand='active']
  .forget-content
  > .ant-row
  > .ant-col:first-child
  > .ant-row:first-child
  > .ant-col
  > div {
  margin: 0 0 16px !important;
}
body[data-te-auth-brand='active']
  .forget-content
  > .ant-row
  > .ant-col:first-child
  > .ant-row:nth-child(2)
  > .ant-col
  > div {
  font-size: 28px !important;
  font-weight: var(--tk-weight-semibold, 600);
  line-height: 1.2;
}
body[data-te-auth-brand='active'] .forget-content > .ant-row > .ant-col:last-child > div {
  width: 100%;
  min-width: 0;
  margin-top: 24px !important;
}
body[data-te-auth-brand='active'] .forget-content form {
  width: 100% !important;
  min-width: 0;
}
body[data-te-auth-brand='active'] .forget-content form > br {
  display: none;
}
body[data-te-auth-brand='active']
  :is(.login-content, .forget-content)
  .ant-form-item:not(.ant-form-item-hidden):not([style*='visibility: hidden']) {
  margin-bottom: 20px;
}
body[data-te-auth-brand='active'] .forget-content form > .ant-form-item:last-child {
  margin-bottom: 0;
}

body[data-te-auth-brand='active']
  :is(.login-content, .forget-content)
  :is(.ant-input-affix-wrapper, .ant-select-selector, .ant-input:not(.ant-input-affix-wrapper .ant-input)) {
  min-height: 48px;
  font-size: 16px;
  border-color: var(--tk-border-control, #767676) !important;
  background: var(--tk-surface, #fff) !important;
  color: var(--tk-text, #111) !important;
  box-shadow: none !important;
  border-radius: var(--tk-radius-md, 0) !important;
}
body[data-te-auth-brand='active'] :is(.login-content, .forget-content) .ant-input-affix-wrapper {
  padding: 10px 12px;
}
body[data-te-auth-brand='active'] :is(.login-content, .forget-content) .ant-select {
  height: 48px !important;
}
body[data-te-auth-brand='active'] :is(.login-content, .forget-content) .ant-input-affix-wrapper .ant-input {
  min-height: 0;
  height: auto;
  font-size: 16px;
}

body[data-te-auth-brand='active']
  :is(.login-content, .forget-content)
  :is(.ant-input, .ant-input-password, .ant-form-item-label, .ant-btn) {
  font-family: var(--tk-font-sans, Arial, sans-serif) !important;
  letter-spacing: var(--tk-tracking-body, normal) !important;
  text-transform: none !important;
}

body[data-te-auth-brand='active']
  :is(.login-content, .forget-content)
  :is(.ant-input, .ant-input-prefix, .ant-input-suffix, .ant-form-item-label > label) {
  color: var(--tk-text, #111) !important;
}

body[data-te-auth-brand='active'] :is(.login-content, .forget-content) .ant-input::placeholder {
  color: var(--tk-text-tertiary, #636363) !important;
}
body[data-te-auth-brand='active']
  :is(.login-content, .forget-content)
  :is(.ant-input-affix-wrapper:focus-within, .ant-input:focus-visible) {
  border-color: var(--tk-focus-ring, #111) !important;
  outline: 2px solid var(--tk-focus-ring, #111);
  outline-offset: 2px;
}

body[data-te-auth-brand='active']
  :is(.login-content, .forget-content)
  :is(.login-button, .ant-btn-primary):not(:disabled) {
  min-height: 48px;
  height: 48px;
  padding: 0 16px;
  font-size: 16px;
  background: var(--tk-accent, #111) !important;
  border-color: var(--tk-accent, #111) !important;
  color: var(--tk-text-inverse, #fff) !important;
  font-weight: var(--tk-weight-semibold, 600) !important;
  border-radius: var(--tk-radius-md, 0) !important;
  box-shadow: none !important;
}
body[data-te-auth-brand='active']
  :is(.login-content, .forget-content)
  :is(.login-button, .ant-btn-primary):hover:not(:disabled) {
  background: var(--tk-accent-hover, #111) !important;
  border-color: var(--tk-accent-hover, #111) !important;
  color: var(--tk-text-inverse, #fff) !important;
}
body[data-te-auth-brand='active'] :is(.login-content, .forget-content) .login-button::before {
  display: none !important;
}
body[data-te-auth-brand='active']
  :is(.login-content, .forget-content)
  :is(.ant-btn:disabled, .ant-input:disabled, .ant-input-affix-wrapper-disabled) {
  min-height: 48px;
  border-radius: var(--tk-radius-md, 0) !important;
  background: var(--tk-surface-sunken, #f5f5f5) !important;
  border-color: var(--tk-border, #d8d8d8) !important;
  color: var(--tk-text-disabled, #767676) !important;
  box-shadow: none !important;
}

body[data-te-auth-brand='active'] :is(.login-content, .forget-content) a {
  color: var(--tk-text, #111) !important;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
body[data-te-auth-brand='active'] :is(.login-content, .forget-content) :is(a, button):focus-visible {
  outline: 2px solid var(--tk-focus-ring, #111);
  outline-offset: 3px;
}
body[data-te-auth-brand='active'] :is(.login-content, .forget-content) .ant-checkbox-checked .ant-checkbox-inner {
  background: var(--tk-accent, #111) !important;
  border-color: var(--tk-accent, #111) !important;
}
body[data-te-auth-brand='active']
  :is(.login-content, .forget-content)
  .ant-checkbox-checked
  .ant-checkbox-inner::after {
  border-color: var(--tk-text-inverse, #fff) !important;
}
body[data-te-auth-brand='active'] .forget-content .ant-steps-item-process .ant-steps-item-icon {
  background: var(--tk-accent, #111) !important;
  border-color: var(--tk-accent, #111) !important;
}
/* Native horizontal Steps clips labels in this narrower brand card. Use equal columns
   with captions below icons; the same layout accommodates the two-word reset label on mobile. */
body[data-te-auth-brand='active'] .forget-content .ant-steps {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  column-gap: 8px;
  width: 100% !important;
  max-width: 100% !important;
  margin: 24px 0 0 !important;
}
body[data-te-auth-brand='active'] .forget-content .ant-steps-item {
  width: auto !important;
  min-width: 0 !important;
  padding-inline: 0 !important;
  margin-inline: 0 !important;
}
body[data-te-auth-brand='active'] .forget-content .ant-steps-item-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}
body[data-te-auth-brand='active'] .forget-content .ant-steps-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px !important;
  height: 28px !important;
  font-size: 14px !important;
  line-height: 1 !important;
  margin: 0 0 8px !important;
  border: 1px solid var(--tk-border, #d8d8d8);
  border-radius: var(--tk-radius-md, 0);
  background: var(--tk-surface, #fff);
  color: var(--tk-text-secondary, #333);
}
body[data-te-auth-brand='active'] .forget-content .ant-steps-icon,
body[data-te-auth-brand='active'] .forget-content .ant-steps-icon .anticon {
  display: inline-flex;
  align-items: center;
  font-size: 14px !important;
  line-height: 1 !important;
  color: inherit;
}
body[data-te-auth-brand='active'] .forget-content .ant-steps-item-content {
  width: 100% !important;
  min-width: 0;
  min-height: 0 !important;
  text-align: center;
}
body[data-te-auth-brand='active'] .forget-content .ant-steps-item-title {
  padding-inline: 0 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip;
  line-height: 1.4;
  font-size: 12px;
  color: var(--tk-text-secondary, #333) !important;
}
body[data-te-auth-brand='active'] .forget-content .ant-steps-item-process .ant-steps-item-title {
  color: var(--tk-text, #111) !important;
  font-weight: var(--tk-weight-semibold, 600);
}
body[data-te-auth-brand='active'] .forget-content .ant-steps-item-tail,
body[data-te-auth-brand='active'] .forget-content .ant-steps-item-title::after {
  display: none !important;
}
body[data-te-auth-brand='active'] .forget-content .ant-steps-item-process .ant-steps-icon {
  color: var(--tk-text-inverse, #fff) !important;
}
body[data-te-auth-brand='active'] .forget-content .ant-steps-item-finish .ant-steps-item-icon {
  border-color: var(--tk-accent, #111) !important;
}
body[data-te-auth-brand='active'] .forget-content .ant-steps-item-finish .ant-steps-icon {
  color: var(--tk-accent, #111) !important;
}
body[data-te-auth-brand='active'] .forget-content .ant-steps-item-finish .ant-steps-item-tail::after {
  background: var(--tk-accent, #111) !important;
}
body[data-te-auth-brand='active'] #footer {
  background: var(--tk-canvas, #fff) !important;
  color: var(--tk-text-secondary, #333) !important;
}
body[data-te-auth-brand='active'] [data-te-auth-owned='portal'] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 20px;
  overflow-wrap: anywhere;
}
body[data-te-auth-brand='active'] [data-te-auth-owned='footer'] {
  font-family: var(--tk-font-sans, Arial, sans-serif);
  margin: 0;
}
body[data-te-auth-brand='active'] ::selection {
  background: var(--tk-selection, #e5e5e5);
}

@media (max-width: 480px) {
  body[data-te-auth-brand='active'] :is(.login-content, .forget-content) {
    padding: 24px 16px !important;
  }
  body[data-te-auth-brand='active'] :is(.login-content, .forget-content) .panel-logo {
    width: 180px !important;
  }
  body[data-te-auth-brand='active'] .forget-content .panel-logo {
    max-width: calc(100% - 96px) !important;
  }
}
