/* Opendata.ch portal look layered over the keycloak.v2 theme (PatternFly v5).
   Goal: the Keycloak step somebody is sent to — forgotten password, sign-up,
   the magic link out of an invitation — reads as the same product as the card
   they came from, and not as a second application with its own taste.

   The values below are the portal's own tokens from `frontend/src/app.css`,
   copied rather than imported: Keycloak serves these pages from its own origin
   and never loads the app's stylesheet. Two lists that have to agree, so each
   one names the token it mirrors — the red primary that used to stand here was
   the logo's colour, and the portal has never used it for an action. */

:root {
  /* --color-primary / --color-primary-hover */
  --pf-v5-global--primary-color--100: #0066cc;
  --pf-v5-global--primary-color--200: #0053a6;
  --pf-v5-global--primary-color--dark-100: #0066cc;
  --pf-v5-global--link--Color: #0066cc;
  --pf-v5-global--link--Color--hover: #0053a6;
  --pf-v5-global--active-color--100: #0066cc;
  /* --color-danger, for the message a wrong password produces */
  --pf-v5-global--danger-color--100: #cc0000;
  /* --font-app */
  --pf-v5-global--FontFamily--text:
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --pf-v5-global--FontFamily--heading:
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* --color-text / --color-text-secondary */
  --pf-v5-global--Color--100: #333333;
  --pf-v5-global--Color--200: #555555;
}

/* The page ground. White like the portal's, not the dark PatternFly image. */
body,
.pf-v5-c-login {
  background: #ffffff !important;
}
.pf-v5-c-background-image,
.pf-v5-c-login__background {
  display: none !important;
}

/* Header: logo above the product name, in the portal's text colour. */
#kc-header-wrapper,
.pf-v5-c-login__header,
.pf-v5-c-login__header #kc-header-wrapper,
div.kc-logo-text,
#kc-header {
  color: #333333 !important;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  padding: 0;
  line-height: 1.4;
}
#kc-header-wrapper::before {
  content: "";
  display: block;
  height: 44px;
  margin: 0 auto 0.6rem;
  background: url(../img/opendata-logo.png) no-repeat center / contain;
}
.pf-v5-c-login__main-header .pf-v5-c-title,
.pf-v5-c-login__main-body .pf-v5-c-title {
  color: #333333;
}

/* The card, matching the sign-in card on the front page: white, a hairline
   border, `--radius-md`, and no coloured strip along the top — the portal's
   cards do not have one. */
.pf-v5-c-login__main {
  background: #ffffff;
  border: 1px solid #dddddd;
  border-radius: 0.5rem;
  box-shadow: none;
  border-top-width: 1px;
}
.pf-v5-c-login__main::before,
.pf-v5-c-login__main-header::before {
  display: none;
}

/* Primary button: the portal's blue, its radius, full width like ours. */
.pf-v5-c-button.pf-m-primary {
  background-color: #0066cc;
  border-radius: 0.25rem;
  font-weight: 600;
}
.pf-v5-c-button.pf-m-primary:hover,
.pf-v5-c-button.pf-m-primary:focus {
  background-color: #0053a6;
}

/* Secondary («Zurück zur Anmeldung»): neutral, as the portal's secondary is.
   It used to be outlined in red, which made a way back look like a warning. */
.pf-v5-c-button.pf-m-secondary {
  border-radius: 0.25rem;
  --pf-v5-c-button--m-secondary--Color: #333333;
  --pf-v5-c-button--m-secondary--BorderColor: #dddddd;
  --pf-v5-c-button--m-secondary--hover--Color: #0066cc;
  --pf-v5-c-button--m-secondary--hover--BorderColor: #0066cc;
}

/* Inputs: `--color-border-control`, which is what the portal uses for a field —
   the lighter `--color-border` separates table rows and leaves a control at
   1.36:1, below the 3:1 that WCAG asks for. */
.pf-v5-c-form-control {
  border-radius: 0.25rem;
  --pf-v5-c-form-control--BorderColor: #8e8e8e;
  --pf-v5-c-form-control--BorderBottomColor: #8e8e8e;
  --pf-v5-c-form-control--hover--BorderBottomColor: #0066cc;
  --pf-v5-c-form-control--focus--BorderBottomColor: #0066cc;
}

/* Helper and footer text at the portal's secondary weight. */
.pf-v5-c-login__main-footer-band-item,
#kc-info-message,
.instruction {
  color: #555555;
}

/* Links in that text stay recognisable as links ("Registrieren" was grey like
   the sentence around it and read as plain text). */
.pf-v5-c-login__main-footer-band-item a,
#kc-registration a {
  color: #0066cc;
  text-decoration: underline;
}

/* Notice for people coming from hack.opendata.ch (login.ftl, client "dribdat"). */
.portal-hack-hint {
  margin-bottom: 1.5rem;
}
.portal-hack-hint .pf-v5-c-alert__description p {
  margin: 0;
  line-height: 1.5;
}
