:root {
  --keycloak-logo-url: url('../img/keycloak-logo-text.svg');
  --keycloak-bg-logo-url: url("../img/keycloak-bg.png");
  --keycloak-logo-height: 63px;
  --keycloak-logo-width: 300px;
  --keycloak-card-top-color: var(--pf-v5-global--palette--blue-400);

  --rc-bg: #2a2d31;
  --rc-bg-input: #353a40;
  --rc-bg-input-hover: #40464d;
  --rc-text: #e6edf3;
  --rc-text-dim: #aeb6bf;
  --rc-brand: #dc3545;
}

/* Container */
.pf-v5-c-login__container {
  grid-template-columns: 34rem;
  grid-template-areas: "header" "main";
}

/* Hintergrund */
.login-pf body {
  background: var(--keycloak-bg-logo-url) no-repeat center center fixed;
  background-size: cover;
  height: 100%;
}

/* Logo */
div.kc-logo-text {
  background-image: var(--keycloak-logo-url);
  height: var(--keycloak-logo-height);
  width: var(--keycloak-logo-width);
  background-repeat: no-repeat;
  background-size: contain;
  margin: 0 auto;
}
div.kc-logo-text span { display: none; }

/* Card */
.pf-v5-c-login__main {
  background: var(--rc-bg);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
  backdrop-filter: blur(30px) !important;
  background: rgba(255, 255, 255, 0.10) !important;
}

/* Schriftart global */
body,
input,
button,
label,
h1, h2, h3, h4, h5, h6,
.pf-v5-c-login__main,
.pf-v5-c-form-control,
.pf-v5-c-button {
  font-family: 'Play', sans-serif !important;
  color: var(--rc-text);
}

/* ===========================================
   Eingabefelder
   =========================================== */

/* Wrapper neutralisieren */
#kc-form-login .pf-v5-c-form-control {
  all: unset;
  display: block;
  width: 100%;
}

/* Username Feld */
#kc-form-login input#username {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  background: var(--rc-bg-input);
  color: var(--rc-text);
  padding: 12px;
  font-size: 0.95rem;
  border-radius: 14px;
  border: 2px solid transparent;
  transition: border .2s, background .2s;
}
#kc-form-login input#username:focus {
  border: 2px solid var(--rc-brand);
  background: var(--rc-bg-input-hover);
}

/* ===========================================
   Passwort-Gruppe
   =========================================== */
#kc-form-login .pf-v5-c-input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--rc-bg-input);
  transition: border .2s, background .2s;
}

/* Fokus: gesamte Gruppe rot umranden */
#kc-form-login .pf-v5-c-input-group:focus-within {
  border: 2px solid var(--rc-brand);
  background: var(--rc-bg-input-hover);
}

/* Passwort Input (links rund, ohne eigenen Rahmen) */
#kc-form-login .pf-v5-c-input-group__item.pf-m-fill input#password {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  color: var(--rc-text);
  padding: 12px;
  font-size: 0.95rem;
  border-radius: 14px 0 0 14px;
  background: transparent; /* Wrapper übernimmt Hintergrund */
}

/* Auge Button (rechts rund) */
#kc-form-login .pf-v5-c-input-group__item:last-child .pf-v5-c-button.pf-m-control {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: var(--rc-text-dim);
  border-radius: 0 14px 14px 0;
  background: var(--rc-bg-input);
  cursor: pointer;
  transition: background .2s, color .2s;
}
#kc-form-login .pf-v5-c-input-group__item:last-child .pf-v5-c-button.pf-m-control:hover {
  background: var(--rc-bg-input-hover);
  color: #fff;
}

/* Platzhalter */
#kc-form-login input::placeholder {
  color: var(--rc-text-dim);
}

/* ===========================================
   Buttons
   =========================================== */
.pf-v5-c-button.pf-m-primary {
  width: 100%;
  background: var(--rc-brand);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 12px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background .2s;
}
.pf-v5-c-button.pf-m-primary:hover {
  background: #b02a37;
}

/* ===========================================
   Checkbox (Remember me)
   =========================================== */
#kc-form-login .pf-v5-c-check__input {
  accent-color: var(--rc-brand);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
