/* Healthcare OS sign-in. Mirrors the app's /login card: a ruled box with a
   shaded brand band, Public Sans, small-caps field labels, an ink primary
   button and the protected-health-information notice. Tokens match
   apps/web/src/app/globals.css. */

@font-face {
  font-family: "Public Sans";
  src: url("../fonts/public-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --hos-paper: #ffffff;
  --hos-field: #edf7f7;
  --hos-rule: #00acb1;
  --hos-rule-soft: #a3dadc;
  --hos-label: #00797d;
  --hos-ink: #141a1b;
  --hos-ink-soft: #2a3436;
  --hos-mute: #4f5d60;
  --hos-control: #96a4a6;
  --hos-crit: #b42318;
  --hos-font: "Public Sans", "Segoe UI", Arial, sans-serif;

  --pf-v5-global--FontFamily--text: var(--hos-font);
  --pf-v5-global--FontFamily--heading: var(--hos-font);
  --pf-v5-global--FontFamily--sans-serif: var(--hos-font);
  --pf-v5-global--primary-color--100: var(--hos-label);
  --pf-v5-global--link--Color: var(--hos-label);
  --pf-v5-global--link--Color--hover: #005f62;
  --pf-v5-global--BackgroundColor--100: var(--hos-paper);
}

html {
  background: var(--hos-field) !important;
}
body#keycloak-bg {
  background: var(--hos-field) !important;
  color: var(--hos-ink);
  font-family: var(--hos-font);
  font-size: 0.8125rem;
  line-height: 1.25rem;
}

/* Center a single card, 28rem wide, like the app's sign-in page. */
.pf-v5-c-login,
.pf-v5-c-login__container {
  min-height: 100vh;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem !important;
  background: none !important;
}
.pf-v5-c-login__container {
  width: 100%;
  max-width: 28rem !important;
  min-height: 0;
  padding: 0 !important;
  gap: 0 !important;
  grid-template-columns: 1fr !important;
}

/* The brand band: the top of the ruled box. */
#kc-header {
  width: 100%;
  margin: 0 !important;
  padding: 0.75rem 1.25rem !important;
  background: var(--hos-field);
  border: 1px solid var(--hos-rule);
  border-bottom-color: var(--hos-rule-soft);
  border-radius: 0.75rem 0.75rem 0 0;
  box-sizing: border-box;
  height: auto !important;
  min-height: 0 !important;
  flex: none;
}
#kc-header-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 !important;
  font-family: var(--hos-font) !important;
  font-size: 0.9375rem !important;
  line-height: 1.25rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
  text-transform: none !important;
  color: var(--hos-ink) !important;
  white-space: normal !important;
}
#kc-header-wrapper::before {
  content: "";
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
  background: url("../img/brand.svg") center / contain no-repeat;
}
#kc-header-wrapper::after {
  content: "MVVC Healthcare Solutions";
  display: block;
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--hos-mute);
}

/* The body of the box. */
.pf-v5-c-login__main {
  width: 100%;
  margin: 0 !important;
  background: var(--hos-paper) !important;
  border: 1px solid var(--hos-rule);
  border-top: 0;
  border-radius: 0 0 0.75rem 0.75rem;
  box-shadow: none !important;
  overflow: hidden;
}
.pf-v5-c-login__main-header {
  padding: 1.5rem 1.25rem 0 !important;
  display: block !important;
  border-top: 0 !important; /* PatternFly's blue accent bar */
}
.pf-v5-c-login__main-footer:empty,
#kc-form-options:empty {
  display: none !important;
}
#kc-page-title,
.pf-v5-c-login__main-header .pf-v5-c-title {
  margin: 0;
  font-family: var(--hos-font) !important;
  font-size: 1.375rem !important;
  line-height: 1.75rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.015em;
  color: var(--hos-ink) !important;
}
.pf-v5-c-login__main-header-utilities {
  display: none !important; /* Language picker: English only for now. */
}
.pf-v5-c-login__main-body {
  padding: 1.25rem 1.25rem 1.5rem !important;
}
.pf-v5-c-login__main-footer {
  padding: 0 1.25rem 1.25rem !important;
}

