/* Qore login theme, "Deep-space Aurora" (consumer-portal: Login Page Presents the Platform
   Brand). Dark page lit by teal/indigo glows, a frosted-glass card, the gradient "Qore" wordmark
   with a per-environment badge, and a teal-to-indigo primary action. Loaded after keycloak.v2's
   PatternFly v5 and styles.css, so these rules override them. The theme owns every decoration on
   the card: a base-theme upgrade must not add one silently (26.8.1 added a blue border-top on the
   card header; it is removed below). Hanken Grotesk for text and IBM Plex Mono for the brand,
   the Web Portal's two fonts, so the wordmark matches the Console's. */
@import url("https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600;700&display=swap");

:root {
  color-scheme: dark;
  --qore-page: #060b17;
  --qore-ink: #f8fafc;
  --qore-text: #e2e8f0;
  --qore-label: #cbd5e1;
  --qore-muted: #a3afc2;
  --qore-card: rgba(15, 23, 42, 0.55);
  --qore-line: rgba(148, 163, 184, 0.2);
  --qore-field: rgba(2, 6, 23, 0.6);
  --qore-field-line: rgba(148, 163, 184, 0.3);
  --qore-autofill: #0b1324;
  --qore-cyan: #67e8f9;
  --qore-cyan-hover: #a5f3fc;
  --qore-teal: #0e7490;
  --qore-indigo: #4338ca;
  --qore-ring: rgba(103, 232, 249, 0.28);
  /* PatternFly globals, re-pointed at the dark surface so components we do not restyle one by
     one (titles, helper text, checkboxes) inherit legible colours. */
  --pf-v5-global--Color--100: var(--qore-text);
  --pf-v5-global--Color--200: var(--qore-muted);
  --pf-v5-global--BackgroundColor--100: var(--qore-autofill);
  --pf-v5-global--BorderColor--100: var(--qore-field-line);
  --pf-v5-global--primary-color--100: var(--qore-teal);
  --pf-v5-global--link--Color: var(--qore-cyan);
  --pf-v5-global--link--Color--hover: var(--qore-cyan-hover);
  --keycloak-card-top-color: transparent;
}

/* Page: solid base colour; the aurora and grid are fixed, non-interactive layers behind it. */
html,
body,
body#keycloak-bg,
.login-pf body {
  background: var(--qore-page) !important;
  color: var(--qore-text) !important;
  font-family: "Hanken Grotesk", system-ui, sans-serif !important;
}
body#keycloak-bg::before,
body#keycloak-bg::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}
body#keycloak-bg::before {
  inset: -20vmax;
  filter: blur(36px);
  background:
    radial-gradient(38% 34% at 34% 30%, rgba(14, 116, 144, 0.6), transparent 70%),
    radial-gradient(34% 30% at 70% 74%, rgba(79, 70, 229, 0.42), transparent 70%),
    radial-gradient(24% 20% at 66% 22%, rgba(34, 211, 238, 0.2), transparent 70%);
}
body#keycloak-bg::after {
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.09) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 25%, transparent 72%);
  mask-image: radial-gradient(ellipse at center, #000 25%, transparent 72%);
}
.pf-v5-c-login,
.pf-v5-c-background-image {
  position: relative;
  z-index: 1;
  background: transparent !important;
  background-image: none !important;
}
.pf-v5-c-background-image::before,
.pf-v5-c-background-image::after,
.login-pf-page {
  background-image: none !important;
}

/* Layout: one 28rem column (header, card, footer line) at every width. PatternFly pads the
   container by 6.125rem a side from 1200px, which would eat into that width, so the padding is
   reset (16px gutters on phones). */
.pf-v5-c-login__container {
  --pf-v5-c-login__container--MaxWidth: 28rem;
  grid-template-columns: minmax(0, 28rem) !important;
  padding-inline: 0 !important;
}
@media (max-width: 575px) {
  .pf-v5-c-login__container {
    padding-inline: 16px !important;
  }
}
.pf-v5-c-login__container::after {
  content: "Enterprise LLM infrastructure";
  content: "Enterprise LLM infrastructure" / "";
  display: block;
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--qore-text);
}