#kc-form-login .pf-v5-c-check__label {
  color: var(--rc-text-dim);
  margin-left: 4px;
  font-size: 0.9rem;
}

/* ===========================================
   Links
   =========================================== */
#kc-form-login a {
  color: #dc3545;
  text-decoration: none;
}
#kc-form-login a:hover {
  text-decoration: underline;
}

/* ===========================================
   Fix: Zusätzliche Borders deaktivieren
   =========================================== */
#kc-form-login .pf-v5-c-input-group,
#kc-form-login .pf-v5-c-input-group__item {
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Globale Border Variablen überschreiben */
:root,
.pf-v5-c-login {
  --pf-v5-global--BorderWidth--sm: 0 !important;
  --pf-v5-global--BorderWidth--md: 0 !important;
  --pf-v5-global--BorderWidth--lg: 0 !important;
  --pf-v5-global--BorderWidth--xl: 0 !important;

  --pf-v5-global--BorderColor--100: transparent !important;
  --pf-v5-global--BorderColor--200: transparent !important;
  --pf-v5-global--BorderColor--300: transparent !important;
  --pf-v5-global--BorderColor--dark-100: transparent !important;
  --pf-v5-global--BorderColor--light-100: transparent !important;

  --pf-v5-c-login__main-footer-band--BorderTopColor: transparent !important;
  --pf-v5-c-login__main-footer-band--BorderBottomColor: transparent !important;
}

/* Secondary Button (grau) */
.pf-v5-c-button.pf-m-secondary {
  width: 100%;
  background: var(--rc-bg-input);
  color: var(--rc-text-dim);
  border: none;
  border-radius: 14px;
  padding: 12px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  transition: background .2s, color .2s;
  display: inline-block;
  text-decoration: none;
}

.pf-v5-c-button.pf-m-secondary:hover {
  background: var(--rc-bg-input-hover);
  color: #fff;
}

/* Sekundärer Button (Register) */
.rc-button-secondary {
  display: block;
  width: 100%;
  text-align: center;
  background: #6c757d;       /* Grau */
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 12px;             /* gleich wie .pf-m-primary */
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 12px;
  transition: background .2s;
}

.rc-button-secondary:hover {
  background: #5a6268;       /* dunkleres Grau beim Hover */
  text-decoration: none;
}

#kc-registration {
  margin-top: 12px; /* gleichmäßiger Abstand nach oben */
}

/* Fix: Register-Button soll gleiche Breite haben wie Sign In */
#kc-info,
#kc-registration-container,
#kc-registration {
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin: 0 !important;
  width: 100%;
}

#kc-registration .rc-button-secondary {
  display: block;
  width: 100%;
}

/* ===========================================
   Language Selector – robust & final
   =========================================== */

/* Header: Dropdown über Titel rechts */
.pf-v5-c-login__main-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .5rem;
}
.pf-v5-c-login__main-header-utilities {
  order: -1;
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-bottom: 1rem;
}

/* Wrapper für das Select */
.pf-v5-c-login__main-header-utilities .pf-v5-c-form-control {
  position: relative;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  min-width: 9rem;
  max-width: 9rem;
}

/* >>> PatternFly-Arrow AUS (verhindert das schwarze Icon) */
.pf-v5-c-login__main-header-utilities .pf-v5-c-form-control__utilities,
.pf-v5-c-login__main-header-utilities .pf-v5-c-form-control__toggle-icon {
  display: none !important;
}

/* Das Select selbst */
#login-select-toggle {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none !important;

  width: 100%;
  height: 40px;
  border: 2px solid transparent !important;
  border-radius: 8px;
  background-color: var(--rc-bg-input) !important;
  color: var(--rc-text);
  font-family: 'Play', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0 36px 0 40px;

  /* Platzierung für Flagge (links) + unseren Pfeil (rechts) */
  background-repeat: no-repeat;
  background-position: 8px center, right 12px center;
  background-size: 20px auto, 14px auto;
  box-shadow: none !important;
  transition: border .2s, background .2s;
}

/* Hover + Fokus */
#login-select-toggle:hover {
  background-color: var(--rc-bg-input-hover) !important;
}
#login-select-toggle:focus {
  border: 2px solid var(--rc-brand) !important;
  outline: none !important;
  background-color: var(--rc-bg-input-hover) !important;
}

