/* Legalton's sign-in: the app's calm white page, ink actions and its serif title
   (DESIGN-003 section 5). Plain CSS over PatternFly 5's variables and Keycloak's classes; the
   templates beside this file add the lt- classes. */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500&family=IBM+Plex+Sans:wght@400;500;600&family=Newsreader:opsz,wght@6..72,500&display=swap");

:root {
  --lt-ink: #111113;
  --lt-ink-secondary: #52525b;
  --lt-ink-tertiary: #71717a;
  --lt-border: #e4e4e7;
  --lt-border-strong: #c9c9cf;
  --lt-sunken: #f7f7f8;
  --lt-error: #b42318;
  --lt-error-soft: #fef3f2;
  --lt-focus: rgb(17 17 19 / 0.18);
  --pf-v5-global--FontFamily--text: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --pf-v5-global--FontFamily--heading: "Newsreader", Georgia, serif;
  --pf-v5-global--primary-color--100: var(--lt-ink);
  --pf-v5-global--primary-color--200: #000;
  --pf-v5-global--link--Color: var(--lt-ink);
  --pf-v5-global--link--Color--hover: #000;
  --pf-v5-global--danger-color--100: var(--lt-error);
}

html,
body,
.pf-v5-c-login,
.login-pf body {
  background: var(--lt-sunken) none !important;
  color: var(--lt-ink);
  font-family: var(--pf-v5-global--FontFamily--text);
  -webkit-font-smoothing: antialiased;
}

/* The wordmark above the card. */
#kc-header-wrapper,
.pf-v5-c-login__header,
.pf-v5-c-brand {
  color: var(--lt-ink) !important;
  font-family: var(--pf-v5-global--FontFamily--heading);
  font-size: 1.875rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-transform: none;
}

.pf-v5-c-login__container {
  max-width: 27rem;
}

.pf-v5-c-login__main {
  background: #fff;
  border: 1px solid var(--lt-border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgb(17 17 19 / 0.04), 0 8px 24px rgb(17 17 19 / 0.04);
}

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

/* PatternFly marks the card's top with a 4px brand-blue rule; the app draws none. */
.pf-v5-c-login__main-header {
  border-top: 0 !important;
  padding-bottom: 0.25rem;
}

.pf-v5-c-title,
#kc-page-title {
  font-family: var(--pf-v5-global--FontFamily--heading);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

/* Fields. */
.pf-v5-c-form__label-text {
  color: var(--lt-ink);
  font-weight: 500;
}

.pf-v5-c-form-control {
  border-radius: 10px;
  --pf-v5-c-form-control--before--BorderColor: var(--lt-border-strong);
  --pf-v5-c-form-control--after--BorderColor: transparent;
  --pf-v5-c-form-control--hover--after--BorderBottomColor: transparent;
  --pf-v5-c-form-control--focus--after--BorderBottomColor: transparent;
  --pf-v5-c-form-control--m-error--after--BorderBottomColor: transparent;
}

.pf-v5-c-form-control > input {
  font-size: 1rem;
  min-height: 2.75rem;
  padding-inline: 0.875rem;
}

.pf-v5-c-form-control > input::placeholder {
  color: var(--lt-ink-tertiary);
}

.pf-v5-c-form-control:focus-within {
  box-shadow: 0 0 0 3px var(--lt-focus);
  --pf-v5-c-form-control--before--BorderColor: var(--lt-ink);
}

.pf-v5-c-form-control.pf-m-error {
  --pf-v5-c-form-control--before--BorderColor: var(--lt-error);
}

.lt-error {
  color: var(--lt-error);
  font-size: 0.875rem;
  line-height: 1.45;
  margin: 0.5rem 0 0;
}

/* The page-level alert (an expired step, a paused account). */
.pf-v5-c-alert.pf-m-inline {
  border-radius: 10px;
  box-shadow: none;
}

.pf-v5-c-alert.pf-m-danger {
  background: var(--lt-error-soft);
  border: 1px solid #fecdca;
}

/* Buttons: one ink pill for the step's action, an outlined pill beside it. */
.pf-v5-c-button {
  --pf-v5-c-button--BorderRadius: 999px;
  --pf-v5-c-button--after--BorderRadius: 999px;
}

.pf-v5-c-button.pf-m-primary {
  background: var(--lt-ink);
  border-radius: 999px;
  font-weight: 500;
  min-height: 2.75rem;
}

.pf-v5-c-button.pf-m-primary:hover,
.pf-v5-c-button.pf-m-primary:focus {
  background: #000;
}

.pf-v5-c-button.pf-m-secondary,
.pf-v5-c-button.pf-m-control {
  border-radius: 999px;
  color: var(--lt-ink);
  font-weight: 500;
  min-height: 2.75rem;
  --pf-v5-c-button--after--BorderColor: var(--lt-border-strong);
}

.pf-v5-c-button:focus-visible,
.lt-link-button:focus-visible,
.lt-identity-change:focus-visible,
.lt-footer a:focus-visible {
  outline: 2px solid var(--lt-ink);
  outline-offset: 2px;
}

/* "Send a new code": a quiet action under the main one. */
.lt-link-button {
  background: none;
  border: 0;
  color: var(--lt-ink);
  cursor: pointer;
  display: block;
  font: inherit;
  font-size: 0.9375rem;
  margin: 0.875rem auto 0;
  padding: 0.25rem 0.5rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The passkey, after a divider: the other way in, never the first one. */
#authenticateWebAuthnButton {
  margin-top: 0 !important;
}

#kc-form + #authenticateWebAuthnButton,
#webauth ~ #authenticateWebAuthnButton {
  margin-top: 1.5rem !important;
}

/* "or" between the code and the passkey. */
#kc-form::after {
  color: var(--lt-ink-tertiary);
  content: "or";
  display: block;
  font-size: 0.8125rem;
  margin: 0.25rem 0 1rem;
  text-align: center;
}

#kc-form:last-child::after {
  display: none;
}

.lt-how {
  color: var(--lt-ink-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0.875rem 0 1.25rem;
  text-align: center;
}

/* Whose sign-in this is, with the way back to another address. */
.lt-identity {
  align-items: baseline;
  border: 1px solid var(--lt-border);
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  justify-content: space-between;
  margin: 0 0 1.25rem;
  padding: 0.625rem 0.875rem;
}

.lt-identity-email {
  color: var(--lt-ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.lt-identity-change {
  color: var(--lt-ink-secondary) !important;
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* The code: large, spaced, like the code in the email. */
.lt-code-label {
  color: var(--lt-ink);
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.lt-code-field > input {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.625rem;
  letter-spacing: 0.5em;
  min-height: 3.5rem;
  text-align: center;
  padding-inline-start: calc(0.875rem + 0.5em);
}

/* The help band under the form, and the line under the card. */
.pf-v5-c-login__main-footer-band {
  background: none;
  border-top: 1px solid var(--lt-border);
  margin-top: 0.5rem;
  padding-inline: 0;
}

.pf-v5-c-login__main-footer-band-item {
  padding-inline: 0;
}

.lt-help {
  color: var(--lt-ink-secondary);
  font-size: 0.875rem;
  line-height: 1.55;
  margin: 0;
  text-align: left;
}

.lt-footer {
  color: var(--lt-ink-tertiary);
  font-size: 0.8125rem;
  margin: 0;
  padding: 0 0 1.5rem;
  text-align: center;
}

.lt-footer a {
  color: var(--lt-ink-tertiary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