/* Contrast (WCAG AA, 4.5:1) is held against the worst case: the brightest point of the aurora
   behind the text. Hence the muted grey, the footer line in body text colour, and badges on a
   dark backing layer under their tint. */

/* Header: the "Qore" wordmark and the environment badge, both from the realm's displayNameHtml
   (platform-helm-chart: Login Header Environment Badge). Plain display-name text, shown before
   the reconcile has run, still renders legibly in the wordmark font. */
.pf-v5-c-login__header {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}
#kc-header-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 !important;
  /* Same face, weight and tracking as the Console sidebar's "Qore" (portal app-shell.tsx). */
  font-family: "IBM Plex Mono", ui-monospace, monospace !important;
  font-size: 2rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.05em;
  line-height: 1.2;
  text-transform: none !important;
  color: var(--qore-ink) !important;
}
/* The Qore mark before the wordmark (the Portal sidebar's tile and the tab icon), drawn by CSS
   so the realm's displayNameHtml stays text-only and the sanitizer is not involved. */
#kc-header-wrapper::before {
  content: "";
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  background: url("../img/qore-mark.svg") center / contain no-repeat;
  border-radius: 0.5625rem;
  box-shadow: 0 8px 22px rgba(67, 56, 202, 0.35);
}
.qore-word {
  background: linear-gradient(90deg, #ffffff, var(--qore-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.qore-env {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(203, 213, 225, 0.45);
  background-color: rgba(2, 6, 23, 0.5);
  background-image: linear-gradient(rgba(203, 213, 225, 0.1), rgba(203, 213, 225, 0.1));
  color: var(--qore-label);
}
.qore-env--dev {
  border-color: rgba(103, 232, 249, 0.5);
  background-image: linear-gradient(rgba(103, 232, 249, 0.1), rgba(103, 232, 249, 0.1));
  color: #67e8f9;
}
.qore-env--staging {
  border-color: rgba(251, 191, 36, 0.55);
  background-image: linear-gradient(rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.1));
  color: #fbbf24;
}
.qore-env--on-prem {
  border-color: rgba(196, 181, 253, 0.55);
  background-image: linear-gradient(rgba(196, 181, 253, 0.1), rgba(196, 181, 253, 0.1));
  color: #c4b5fd;
}

/* Card: frosted glass; the theme owns its only border. */
.pf-v5-c-login__main,
.card-pf {
  background: var(--qore-card) !important;
  border: 1px solid var(--qore-line) !important;
  border-radius: 20px !important;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.45) !important;
  padding: 2.25rem 2.25rem 2rem !important;
  color: var(--qore-text) !important;
}
@media (max-width: 575px) {
  .pf-v5-c-login__main {
    padding: 1.75rem 1.5rem 1.5rem !important;
  }
}
.pf-v5-c-login__main-header,
.pf-v5-c-login__main-body,
.pf-v5-c-login__main-footer {
  padding-inline: 0 !important;
}
.pf-v5-c-login__main-header {
  padding-block-start: 0 !important;
  border-top: 0 !important;
}
#kc-page-title,
.pf-v5-c-login__main-header .pf-v5-c-title {
  font-family: "Hanken Grotesk", system-ui, sans-serif !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--qore-ink) !important;
}
.pf-v5-c-login__main-footer-band {
  border-block-start-color: var(--qore-line) !important;
  color: var(--qore-muted) !important;
}

/* Text */
.pf-v5-c-login__main-body,
.pf-v5-c-login__main-header-desc,
.instruction,
#kc-info-message,
#kc-form-options {
  color: var(--qore-label) !important;
}
label,
.pf-v5-c-form__label,
.pf-v5-c-form__label-text,
.pf-v5-c-check__label {
  color: var(--qore-label) !important;
  font-weight: 600;
}
.pf-v5-c-form__helper-text,
.pf-v5-c-helper-text__item-text {
  color: var(--qore-muted) !important;
}
.pf-v5-c-helper-text__item.pf-m-error .pf-v5-c-helper-text__item-text,
.pf-v5-c-form__label-required {
  color: #fca5a5 !important;
}