/* Standard: DE (wird gleich von :has() übersteuert wenn nötig) */
#login-select-toggle {
  background-image:
    url("https://flagcdn.com/w20/de.png"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 320 512'><path d='M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z'/></svg>");
}

/* >>> Flagge umschalten über die ausgewählte Option (robust) */
#login-select-toggle:has(option[value*="kc_locale=de"]:checked) {
  background-image:
    url("https://flagcdn.com/w20/de.png"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 320 512'><path d='M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z'/></svg>");
}
#login-select-toggle:has(option[value*="kc_locale=en"]:checked) {
  background-image:
    url("https://flagcdn.com/w20/gb.png"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 320 512'><path d='M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z'/></svg>");
}

/* Options-Liste dunkel, ohne Flaggen */
#login-select-toggle option {
  background: var(--rc-bg) !important;
  color: #fff !important;
  padding-left: .5rem;
}

/* ===========================
   Mobile spacing for the card
   =========================== */

/* Tablet & kleiner: Card darf volle Breite nutzen */
@media (max-width: 992px) {
  .pf-v5-c-login__container {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Handy: links/rechts Abstand, damit die Rundung sichtbar ist */
@media (max-width: 768px) {
  .pf-v5-c-login__main {
    margin-left: 24px;
    margin-right: 24px;
    border-radius: 16px; /* etwas runder wirkt auf Mobile besser */
  }
}

/* Sehr kleine Phones */
@media (max-width: 420px) {
  .pf-v5-c-login__main {
    margin-left: 16px;
    margin-right: 16px;
  }

  /* Optional: Language-Select etwas kompakter */
  .pf-v5-c-login__main-header-utilities .pf-v5-c-form-control {
    min-width: 8rem;
    max-width: 8rem;
  }
}

/* ===========================================
   Register Seite – Style an Login angepasst
   =========================================== */

/* Gleicher Container */
#kc-register-form .pf-v5-c-form__group {
  margin-bottom: 1rem;
}

/* Labels */
#kc-register-form .pf-v5-c-form__label-text {
  font-weight: 600;
  color: var(--rc-text);
  font-size: 0.95rem;
}

#kc-register-form .pf-v5-c-form__label-required {
  color: var(--rc-brand);
  margin-left: 4px;
}

/* Inputs */
#kc-register-form input[type="text"],
#kc-register-form input[type="password"],
#kc-register-form input[type="email"],
#kc-register-form input[type="tel"],
#kc-register-form input[type="date"] {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  background: var(--rc-bg-input);
  color: var(--rc-text);
  padding: 12px;
  font-size: 0.95rem;
  border-radius: 14px;
  border: 2px solid transparent;
  transition: border .2s, background .2s;
}

#kc-register-form input:focus {
  border: 2px solid var(--rc-brand);
  background: var(--rc-bg-input-hover);
}

/* Date Input spezielle Anpassungen */
#kc-register-form input[type="date"] {
  color-scheme: dark; /* Browser-nativer Dark Mode für Date Picker */
  cursor: pointer;
}

#kc-register-form input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1); /* Macht das Kalender-Icon weiß */
  cursor: pointer;
}

/* ===========================================
   Passwort-Gruppe (Register-Seite)
   =========================================== */
#kc-register-form .pf-v5-c-input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--rc-bg-input);
  transition: border .2s, background .2s;
}

/* Fokus: gesamte Gruppe rot umranden */
#kc-register-form .pf-v5-c-input-group:focus-within {
  border: 2px solid var(--rc-brand);
  background: var(--rc-bg-input-hover);
}

/* Input links ohne eigenen Rahmen */
#kc-register-form .pf-v5-c-input-group__item.pf-m-fill input {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  color: var(--rc-text);
  padding: 12px;
  font-size: 0.95rem;
  border-radius: 14px 0 0 14px;
  background: transparent; /* Wrapper übernimmt */
}

/* Auge-Button rechts */
#kc-register-form .pf-v5-c-input-group__item:last-child .pf-v5-c-button.pf-m-control {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: var(--rc-text-dim);
  border-radius: 0 14px 14px 0;
  background: var(--rc-bg-input);
  cursor: pointer;
  transition: background .2s, color .2s;
}
#kc-register-form .pf-v5-c-input-group__item:last-child .pf-v5-c-button.pf-m-control:hover {
  background: var(--rc-bg-input-hover);
  color: #fff;
}


