/* InOs — charcoal + gold, dark-first (matches app/assets/css tokens in the apps) */

/* Rubik, self-hosted in the theme (never a font CDN) */
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/rubik-latin-400-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/rubik-latin-500-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/rubik-latin-700-normal.woff2) format("woff2");
}

:root {
  --inos-gold: #e5c100;
  --inos-gold-dim: #c4a200;
  --inos-charcoal-950: #1b1d21;
  --inos-charcoal-900: #2f3136;
  --inos-charcoal-800: #3a3f47;
  --inos-charcoal-100: #eaecee;

  /* PatternFly v5 primary → gold */
  --pf-v5-global--primary-color--100: var(--inos-gold);
  --pf-v5-global--primary-color--200: var(--inos-gold-dim);
  --pf-v5-global--link--Color: var(--inos-gold);
  --pf-v5-global--link--Color--hover: var(--inos-gold-dim);
  --pf-v5-global--active-color--100: var(--inos-gold);
}

/* page background */
body, .pf-v5-c-login, .login-pf body {
  background: radial-gradient(ellipse at top, var(--inos-charcoal-900) 0%, var(--inos-charcoal-950) 60%) fixed !important;
  font-family: "Rubik", ui-sans-serif, system-ui, sans-serif;
}

/* brand header: on-dark logo above, realm name as a small caption below (realm cue) */
#kc-header-wrapper {
  background: url(../img/inos-logo-dark.png) no-repeat top center;
  background-size: auto 72px;
  padding: 84px 0 0;
  margin: 24px auto 8px;
  max-width: 260px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b9c0c9;
}

/* login card — kill PatternFly's blue top accent; the InOs gold hairline replaces it */
.pf-v5-c-login__main, #kc-content-wrapper, .card-pf {
  background: var(--inos-charcoal-900) !important;
  border: 1px solid var(--inos-charcoal-800);
  border-top: none !important;
  border-radius: 14px;
  color: var(--inos-charcoal-100);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

/* PF draws its blue accent as border-top on the card's HEADER child, not the card
   itself — that is the bar to kill; ours replaces it */
.pf-v5-c-login__main-header {
  border-top: none !important;
}

.pf-v5-c-login__main::before, .card-pf::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--inos-gold) 0%, #eac825 45%, var(--inos-charcoal-900) 95%);
  pointer-events: none;
}

.pf-v5-c-login__main-header, .pf-v5-c-login__main-body, .pf-v5-c-login__main-footer {
  color: var(--inos-charcoal-100);
}

h1, h2, .pf-v5-c-title, #kc-page-title {
  color: var(--inos-charcoal-100) !important;
}

label, .pf-v5-c-form__label-text, .control-label {
  color: var(--inos-charcoal-100) !important;
}

/* inputs */
.pf-v5-c-form-control, .pf-v5-c-form-control > input, input[type="text"], input[type="password"], input[type="email"] {
  background-color: var(--inos-charcoal-950) !important;
  color: var(--inos-charcoal-100) !important;
  border-color: var(--inos-charcoal-800) !important;
  border-radius: 8px;
}

.pf-v5-c-form-control:focus-within, input:focus {
  border-color: var(--inos-gold) !important;
  outline-color: var(--inos-gold) !important;
}

/* PF v5 draws input borders + the focus indicator on the wrapper's ::after, not the
   input — restyle it or the default blue/grey chrome bleeds through */
.pf-v5-c-form-control::after {
  border-color: var(--inos-charcoal-800) !important;
}

.pf-v5-c-form-control:focus-within::after {
  border-color: var(--inos-gold) !important;
  border-bottom-width: 2px !important;
}

/* primary button → gold with dark text */
.pf-v5-c-button.pf-m-primary, input.pf-v5-c-button.pf-m-primary, #kc-login {
  background-color: var(--inos-gold) !important;
  color: var(--inos-charcoal-950) !important;
  font-weight: 600;
  border-radius: 8px;
  border: none;
}

.pf-v5-c-button.pf-m-primary:hover, #kc-login:hover {
  background-color: var(--inos-gold-dim) !important;
}

/* links + secondary chrome */
a, .pf-v5-c-login__main-footer-band a {
  color: var(--inos-gold) !important;
}

/* secondary actions (Try Another Way, cancel) are neutral — one gold action per view */
.pf-v5-c-button.pf-m-secondary, a#try-another-way, #kc-try-another-way {
  background: transparent !important;
  border: 1px solid var(--inos-charcoal-800) !important;
  color: var(--inos-charcoal-100) !important;
  border-radius: 8px;
  font-weight: 400;
}

.pf-v5-c-button.pf-m-secondary:hover, a#try-another-way:hover, #kc-try-another-way:hover {
  border-color: var(--inos-gold) !important;
  color: var(--inos-gold) !important;
}

/* dividers sit at hairline weight, not near-white */
hr, .pf-v5-c-divider {
  border-color: var(--inos-charcoal-800) !important;
  background-color: var(--inos-charcoal-800) !important;
}

/* social / identity providers */
.pf-v5-c-login__main-footer-links-item a, .kc-social-item {
  border-color: var(--inos-charcoal-800) !important;
  color: var(--inos-charcoal-100) !important;
}

/* password-reveal + other control buttons attached to inputs */
.pf-v5-c-input-group .pf-v5-c-button.pf-m-control,
button[data-password-toggle] {
  background: var(--inos-charcoal-950) !important;
  border: 1px solid var(--inos-charcoal-800) !important;
  border-left: none !important;
  color: var(--inos-charcoal-100) !important;
  border-radius: 0 8px 8px 0;
}

.pf-v5-c-input-group .pf-v5-c-button.pf-m-control:hover,
button[data-password-toggle]:hover {
  color: var(--inos-gold) !important;
}

/* checkboxes (remember me) pick up gold */
.pf-v5-c-check__input, input[type="checkbox"] {
  accent-color: var(--inos-gold);
}

/* "Try Another Way" (select-authenticator.ftl): the h1, h2 rule above paints each row's title charcoal-100, but
   PatternFly keeps these rows white in the light scheme, which left the titles at 1.18:1. In the dark scheme
   (keycloak.v2 sets pf-v5-theme-dark from prefers-color-scheme) the rows are dark and the rule above reads right. */
html:not(.pf-v5-theme-dark) .select-auth-box-headline {
  color: var(--inos-charcoal-950) !important;
}

/* keyboard focus = gold ring (matches the apps) */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--inos-gold);
  outline-offset: 2px;
}

/* alerts keep readable contrast on dark */
.pf-v5-c-alert {
  border-radius: 8px;
}

/* ALTCHA widget on the register page (register.ftl): sits on the dark surface like the
   inputs. Maps the widget's own variables to the existing InOs tokens only; without this
   the widget draws a white box and the theme's light label colour makes "Verified"
   unreadable. */
altcha-widget {
  --altcha-color-base: var(--inos-charcoal-950);
  --altcha-color-base-content: var(--inos-charcoal-100);
  --altcha-color-neutral: var(--inos-charcoal-800);
  --altcha-color-neutral-content: var(--inos-charcoal-100);
  --altcha-color-primary: var(--inos-gold);
  --altcha-color-primary-content: var(--inos-charcoal-950);
  --altcha-border-color: var(--inos-charcoal-800);
  --altcha-checkbox-border-color: var(--inos-charcoal-100);
  --altcha-border-radius: 8px;
  --altcha-max-width: 100%;
}