/* Links */
a,
.pf-v5-c-button.pf-m-link {
  color: var(--qore-cyan) !important;
}
a:hover,
.pf-v5-c-button.pf-m-link:hover {
  color: var(--qore-cyan-hover) !important;
}

/* Inputs. PatternFly v5 wraps each input in `.pf-v5-c-form-control`, which draws its own box
   (::before) and a dark underline (::after); next to the password reveal button that underline
   showed as a stray line. The wrapper is made transparent and borderless with its pseudo-elements
   removed, so the inner input carries the single rounded border. */
.pf-v5-c-form-control {
  --pf-v5-c-form-control--before--BorderTopWidth: 0 !important;
  --pf-v5-c-form-control--before--BorderRightWidth: 0 !important;
  --pf-v5-c-form-control--before--BorderLeftWidth: 0 !important;
  --pf-v5-c-form-control--after--BorderBottomWidth: 0 !important;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.pf-v5-c-form-control::before,
.pf-v5-c-form-control::after {
  display: none !important;
  border: none !important;
  content: none !important;
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea,
.pf-v5-c-form-control > input,
.pf-v5-c-form-control > select,
.pf-v5-c-form-control > textarea {
  background: var(--qore-field) !important;
  color: var(--qore-text) !important;
  border: 1px solid var(--qore-field-line) !important;
  border-radius: 10px !important;
  padding: 0.65rem 0.85rem !important;
  font-family: "Hanken Grotesk", system-ui, sans-serif !important;
}
input::placeholder,
textarea::placeholder {
  color: #64748b;
}
input:focus,
select:focus,
textarea:focus {
  outline: none !important;
  border-color: var(--qore-cyan) !important;
  box-shadow: 0 0 0 3px var(--qore-ring) !important;
}
input[aria-invalid="true"],
.pf-v5-c-form-control.pf-m-error > input {
  border-color: #f87171 !important;
}
/* Browser autofill paints a light background with dark text; keep the dark field instead. */
input:-webkit-autofill,
input:-webkit-autofill:hover {
  -webkit-text-fill-color: var(--qore-text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--qore-autofill) inset !important;
  box-shadow: 0 0 0 1000px var(--qore-autofill) inset !important;
  caret-color: var(--qore-text);
}
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--qore-text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--qore-autofill) inset, 0 0 0 3px var(--qore-ring) !important;
  box-shadow: 0 0 0 1000px var(--qore-autofill) inset, 0 0 0 3px var(--qore-ring) !important;
}

/* Password field + reveal toggle: only the password input is bordered. Every border/divider is
   stripped from the input-group subtree so no stray vertical line renders between the field and
   the reveal button, and the reveal is a bare icon button. */
.pf-v5-c-input-group,
.pf-v5-c-input-group__item {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  gap: 6px !important;
}
.pf-v5-c-input-group::before,
.pf-v5-c-input-group::after,
.pf-v5-c-input-group__item::before,
.pf-v5-c-input-group__item::after {
  content: none !important;
  display: none !important;
  border: 0 !important;
}
.pf-v5-c-button.pf-m-control {
  --pf-v5-c-button--after--BorderWidth: 0 !important;
  background: transparent !important;
  color: var(--qore-muted) !important;
  border: 0 !important;
  box-shadow: none !important;
}
.pf-v5-c-button.pf-m-control::before,
.pf-v5-c-button.pf-m-control::after {
  content: none !important;
  display: none !important;
  border: 0 !important;
}
.pf-v5-c-button.pf-m-control svg,
.pf-v5-c-button.pf-m-control i {
  color: currentColor !important;
  fill: currentColor !important;
}
.pf-v5-c-button.pf-m-control:hover {
  color: var(--qore-cyan) !important;
}
.pf-v5-c-button.pf-m-control:focus-visible {
  outline: 2px solid var(--qore-cyan) !important;
  outline-offset: 2px !important;
}

/* Primary action: teal to indigo with a soft cyan glow. White text is 5.4:1 on the teal end and
   7.9:1 on the indigo end (WCAG AA); hover lifts and glows rather than brightening, which would
   drop the teal end below 4.5:1. */