/* Select (z. B. Land) */
#kc-register-form select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  background: var(--rc-bg-input);
  color: var(--rc-text);
  font-size: 0.95rem;
  padding: 12px;
  border: 2px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: border .2s, background .2s;
}
#kc-register-form select:focus {
  border: 2px solid var(--rc-brand);
  background: var(--rc-bg-input-hover);
}
#kc-register-form select option {
  background: var(--rc-bg);
  color: #fff;
}

/* Button Registrieren */
#kc-register-form input[type="submit"] {
  width: 100%;
  background: var(--rc-brand);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 12px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background .2s;
}
#kc-register-form input[type="submit"]:hover {
  background: #b02a37;
}

/* Zurück zur Anmeldung Link */
#kc-form-options a {
  display: inline-block;
  margin-top: 1rem;
  color: var(--rc-brand);
  font-weight: 500;
  text-decoration: none;
}
#kc-form-options a:hover {
  text-decoration: underline;
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
  .pf-v5-c-login__main {
    margin-left: 24px;
    margin-right: 24px;
  }
}
@media (max-width: 420px) {
  .pf-v5-c-login__main {
    margin-left: 16px;
    margin-right: 16px;
  }
}

/* ===========================================
   Fix: Weiße Wrapper-Blöcke bei Register-Feldern entfernen
   =========================================== */

/* Wrapper neutralisieren (alle Felder) */
#kc-register-form .pf-v5-c-form-control {
  all: unset;
  display: block;
  width: 100%;
}

/* Inputs direkt im Wrapper */
#kc-register-form .custom-input-wrapper input,
#kc-register-form input[type="text"],
#kc-register-form input[type="password"],
#kc-register-form input[type="email"],
#kc-register-form input[type="tel"],
#kc-register-form input[type="date"] {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  background: var(--rc-bg-input);
  color: var(--rc-text);
  padding: 12px;
  font-size: 0.95rem;
  border-radius: 14px;
  border: 2px solid transparent;
  transition: border .2s, background .2s;
}

#kc-register-form .custom-input-wrapper input:focus,
#kc-register-form input:focus {
  border: 2px solid var(--rc-brand);
  background: var(--rc-bg-input-hover);
}

/* ===========================================
   Fix: Doppelrahmen bei Passwort-Gruppe Register
   =========================================== */

/* Inputs in Passwort-Gruppen: kein eigener Border */
#kc-register-form .pf-v5-c-input-group__item.pf-m-fill input {
  border: none !important;      /* verhindert doppelten Rand */
  border-radius: 14px 0 0 14px; /* nur links rund */
  background: transparent;      /* Hintergrund vom Wrapper */
}

/* Rechts: Auge-Button ohne eigenen Border */
#kc-register-form .pf-v5-c-input-group__item:last-child {
  border: none !important;
}


/* ===========================================
   Register – gleiches Spacing wie Login
   =========================================== */

/* Alle Gruppen im Register-Formular */
#kc-register-form .pf-v5-c-form__group {
  margin-bottom: 0.75rem !important; /* enger, wie Login */
}

/* Speziell: letztes Feld (Land) nicht zu nah an Button */
#kc-register-form .pf-v5-c-form__group:last-of-type {
  margin-bottom: 1.25rem !important;
}

/* ===========================================
   Register – Select: weißer Pfeil rechts, PF-Pfeil aus
   =========================================== */

/* Nur Selects im Register-Form */
#kc-register-form .pf-v5-c-form-control > select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none !important;

  width: 100%;
  background: var(--rc-bg-input);
  color: var(--rc-text);
  font-size: 0.95rem;
  padding: 12px;
  border: 2px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: border .2s, background .2s;

  /* Platz für unseren Pfeil */
  padding-right: 44px;

  /* Unser weißer Pfeil rechts */
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512' fill='white'>\
<path d='M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 10px;   /* etwas größer sichtbar */
}

/* Hover/Fokus wie bei Inputs */
#kc-register-form .pf-v5-c-form-control > select:hover {
  background-color: var(--rc-bg-input-hover);
}
#kc-register-form .pf-v5-c-form-control > select:focus {
  border: 2px solid var(--rc-brand);
  background-color: var(--rc-bg-input-hover);
}

