/* Gelim Account's sign-in on Gelim's tokens (`tokens.css` and `fonts.css`, written and copied
   from `design/` by `scripts/sync_design.py`): the portal's colours, type, controls and focus,
   light and dark, and the R2A boards' page (the account's side on ink, the card on wool;
   `template.ftl`). Behaviour stays with PatternFly through keycloak.v2, and no colour is
   defined outside the tokens (tests/test_design_tokens.py). */
:root,
html.pf-v5-theme-dark {
  --op-bg: var(--bg);
  --op-card: var(--surface);
  --op-text: var(--text);
  --op-muted: var(--muted);
  --op-accent: var(--primary);
  --op-accent-hover: var(--accent);
  --op-link: var(--accent);
  --op-border: var(--border);
  --op-danger: var(--danger);
  --op-shadow: var(--shadow);
}
/* Recolour everything the parent paints in its blue: buttons, focus rings, links, the card bar. */
:root,
html.pf-v5-theme-dark {
  --pf-v5-global--primary-color--100: var(--op-accent);
  --pf-v5-global--primary-color--200: var(--op-accent-hover);
  --pf-v5-global--primary-color--dark-100: var(--op-accent);
  --pf-v5-global--active-color--100: var(--op-accent);
  --pf-v5-global--active-color--400: var(--op-accent);
  --pf-v5-global--link--Color: var(--op-link);
  --pf-v5-global--link--Color--hover: var(--op-link);
  --pf-v5-global--BorderColor--100: var(--op-border);
  --pf-v5-global--BorderColor--200: var(--op-border);
  --keycloak-card-top-color: transparent;
}
.pf-v5-c-login__main-header {
  border-top: 0 !important;
}
body#keycloak-bg {
  background: var(--op-bg) !important;
  background-image: none !important;
  color: var(--op-text);
  font-family: var(--font-sans);
}
.pf-v5-c-login {
  --pf-v5-c-login--BackgroundImage: none;
  --pf-v5-c-login--BackgroundColor: var(--op-bg);
}
.pf-v5-c-login__header {
  padding-bottom: 1.5rem;
}
.pf-v5-c-login__main {
  --pf-v5-c-login__main--BackgroundColor: var(--op-card);
  background: var(--op-card);
  border: 1px solid var(--op-border);
  border-radius: var(--radius);
  box-shadow: var(--op-shadow);
  overflow: hidden;
}
.pf-v5-c-login__main-header,
.pf-v5-c-login__main-body,
.pf-v5-c-login__main-footer {
  background: transparent;
}
#kc-page-title {
  --pf-v5-c-title--m-3xl--FontSize: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--op-text);
}
.pf-v5-c-form__label-text,
.pf-v5-c-check__label,
.pf-v5-c-login__main-footer-band,
.instruction,
#kc-info-wrapper {
  color: var(--op-text);
}
.pf-v5-c-login__main-footer-band-item.pf-v5-u-color-200,
.pf-v5-u-color-200 {
  color: var(--op-muted) !important;
}
.pf-v5-c-button {
  --pf-v5-c-button--BorderRadius: var(--radius);
  border-radius: var(--radius);
  min-height: var(--control-height);
  font-weight: 600;
}
.pf-v5-c-button.pf-m-primary {
  --pf-v5-c-button--m-primary--BackgroundColor: var(--op-accent);
  --pf-v5-c-button--m-primary--hover--BackgroundColor: var(--op-accent-hover);
  --pf-v5-c-button--m-primary--focus--BackgroundColor: var(--op-accent-hover);
  --pf-v5-c-button--m-primary--active--BackgroundColor: var(--op-accent-hover);
  --pf-v5-c-button--m-primary--Color: var(--on-primary);
  --pf-v5-c-button--m-primary--hover--Color: var(--on-primary);
}
.pf-v5-c-button.pf-m-secondary,
.pf-v5-c-button.pf-m-control {
  --pf-v5-c-button--m-secondary--Color: var(--op-text);
  --pf-v5-c-button--m-secondary--BorderColor: var(--op-border);
  --pf-v5-c-button--m-secondary--hover--Color: var(--op-text);
  --pf-v5-c-button--m-secondary--hover--BorderColor: var(--op-accent);
  --pf-v5-c-button--m-control--Color: var(--op-text);
  --pf-v5-c-button--m-control--BackgroundColor: var(--op-card);
}
/* Links in the link colour: the button green stays dark in dark mode, the link green does not. */
a,
.pf-v5-c-button.pf-m-link {
  --pf-v5-c-button--m-link--Color: var(--op-link);
  --pf-v5-c-button--m-link--hover--Color: var(--op-link);
  color: var(--op-link);
}
.pf-v5-c-alert.pf-m-danger {
  --pf-v5-c-alert--BorderTopColor: var(--op-danger);
  --pf-v5-c-alert__icon--Color: var(--op-danger);
  --pf-v5-c-alert__title--Color: var(--op-text);
  border-radius: 10px;
}
.pf-v5-c-alert.pf-m-inline {
  --pf-v5-c-alert--BackgroundColor: transparent;
}
/* Team and personal sign-in providers: plain buttons, one per line, no vendor icons. */
#kc-social-providers ul {
  display: block;
}
#kc-social-providers li {
  padding: 0 0 0.5rem 0;
}
#kc-social-providers a.pf-v5-c-button {
  justify-content: center;
  color: var(--op-text);
}
.pf-v5-c-button.pf-m-secondary::after,
#kc-social-providers a.pf-v5-c-button::after {
  border-color: var(--op-border) !important;
}
.pf-v5-c-button.pf-m-secondary:hover::after,
.pf-v5-c-button.pf-m-secondary:focus::after,
#kc-social-providers a.pf-v5-c-button:hover::after {
  border-color: var(--op-accent) !important;
}
#kc-social-providers svg:not(.google) {
  display: none;
}
#kc-social-providers svg.google {
  width: 1.1rem;
  height: 1.1rem;
  margin-right: 0.6rem;
}
#kc-social-providers .pf-v5-u-m-auto {
  margin: 0 !important;
}
.pf-v5-c-login__main-footer-band {
  padding-top: 1rem;
}
/* Pages that own their words. */
.op-lead {
  margin: 0 0 1.25rem 0;
  color: var(--op-text);
  line-height: 1.5;
}
.op-hint {
  margin: 0.75rem 0 0 0;
  color: var(--op-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
.op-actions {
  display: grid;
  gap: 0.6rem;
}

/* Fields. PatternFly paints a field as a wrapper with two pseudo-element borders and a
   borderless input inside; on phones that showed as a double frame. Every text, password
   and one-time-code field is one frame: a 1px neutral border, 8px radius, 44px tall, and a
   2px accent ring only while focused. The password reveal button lives inside that frame. */
.pf-v5-c-form-control {
  --pf-v5-c-form-control--BackgroundColor: var(--op-card);
  --pf-v5-c-form-control--Color: var(--op-text);
  --pf-v5-c-form-control--m-readonly--BackgroundColor: var(--op-card);
  --pf-v5-c-form-control--OutlineOffset: 0;
  position: relative;
  min-height: 44px;
  width: 100%;
  background: var(--op-card);
  border: 1px solid var(--op-border) !important;
  border-radius: 8px !important;
  box-shadow: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.pf-v5-c-form-control::before,
.pf-v5-c-form-control::after {
  display: none !important;
}
.pf-v5-c-form-control > input,
.pf-v5-c-form-control > select,
.pf-v5-c-form-control > textarea {
  min-height: 42px;
  border: 0 !important;
  border-radius: 7px;
  outline: none !important;
  box-shadow: none !important;
  background: transparent;
  color: var(--op-text);
  -webkit-text-fill-color: var(--op-text);
  font-size: 1rem;
  padding-inline: 0.75rem;
}
/* Safari's autofill paints its own box inside the input; keep it the field's colour. */
.pf-v5-c-form-control > input:-webkit-autofill,
.pf-v5-c-form-control > input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--op-card) inset !important;
  -webkit-text-fill-color: var(--op-text) !important;
  caret-color: var(--op-text);
  border-radius: 7px;
}
.pf-v5-c-form-control:focus-within {
  border-color: var(--op-accent) !important;
  box-shadow: 0 0 0 1px var(--op-accent);
}
.pf-v5-c-form-control.pf-m-error,
.pf-v5-c-form-control:has(> [aria-invalid="true"]) {
  border-color: var(--op-danger) !important;
}
.pf-v5-c-form-control.pf-m-error:focus-within {
  box-shadow: 0 0 0 1px var(--op-danger);
}
.pf-v5-c-form-control.pf-m-readonly {
  background: var(--op-bg);
}
.pf-v5-c-form-control.pf-m-readonly > input {
  color: var(--op-muted);
  -webkit-text-fill-color: var(--op-muted);
}
.pf-v5-c-form-control__utilities {
  align-self: center;
  padding-inline-end: 0.75rem;
}
/* A field with a button beside it (password reveal, start over): one frame around both. */
.pf-v5-c-input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
  background: var(--op-card);
  border: 1px solid var(--op-border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.pf-v5-c-input-group:focus-within {
  border-color: var(--op-accent);
  box-shadow: 0 0 0 1px var(--op-accent);
}
.pf-v5-c-input-group:has(.pf-m-error) {
  border-color: var(--op-danger);
}
.pf-v5-c-input-group__item {
  display: flex;
  margin-inline-start: 0 !important;
  border: 0 !important;
  background: transparent;
}
.pf-v5-c-input-group .pf-v5-c-form-control,
.pf-v5-c-input-group .pf-v5-c-form-control:focus-within,
.pf-v5-c-input-group .pf-v5-c-form-control.pf-m-readonly {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent;
  min-height: 42px;
}
.pf-v5-c-input-group .pf-v5-c-button.pf-m-control {
  --pf-v5-c-button--m-control--BackgroundColor: transparent;
  --pf-v5-c-button--m-control--Color: var(--op-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-height: 42px;
  min-width: 44px;
  padding: 0 0.75rem;
  border: 0 !important;
  border-inline-start: 1px solid var(--op-border) !important;
  border-radius: 0 !important;
  background: transparent;
  color: var(--op-muted);
  outline: none;
}
.pf-v5-c-input-group .pf-v5-c-button.pf-m-control::after {
  display: none !important;
}
.pf-v5-c-input-group .pf-v5-c-button.pf-m-control:hover,
.pf-v5-c-input-group .pf-v5-c-button.pf-m-control:focus-visible {
  color: var(--op-accent);
}
/* The heading and labels never fade: no stuck hover tooltip, no inherited transparency. */
#kc-page-title,
.pf-v5-c-form__label-text,
.pf-v5-c-form__label,
.pf-v5-c-check__label {
  color: var(--op-text) !important;
  -webkit-text-fill-color: var(--op-text);
  opacity: 1 !important;
}
.kc-login-tooltip .kc-tooltip-text {
  display: none !important;
}
.pf-v5-c-form__helper-text,
.pf-v5-c-helper-text__item-text {
  color: var(--op-muted);
}
.pf-v5-c-helper-text__item-text.pf-m-error,
.pf-v5-c-helper-text__item.pf-m-error .pf-v5-c-helper-text__item-text {
  color: var(--op-danger);
}
/* Phone widths: the card meets the screen edge with a small gutter, fields stay 44px. */
@media (max-width: 480px) {
  .pf-v5-c-login__container {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 12px;
  }
  .pf-v5-c-login__main {
    border-radius: 14px;
  }
  .pf-v5-c-login__main-header,
  .pf-v5-c-login__main-body,
  .pf-v5-c-login__main-footer {
    padding-inline: 1.25rem;
  }
  .pf-v5-c-button {
    min-height: 44px;
  }
  /* The signed-in-as field keeps its distance from the next label on small screens too. */
  .pf-v5-c-form.pf-v5-u-mb-md-on-md {
    margin-bottom: 1rem !important;
  }
  #kc-social-providers ul,
  .pf-v5-c-login__main-footer-band {
    padding-inline: 0;
  }
}

/* The footer inside the card: help, privacy and the legal notice (plan §4). */
.op-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--op-border);
  font-size: var(--text-sm);
}
.op-footer a {
  color: var(--op-muted);
}
.op-footer a:hover,
.op-footer a:focus-visible {
  color: var(--op-link);
}
/* The authenticator key in the monospace type, with its copy button (js/oddproof.js). */
#kc-totp-secret-key {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  word-break: break-all;
}
.op-copy {
  margin-left: var(--space-2);
  font-size: var(--text-sm);
}