input[type="submit"],
button[type="submit"],
#kc-login,
.pf-v5-c-button.pf-m-primary {
  background: linear-gradient(90deg, var(--qore-teal), var(--qore-indigo)) !important;
  color: #ffffff !important;
  border: 0 !important;
  border-radius: 10px !important;
  font-family: "Hanken Grotesk", system-ui, sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  padding-block: 0.75rem !important;
  box-shadow: 0 10px 28px rgba(34, 211, 238, 0.22) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
input[type="submit"]:hover,
button[type="submit"]:hover,
#kc-login:hover,
.pf-v5-c-button.pf-m-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(34, 211, 238, 0.36) !important;
}
input[type="submit"]:focus-visible,
button[type="submit"]:focus-visible,
#kc-login:focus-visible,
.pf-v5-c-button.pf-m-primary:focus-visible {
  outline: 2px solid var(--qore-cyan) !important;
  outline-offset: 2px !important;
}
.pf-v5-c-button.pf-m-primary::after,
#kc-login::after {
  border: 0 !important;
}
/* Secondary actions (e.g. "Cancel" on required-action pages): a quiet outlined button. */
.pf-v5-c-button.pf-m-secondary,
.pf-v5-c-button.pf-m-tertiary {
  background: transparent !important;
  color: var(--qore-text) !important;
  border: 1px solid var(--qore-field-line) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}
.pf-v5-c-button.pf-m-secondary::after,
.pf-v5-c-button.pf-m-tertiary::after {
  border: 0 !important;
}

/* Feedback banners (e.g. "You need to change your password."): dark, tinted per severity with a
   left accent, light text. Legacy `.alert-*` selectors cover any non-PatternFly message. */
.pf-v5-c-alert,
#kc-content-wrapper .alert,
.alert {
  background: rgba(251, 191, 36, 0.08) !important;
  color: var(--qore-text) !important;
  border: 1px solid rgba(251, 191, 36, 0.35) !important;
  border-left: 4px solid #fbbf24 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  padding: 0.85rem 1rem !important;
}
.pf-v5-c-alert__title,
.pf-v5-c-alert__description,
.kc-feedback-text,
.alert .kc-feedback-text {
  color: var(--qore-text) !important;
  font-family: "Hanken Grotesk", system-ui, sans-serif !important;
  font-weight: 600 !important;
}
.pf-v5-c-alert__icon,
.pf-v5-c-alert__icon svg {
  fill: currentColor !important;
  color: #fbbf24 !important;
}
.pf-v5-c-alert.pf-m-warning {
  border-left-color: #fbbf24 !important;
}
.pf-v5-c-alert.pf-m-danger,
.alert-error,
.alert-danger {
  background: rgba(248, 113, 113, 0.1) !important;
  border-color: rgba(248, 113, 113, 0.4) !important;
  border-left-color: #f87171 !important;
}
.pf-v5-c-alert.pf-m-danger .pf-v5-c-alert__icon,
.pf-v5-c-alert.pf-m-danger .pf-v5-c-alert__icon svg {
  color: #f87171 !important;
}
.pf-v5-c-alert.pf-m-success,
.alert-success {
  background: rgba(74, 222, 128, 0.08) !important;
  border-color: rgba(74, 222, 128, 0.35) !important;
  border-left-color: #4ade80 !important;
}
.pf-v5-c-alert.pf-m-success .pf-v5-c-alert__icon,
.pf-v5-c-alert.pf-m-success .pf-v5-c-alert__icon svg {
  color: #4ade80 !important;
}
.pf-v5-c-alert.pf-m-info,
.alert-info {
  background: rgba(103, 232, 249, 0.08) !important;
  border-color: rgba(103, 232, 249, 0.35) !important;
  border-left-color: var(--qore-cyan) !important;
}
.pf-v5-c-alert.pf-m-info .pf-v5-c-alert__icon,
.pf-v5-c-alert.pf-m-info .pf-v5-c-alert__icon svg {
  color: var(--qore-cyan) !important;
}