/* Dunkle Optionsliste */
#kc-register-form .pf-v5-c-form-control > select option {
  background: var(--rc-bg) !important;
  color: #fff !important;
}

/* PatternFly-Utilities (schwarzer Pfeil) ausblenden */
#kc-register-form .pf-v5-c-form-control > select + .pf-v5-c-form-control__utilities,
#kc-register-form .pf-v5-c-form-control > select + .pf-v5-c-form-control__toggle-icon {
  display: none !important;
}

/* ===========================================
   Register-Seite: 2-Spalten Layout nur Desktop
   =========================================== */

[data-page-id="login-register"] .pf-v5-c-login__container {
  grid-template-columns: 65rem; /* größer als Login */
}

@media (min-width: 992px) {
  [data-page-id="login-register"] #kc-register-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 2rem; /* vertikal / horizontal */
  }

  [data-page-id="login-register"] #kc-register-form .pf-v5-c-form__group {
    margin-bottom: 0;
  }

  /* Buttons und Footer über beide Spalten */
  [data-page-id="login-register"] #kc-register-form #kc-form-buttons,
  [data-page-id="login-register"] #kc-register-form .pf-v5-c-login__main-footer-band {
    grid-column: 1 / -1;
    margin-top: 1rem;
  }
}

/* ===========================================
   Konkrete Felder nebeneinander anordnen
   =========================================== */
@media (min-width: 992px) {
  /* Vorname / Nachname */
  #kc-register-form #firstName { grid-column: 1; }
  #kc-register-form #lastName { grid-column: 2; }

  /* Straße / Hausnummer */
  #kc-register-form #street { grid-column: 1; }
  #kc-register-form #haus-nr { grid-column: 2; }

  /* PLZ / Stadt */
  #kc-register-form #plz { grid-column: 1; }
  #kc-register-form #ort { grid-column: 2; }

  /* E-Mail / Telefon */
  #kc-register-form #email { grid-column: 1; }
  #kc-register-form #phone { grid-column: 2; }

  /* Anrede / Land */
  #kc-register-form #anrede { grid-column: 1; }
  #kc-register-form #land { grid-column: 2; }

  /* Passwort / Passwort bestätigen */
  #kc-register-form #password { grid-column: 1; }
  #kc-register-form #password-confirm { grid-column: 2; }
}

[data-page-id="login-register"] #kc-register-form .pf-v5-c-form__group {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

[data-page-id="login-register"] .form-section {
  grid-column: 1 / -1;
  font-weight: 600;
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--rc-text-dim);
}

/* ===========================================
   Passwort vergessen – Style fix
   =========================================== */

/* Wrapper neutralisieren */
#kc-reset-password-form .pf-v5-c-form-control {
  all: unset;
  display: block;
  width: 100%;
}

/* Input Styling (wie bei Login & Register) */
#kc-reset-password-form input[type="text"],
#kc-reset-password-form input[type="email"] {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  background: var(--rc-bg-input);
  color: var(--rc-text);
  padding: 12px;
  font-size: 0.95rem;
  border-radius: 14px;
  border: 2px solid transparent;
  transition: border .2s, background .2s;
}

/* Fokuszustand */
#kc-reset-password-form input[type="text"]:focus,
#kc-reset-password-form input[type="email"]:focus {
  border: 2px solid var(--rc-brand);
  background: var(--rc-bg-input-hover);
}

/* ===========================================
   Passwort aktualisieren – Style fix
   =========================================== */

/* Wrapper neutralisieren */
#kc-passwd-update-form .pf-v5-c-form-control {
  all: unset;
  display: block;
  width: 100%;
}

/* Passwort-Gruppe für Update-Formular */
#kc-passwd-update-form .pf-v5-c-input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--rc-bg-input);
  transition: border .2s, background .2s;
}

/* Fokus: gesamte Gruppe rot umranden */
#kc-passwd-update-form .pf-v5-c-input-group:focus-within {
  border: 2px solid var(--rc-brand);
  background: var(--rc-bg-input-hover);
}