/* The interface in Inter, headings in Inter Tight, codes in JetBrains Mono (fonts.css),
   never the parent's own web fonts. */
:root {
  --pf-v5-global--FontFamily--text: var(--font-sans);
  --pf-v5-global--FontFamily--heading: var(--font-display);
  --pf-v5-global--FontFamily--sans-serif: var(--font-sans);
  --pf-v5-global--FontFamily--heading--sans-serif: var(--font-display);
  --pf-v5-global--FontFamily--redhat-updated--sans-serif: var(--font-sans);
  --pf-v5-global--FontFamily--redhat-updated--heading--sans-serif: var(--font-display);
  --pf-v5-global--FontFamily--monospace: var(--font-mono);
}
#kc-page-title,
.pf-v5-c-title {
  font-family: var(--font-display);
}
/* Alerts in the tokens' colours, legible in both modes. */
.pf-v5-c-alert {
  background: var(--op-card);
}
.pf-v5-c-alert .pf-v5-c-alert__title,
.pf-v5-c-alert.pf-m-info .pf-v5-c-alert__title {
  color: var(--op-text);
}
.pf-v5-c-alert.pf-m-success .pf-v5-c-alert__title {
  color: var(--accent);
}
.pf-v5-c-alert.pf-m-warning {
  background: var(--warning-bg);
}
.pf-v5-c-alert.pf-m-warning .pf-v5-c-alert__title,
.pf-v5-c-alert.pf-m-warning .pf-v5-c-alert__icon {
  color: var(--warning);
}
.pf-v5-c-alert.pf-m-danger .pf-v5-c-alert__title,
.pf-v5-c-alert.pf-m-danger .pf-v5-c-alert__icon {
  color: var(--danger);
}
/* A link inside a sentence is underlined, not only coloured. */
.pf-v5-c-login__main-body p a,
#kc-info-wrapper a,
.instruction a {
  text-decoration: underline;
}
/* Sign-out confirmation: the question, the button, then the way back, each spaced. */
#kc-logout-confirm .instruction {
  margin-bottom: var(--space-4);
}
#kc-logout-confirm #kc-info-message {
  margin-top: var(--space-4);
  text-align: center;
}

