/* Sign-in for every account type: form on one side, who it is for on the other.
   One bordered panel on the site's content line. No shadows, gradients or dark bands.
   Older sign-in CSS uses !important at high specificity, hence the prefix. */

html:not(#\#) body main.cha-signin-main {
  min-height: 0 !important;
  overflow: visible !important;
  padding: clamp(24px, 6vh, 56px) 0 clamp(40px, 8vh, 72px) !important;
}

html:not(#\#) body main.cha-signin-main .auth-stage {
  display: block !important;
  min-height: 0 !important;
  padding: 0 var(--hx-gutter) !important;
}

html:not(#\#) body main.cha-signin-main .auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  background: #fff;
  border: 1px solid var(--hx-line);
  border-radius: var(--hx-r-md);
}

html:not(#\#) body main.cha-signin-main .auth-card {
  max-width: none !important;
  margin: 0 !important;
  padding: 32px 36px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
}

html:not(#\#) body main.cha-signin-main .auth-header__title {
  font-size: clamp(26px, 2.6vw, 32px) !important;
  line-height: 1.2 !important;
}

/* The help line and the sign-in message share one slot, so an error or a "checking" notice
   never pushes the panel or the page down. */
html:not(#\#) body main.cha-signin-main .auth-access-note {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0 4px;
  align-items: center;
  justify-content: center;
  min-height: 78px;
  margin: 0 !important;
  font-size: 13px !important;
  text-align: center !important;
}

html:not(#\#) body main.cha-signin-main #signin-status {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 64px;
  margin: 14px 0 0 !important;
}

/* Tablets and touch laptops keep a 44px field after the site's .875 scale. */
@media (pointer: coarse) and (min-width: 861px) {
  html:not(#\#) body main.cha-signin-main .field__input {
    min-height: 51px !important;
  }
}

html:not(#\#) body main.cha-signin-main #signin-status[hidden],
html:not(#\#) body main.cha-signin-main #signin-status:not([hidden]) + .auth-access-note {
  display: none !important;
}

html:not(#\#) body main.cha-signin-main .auth-access-note a {
  color: var(--hx-primary) !important;
  font-weight: 600 !important;
  white-space: nowrap;
}

.auth-aside {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 32px 36px;
  border-left: 1px solid var(--hx-line);
}

.auth-aside__title {
  margin: 0;
  color: var(--hx-ink);
  font-family: var(--hx-display);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.3;
}

.auth-aside__lead {
  margin: 4px 0 0;
  color: var(--hx-muted);
  font-family: var(--hx-sans);
  font-size: 13.5px;
  line-height: 1.5;
}

.auth-roles,
.auth-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-roles {
  display: grid;
  flex: 1 1 auto;
  gap: 20px;
  align-content: space-evenly;
  margin-top: 12px;
}

.auth-roles li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.auth-roles__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--hx-primary);
  background: var(--hx-primary-soft);
  border-radius: 10px;
}

.auth-roles__text {
  min-width: 0;
  font-family: var(--hx-sans);
}

.auth-roles__text strong,
.auth-roles__text span {
  display: block;
}

.auth-roles__text strong {
  color: var(--hx-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.auth-roles__text span {
  margin-top: 2px;
  color: var(--hx-muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-aside__next {
  padding-top: 12px;
}

/* "Remember me" and "Forgot password" stay on one row whenever they fit; long languages on
   the narrowest phones wrap to the left without an empty band between them. */
html:not(#\#) body main.cha-signin-main .row-between {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0 8px !important;
  align-items: center !important;
  justify-content: space-between !important;
}

html:not(#\#) body main.cha-signin-main .row-between > * {
  margin: 0 !important;
  white-space: nowrap;
}

.auth-aside__sub {
  margin: 0;
  padding-top: 18px;
  color: var(--hx-ink);
  font-family: var(--hx-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  border-top: 1px solid var(--hx-line);
}

.auth-links {
  margin-top: 4px;
}

.auth-links a {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  color: var(--hx-primary);
  font-family: var(--hx-sans);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}

.auth-links a:hover {
  color: var(--hx-primary-ink);
  text-decoration: underline;
}

.auth-links a:focus-visible {
  outline: 2px solid var(--hx-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.auth-links svg {
  flex: none;
}

/* Short laptop screens: keep the whole form as high as possible. */
@media (min-width: 861px) and (max-height: 640px) {
  html:not(#\#) body main.cha-signin-main {
    padding-top: 20px !important;
  }

  html:not(#\#) body main.cha-signin-main .auth-card,
  .auth-aside {
    padding-top: 24px !important;
    padding-bottom: 24px !important;
  }
}

/* One column: the form stays first, then who it is for. */
@media (max-width: 860px) {
  html:not(#\#) body main.cha-signin-main .auth-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-aside {
    border-top: 1px solid var(--hx-line);
    border-left: 0;
  }

  .auth-links a {
    min-height: 44px;
  }

  html:not(#\#) body main.cha-signin-main .auth-access-note a {
    display: inline-block;
    padding: 8px 0;
  }
}

@media (max-width: 560px) {
  html:not(#\#) body main.cha-signin-main .auth-card {
    padding: 24px 20px !important;
  }

  .auth-aside {
    padding: 24px 20px;
  }
}