/* Passwort Input (links rund, ohne eigenen Rahmen) */
#kc-passwd-update-form .pf-v5-c-input-group__item.pf-m-fill input {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  color: var(--rc-text);
  padding: 12px;
  font-size: 0.95rem;
  border-radius: 14px 0 0 14px;
  background: transparent;
}

/* Auge Button (rechts rund) */
#kc-passwd-update-form .pf-v5-c-input-group__item:last-child .pf-v5-c-button.pf-m-control {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: var(--rc-text-dim);
  border-radius: 0 14px 14px 0;
  background: var(--rc-bg-input);
  cursor: pointer;
  transition: background .2s, color .2s;
}
#kc-passwd-update-form .pf-v5-c-input-group__item:last-child .pf-v5-c-button.pf-m-control:hover {
  background: var(--rc-bg-input-hover);
  color: #fff;
}

/* Platzhalter */
#kc-passwd-update-form input::placeholder {
  color: var(--rc-text-dim);
}

/* Labels */
#kc-passwd-update-form .pf-v5-c-form__label-text {
  font-weight: 600;
  color: var(--rc-text);
  font-size: 0.95rem;
}

#kc-passwd-update-form .pf-v5-c-form__label-required {
  color: var(--rc-brand);
  margin-left: 4px;
}

/* Buttons */
#kc-passwd-update-form .pf-v5-c-button.pf-m-primary {
  width: 100%;
  background: var(--rc-brand);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 12px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background .2s;
}
#kc-passwd-update-form .pf-v5-c-button.pf-m-primary:hover {
  background: #b02a37;
}

/* Secondary Button (z.B. Cancel) */
#kc-passwd-update-form .pf-v5-c-button.pf-m-secondary {
  background: var(--rc-bg-input);
  color: var(--rc-text-dim);
  border: none;
  border-radius: 14px;
  padding: 12px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background .2s, color .2s;
}
#kc-passwd-update-form .pf-v5-c-button.pf-m-secondary:hover {
  background: var(--rc-bg-input-hover);
  color: #fff;
}

/* Checkbox für "Logout from other sessions" */
#kc-passwd-update-form input[type="checkbox"] {
  accent-color: var(--rc-brand);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

#kc-passwd-update-form .pf-v5-c-check__label {
  color: var(--rc-text-dim);
  margin-left: 4px;
  font-size: 0.9rem;
}

/* Button Group Spacing */
#kc-passwd-update-form .pf-v5-c-form__actions {
  display: flex;
  gap: 12px;
  margin-top: 1.5rem;
}

/* Wenn nur ein Button (ohne Cancel) volle Breite */
#kc-passwd-update-form .pf-v5-c-form__actions .pf-v5-c-button:only-child {
  width: 100%;
}

/* ===========================================
   TOTP / Mehrfachauthentifizierung konfigurieren
   =========================================== */

/* Anweisungsliste */
#kc-totp-settings {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  list-style-position: inside;
}

#kc-totp-settings li {
  color: var(--rc-text);
  margin-bottom: 1rem;
  line-height: 1.6;
}

#kc-totp-settings li:last-child {
  margin-bottom: 0;
}

#kc-totp-settings p {
  color: var(--rc-text);
  margin: 0.5rem 0;
}

/* Unterliste für unterstützte Apps */
#kc-totp-supported-apps {
  list-style: disc;
  margin-left: 1.5rem;
  margin-top: 0.5rem;
}

#kc-totp-supported-apps li {
  color: var(--rc-text-dim);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

/* QR Code */
#kc-totp-secret-qr-code {
  background: white;
  padding: 20px;
  border-radius: 12px;
  margin: 1.5rem auto;
  display: block;
  max-width: 350px;
  width: 100%;
}

/* Secret Key (manueller Modus) */
#kc-totp-secret-key {
  background: var(--rc-bg-input);
  color: var(--rc-brand);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: bold;
  display: inline-block;
  letter-spacing: 2px;
}

/* Links (Barcode/Manual umschalten) */
#kc-totp-settings a {
  color: var(--rc-brand);
  text-decoration: none;
  font-weight: 500;
}

#kc-totp-settings a:hover {
  text-decoration: underline;
}

/* Technische Details Liste */
#kc-totp-settings ul ul {
  list-style: none;
  margin-left: 1rem;
  margin-top: 0.5rem;
}