/* ---------- Round 2: the R2A sign-in boards ----------
   AccountSignIn, R2ASignInEmail, R2ASignInPassword and R2ASignInPhone: the account's side on
   ink (the mark and the name, one line on what the account is, the app being signed in
   to, the server's address and help) and the page's card on wool; on a phone, an ink band
   above the page. The ink side is the same in both modes. */
body#keycloak-bg.op-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
  margin: 0;
}
.op-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-6);
  min-width: 0;
  padding: 48px;
  background: var(--ink);
  color: var(--on-ink);
}
.op-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--on-ink);
  line-height: 1;
}
/* The mark on its tile, and the wordmark: Inter Tight 800, -4 % (gelim-tokens.json). */
.op-mark-tile {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-mark-tile);
  background: var(--tile);
}
.op-mark {
  display: block;
}
.op-mark-m {
  fill: var(--madder);
}
.op-mark-i {
  fill: var(--indigo);
}
.op-mark-w {
  fill: var(--wool);
}
.op-wordmark {
  font-family: var(--font-wordmark);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.op-lockup-note {
  color: var(--on-ink-muted);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
}
.op-pitch {
  max-width: 480px;
}
.op-headline {
  margin: 0 0 var(--space-4);
  color: var(--on-ink);
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: var(--weight-display);
  letter-spacing: -0.025em;
  line-height: 1.08;
}
.op-lede {
  margin: 0 0 var(--space-5);
  color: var(--on-ink-muted);
  font-size: var(--text-lg);
  line-height: 1.55;
}
.op-app {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--ink-2);
  color: var(--on-ink-muted);
  font-size: 13.5px;
}
.op-host {
  margin: 0;
  color: var(--on-ink-muted);
  font-size: 12.5px;
}
.op-host a {
  color: var(--on-ink-accent);
  text-decoration: underline;
}
/* The page's side: the card in the middle of the wool. */
.op-split .pf-v5-c-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 100vh;
  padding: 48px 24px;
  background: var(--op-bg);
}
.op-split .pf-v5-c-login__container {
  display: block;
  width: 100%;
  max-width: 420px;
  padding: 0;
}
/* The name is on the account's side; the realm's name stays for screen readers. */
.op-split #kc-header {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.op-split .pf-v5-c-login__main {
  border-radius: var(--radius-card);
  box-shadow: none;
}
.op-split .pf-v5-c-login__main-header {
  padding-bottom: 0;
}
.op-split .pf-v5-c-login__main-header,
.op-split .pf-v5-c-login__main-body,
.op-split .pf-v5-c-login__main-footer {
  padding-inline: 28px;
}
.op-split #kc-page-title {
  --pf-v5-c-title--m-3xl--FontSize: 22px;
  font-weight: var(--weight-display);
  letter-spacing: -0.02em;
}
.op-subtitle {
  margin: 2px 0 var(--space-4);
  font-size: 13.5px;
}
.op-subtitle a {
  color: var(--op-muted);
}
.op-help {
  margin: var(--space-3) 0 0;
  color: var(--op-muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.op-split .pf-v5-c-form-control,
.op-split .pf-v5-c-input-group {
  border-radius: var(--radius-input) !important;
}
.op-split .pf-v5-c-button.pf-m-primary {
  min-height: var(--touch);
}
/* After the email: the address with "Not you?" in one grey row (R2ASignInPassword). */
.op-split .pf-v5-c-form__group:has(#kc-attempted-username) .pf-v5-c-form__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.op-split .pf-v5-c-input-group:has(#kc-attempted-username) {
  border-color: transparent;
  background: var(--surface-tint);
}
.op-split .pf-v5-c-input-group:has(#kc-attempted-username) .pf-v5-c-form-control > input {
  color: var(--op-text);
  -webkit-text-fill-color: var(--op-text);
}
#reset-login {
  border-inline-start: 0 !important;
  color: var(--op-text) !important;
}
#reset-login .fa-sync-alt {
  display: none;
}
/* "Not you?" as words in the row, not the parent's hover tooltip (its box, shadow and arrow). */
.kc-login-tooltip#reset-login .kc-tooltip-text,
.kc-login-tooltip#reset-login:hover .kc-tooltip-text {
  display: inline !important;
  position: static;
  min-width: 0;
  visibility: visible;
  opacity: 1;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
  color: var(--op-text);
  font-size: 13.5px;
  font-weight: var(--weight-medium);
  white-space: nowrap;
}
.kc-login-tooltip#reset-login .kc-tooltip-text::after {
  display: none;
}

/* A phone: an ink band with the name and the app, then the page on wool (R2ASignInPhone). */
@media (max-width: 760px) {
  body#keycloak-bg.op-split {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }
  .op-intro {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-2) var(--space-3);
    padding: 20px;
  }
  .op-wordmark {
    font-size: 22px;
  }
  .op-lockup-note {
    font-size: var(--text-md);
  }
  .op-mark-tile {
    width: 24px;
    height: 24px;
  }
  .op-mark {
    width: 15px;
    height: 15px;
  }
  .op-pitch {
    flex: 1 1 160px;
  }
  .op-headline,
  .op-lede,
  .op-host {
    display: none;
  }
  .op-app {
    padding: 0;
    background: none;
    font-size: 12.5px;
  }
  .op-split .pf-v5-c-login {
    align-items: flex-start;
    min-height: 0;
    padding: 12px 8px 32px;
  }
  .op-split .pf-v5-c-login__main {
    border: 0;
    background: transparent;
  }
}