/* Fields: small-caps label over a 40 px control. */
.pf-v5-c-form {
  gap: 1rem !important;
}
.pf-v5-c-form__label,
.pf-v5-c-form__label-text {
  font-family: var(--hos-font);
  font-size: 0.6875rem !important;
  line-height: 1rem;
  font-weight: 700 !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hos-label) !important;
}
.pf-v5-c-form__label-required {
  display: none;
}
.pf-v5-c-form-control {
  --pf-v5-c-form-control--BorderRadius: 0.5rem;
  --pf-v5-c-form-control--before--BorderColor: var(--hos-control);
  --pf-v5-c-form-control--after--BorderColor: transparent;
  --pf-v5-c-form-control--hover--after--BorderColor: var(--hos-ink-soft);
  --pf-v5-c-form-control--focus--after--BorderColor: var(--hos-rule);
  --pf-v5-c-form-control--focus--after--BorderWidth: 2px;
  min-height: 2.5rem;
  border-radius: 0.5rem !important;
  background: var(--hos-paper) !important;
  font-family: var(--hos-font);
  font-size: 0.8125rem;
  color: var(--hos-ink);
}
.pf-v5-c-form-control::before,
.pf-v5-c-form-control::after {
  border-radius: 0.5rem !important;
}
.pf-v5-c-form-control input:focus {
  outline: none !important; /* the control's own ring shows focus */
}
.pf-v5-c-form-control input {
  font-family: var(--hos-font);
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem !important;
}
.pf-v5-c-input-group .pf-v5-c-button.pf-m-control {
  border-radius: 0 0.5rem 0.5rem 0 !important;
  color: var(--hos-ink-soft);
}

/* Buttons: ink primary, the same as the app. */
.pf-v5-c-button.pf-m-primary {
  --pf-v5-c-button--m-primary--BackgroundColor: var(--hos-ink);
  --pf-v5-c-button--m-primary--hover--BackgroundColor: var(--hos-ink-soft);
  --pf-v5-c-button--m-primary--focus--BackgroundColor: var(--hos-ink-soft);
  --pf-v5-c-button--m-primary--active--BackgroundColor: var(--hos-ink-soft);
  width: 100%;
  min-height: 2.5rem;
  border-radius: 0.5rem !important;
  background: var(--hos-ink) !important;
  font-family: var(--hos-font);
  font-size: 0.8125rem;
  font-weight: 600;
}
.pf-v5-c-button.pf-m-primary:hover,
.pf-v5-c-button.pf-m-primary:focus-visible {
  background: var(--hos-ink-soft) !important;
}
.pf-v5-c-button:focus-visible,
.pf-v5-c-form-control:focus-within {
  outline: 2px solid var(--hos-rule);
  outline-offset: 2px;
}
a,
.pf-v5-c-button.pf-m-link {
  color: var(--hos-label);
  font-weight: 600;
}

/* Messages: an error reads in the platform's critical red, inside a ruled box. */
.pf-v5-c-alert {
  border-radius: 0.5rem;
  box-shadow: none;
  border: 1px solid var(--hos-rule);
  background: var(--hos-field);
  font-family: var(--hos-font);
}
.pf-v5-c-alert.pf-m-danger {
  border-color: var(--hos-crit);
  background: var(--hos-paper);
  color: var(--hos-crit);
}
.pf-v5-c-alert.pf-m-danger .pf-v5-c-alert__title,
.pf-v5-c-helper-text__item.pf-m-error,
.kc-feedback-text.pf-m-error {
  color: var(--hos-crit) !important;
}

/* The protected-health-information notice, as on the app's sign-in page. */
.pf-v5-c-login__main::after {
  content: "This system contains protected health information. Access is limited to authorized staff and every view is logged.";
  display: block;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--hos-rule-soft);
  font-size: 0.75rem;
  line-height: 1.125rem;
  color: var(--hos-mute);
}

@media (max-width: 30rem) {
  .pf-v5-c-login,
  .pf-v5-c-login__container {
    padding: 1rem !important;
    justify-content: flex-start;
  }
}

/* Tighten: the header band holds one line; empty footers take no space;
   the focused control shows the platform's teal line, not PatternFly blue. */
#kc-header {
  height: 3.25rem !important;
  max-height: 3.25rem !important;
  display: flex !important;
  align-items: center;
  align-self: stretch;
}
#kc-header-wrapper {
  flex: 1;
  margin: 0 !important;
}
.pf-v5-c-login__main-footer:not(:has(*)) {
  display: none !important;
}
.pf-v5-c-form-control:focus-within::after,
.pf-v5-c-form-control:hover::after {
  border-color: var(--hos-rule) !important;
}
#kc-header-wrapper {
  white-space: nowrap !important;
  text-align: left;
}
@media (max-width: 30rem) {
  #kc-header-wrapper::after {
    display: none;
  }
}