#kc-totp-settings ul ul li {
  color: var(--rc-text-dim);
  font-size: 0.9rem;
  font-family: 'Courier New', monospace;
}

/* Formular */
#kc-totp-settings-form .pf-v5-c-form-control {
  all: unset;
  display: block;
  width: 100%;
}

/* Input-Felder */
#kc-totp-settings-form input[type="text"] {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  background: var(--rc-bg-input);
  color: var(--rc-text);
  padding: 12px;
  font-size: 0.95rem;
  border-radius: 14px;
  border: 2px solid transparent;
  transition: border .2s, background .2s;
}

#kc-totp-settings-form input[type="text"]:focus {
  border: 2px solid var(--rc-brand);
  background: var(--rc-bg-input-hover);
}

/* OTP Code Feld (größere Schrift für bessere Lesbarkeit) */
#kc-totp-settings-form input#totp {
  font-size: 1.2rem;
  letter-spacing: 2px;
  text-align: center;
  font-weight: bold;
}

/* Labels */
#kc-totp-settings-form .pf-v5-c-form__label-text {
  font-weight: 600;
  color: var(--rc-text);
  font-size: 0.95rem;
}

#kc-totp-settings-form .pf-v5-c-form__label-required {
  color: var(--rc-brand);
  margin-left: 4px;
}

/* Buttons */
#kc-totp-settings-form input[type="submit"],
#kc-totp-settings-form .pf-v5-c-button.pf-m-primary {
  width: 100%;
  background: var(--rc-brand);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 12px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background .2s;
}

#kc-totp-settings-form input[type="submit"]:hover,
#kc-totp-settings-form .pf-v5-c-button.pf-m-primary:hover {
  background: #b02a37;
}

/* Cancel Button */
#kc-totp-settings-form button[name="cancel-aia"],
#kc-totp-settings-form .pf-v5-c-button.pf-m-default {
  background: var(--rc-bg-input);
  color: var(--rc-text-dim);
  border: none;
  border-radius: 14px;
  padding: 12px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background .2s, color .2s;
}

#kc-totp-settings-form button[name="cancel-aia"]:hover,
#kc-totp-settings-form .pf-v5-c-button.pf-m-default:hover {
  background: var(--rc-bg-input-hover);
  color: #fff;
}

/* Checkbox für "Logout from other sessions" */
#kc-totp-settings-form input[type="checkbox"] {
  accent-color: var(--rc-brand);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

#kc-totp-settings-form .pf-v5-c-check__label {
  color: var(--rc-text-dim);
  margin-left: 4px;
  font-size: 0.9rem;
}

/* Button Group Spacing */
#kc-totp-settings-form .pf-v5-c-form__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 1.5rem;
}

/* Alle Buttons volle Breite */
#kc-totp-settings-form .pf-v5-c-form__actions input,
#kc-totp-settings-form .pf-v5-c-form__actions button {
  width: 100%;
}

/* Error Messages */
#kc-totp-settings-form .pf-v5-c-form__helper-text--error,
#kc-totp-settings-form span[id^="input-error"] {
  color: var(--rc-brand);
  font-size: 0.85rem;
  margin-top: 4px;
  display: block;
}

/* ===========================================
   Register – Checkbox für Terms & AGBs/Datenschutz Links
   =========================================== */

/* Checkbox Styling */
#kc-register-form input[type="checkbox"] {
  accent-color: var(--rc-brand);
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin-right: 8px;
}

/* Label neben der Checkbox */
#kc-register-form label[for="termsAccepted"] {
  color: var(--rc-text);
  font-size: 0.95rem;
  cursor: pointer;
}

/* Links in den Bedingungen (AGBs, Datenschutzerklärung) ROT */
#kc-register-form a,
#kc-registration-terms-text a {
  color: var(--rc-brand) !important;
  text-decoration: none;
  font-weight: 500;
}

#kc-register-form a:hover,
#kc-registration-terms-text a:hover {
  text-decoration: underline;
}

/* Fehlertext bei Checkbox */
#kc-register-form .pf-v5-c-form__helper-text {
  color: var(--rc-brand);
  font-size: 0.85rem;
  margin-top: 4px;
}

