:root {
    --rkt-orange: #f60;
    --rkt-bg: #000;
    --rkt-card-bg: #1c1c1e;
    --rkt-card-border: rgba(255, 255, 255, 0.08);
    --rkt-text: #f5f5f7;
    --rkt-text-muted: #86868b;
    --rkt-input-bg: #111113;
    --rkt-input-border: rgba(255, 102, 0, 0.1);
    --rkt-input-focus: var(--rkt-orange);
    --rkt-radius: 16px;
    --rkt-radius-sm: 12px;
}

.login-pf {
    background: none;
}

.login-pf body {
    background: var(--rkt-bg);
    background-image:
        radial-gradient(circle at 30% 20%, rgba(161, 140, 209, 0.08), transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(255, 102, 0, 0.05), transparent 50%);
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    color: var(--rkt-text);
}

#kc-header {
    color: var(--rkt-text);
    overflow: visible;
    white-space: nowrap;
}

#kc-header-wrapper {
    padding: 40px 10px 10px;
    font-size: 0;
    text-align: center;
}

div.kc-logo-text {
    display: none;
}

div.kc-logo-text-rkt {
    background-image: url(../img/Rocket-NG-Logo.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    height: 70px;
    width: 240px;
    margin: 0 auto;
}

.rkt-logo-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.rkt-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--rkt-text);
    text-align: center;
    letter-spacing: -0.01em;
    margin: 0;
}

#kc-logo {
    width: 100%;
}

div.kc-logo-text span {
    display: none;
}

.card-pf {
    margin: 0 auto;
    max-width: 440px;
    background: var(--rkt-card-bg);
    border: 1px solid var(--rkt-card-border);
    border-top: none;
    border-radius: 30px;
    padding: 40px 36px;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.login-pf label,
.login-pf .control-label,
.pf-c-form__label-text {
    color: var(--rkt-text-muted);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.login-pf input[type="text"],
.login-pf input[type="password"],
.login-pf input[type="email"],
.login-pf input[type="tel"],
.pf-c-form-control {
    background: var(--rkt-input-bg);
    border: 1px solid var(--rkt-input-border);
    border-radius: var(--rkt-radius-sm);
    color: var(--rkt-text);
    padding: 12px 16px;
    font-size: 15px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    outline: none;
}

.login-pf input[type="text"]:focus,
.login-pf input[type="password"]:focus,
.login-pf input[type="email"]:focus,
.login-pf input[type="tel"]:focus,
.pf-c-form-control:focus {
    border-color: var(--rkt-input-focus);
    box-shadow: 0 0 0 3px rgba(161, 140, 209, 0.2);
}

.login-pf input::placeholder {
    color: #555;
}

textarea.pf-c-form-control {
    height: auto;
}

.login-pf .btn-primary,
.login-pf .pf-c-button.pf-m-primary,
#kc-login {
    background: var(--rkt-orange);
    border: 1px solid transparent;
    border-radius: 50px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 14px 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0;
    width: 100%;
    margin-top: 8px;
    margin-left: 0px;
}

.login-pf .btn-primary:hover,
.login-pf .pf-c-button.pf-m-primary:hover,
#kc-login:hover {
    background: transparent;
    border-color: var(--rkt-orange);
    color: var(--rkt-orange);
}

.button-register {
    background: transparent !important;
    border: 1.2px solid #8b5cf6 !important;
    border-radius: 50px !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 12px 28px !important;
    cursor: pointer;
    transition: all 0.3s ease !important;
    display: inline-block !important;
    width: auto !important;
    margin-top: 12px;
    text-decoration: none !important;
    animation: register-pulse 3s ease-out infinite;
    background: #8b5cf614 !important;
}

@keyframes register-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.6);
    }
    100% {
        box-shadow: 0 0 12px 8px rgba(139, 92, 246, 0);
    }
}

.button-register:hover {
    border-color: #a78bfa !important;
    color: #a78bfa !important;
    background: #8b5cf614 !important;
}

.pf-c-button.pf-m-control {
    border: solid var(--pf-global--BorderWidth--sm);
    border-color: var(--rkt-input-border);
    background: var(--rkt-input-bg);
    color: var(--rkt-text);
}

.login-pf a {
    color: var(--rkt-orange);
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-pf a:hover {
    color: #ccc;
}

#kc-form-options .checkbox {
    margin-top: 0;
    color: var(--rkt-text-muted);
}

#kc-form-options .checkbox label {
    text-transform: none;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0;
}

#kc-form-options .checkbox input[type="checkbox"] {
    accent-color: var(--rkt-orange);
}

.login-pf .${properties.kcFormOptionsWrapperClass!} a,
#kc-form-options + div a {
    font-size: 13px;
    color: var(--rkt-text-muted);
}

#kc-form-options + div a:hover {
    color: var(--rkt-orange);
}

#kc-form-options span {
    display: block;
}

h1#kc-page-title {
    margin-top: 10px;
    color: var(--rkt-text);
    font-weight: 600;
}

.pf-c-alert {
    background: rgba(161, 140, 209, 0.08);
    border: 1px solid rgba(161, 140, 209, 0.2);
    border-radius: var(--rkt-radius-sm);
    color: var(--rkt-text);
}

.pf-c-alert__title {
    font-size: 13px;
    color: var(--rkt-text);
}

.pf-c-alert.pf-m-danger {
    background: rgba(255, 80, 80, 0.08);
    border-color: rgba(255, 80, 80, 0.25);
}

p.instruction {
    margin: 5px 0;
    color: var(--rkt-text-muted);
}

#kc-info {
    margin: 30px -36px -40px;
    border-radius: 0 0 30px 30px;
    overflow: hidden;
}

#kc-info-wrapper {
    font-size: 14px;
    line-height: 1.6;
    padding: 24px 36px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--rkt-card-border);
    color: var(--rkt-text-muted);
    text-align: center;
}

#kc-registration {
    margin-bottom: 0;
}

#kc-registration-container {
    text-align: center;
}

#kc-content {
    width: 100%;
}

#kc-content-wrapper {
    margin-top: 20px;
}

#kc-form-wrapper {
    margin-top: 10px;
}

#kc-form-buttons {
    margin-top: 24px;
}

#kc-attempted-username {
    font-size: 18px;
    font-family: inherit;
    font-weight: 500;
    padding-right: 10px;
    color: var(--rkt-text);
}

#kc-username {
    text-align: center;
    margin-bottom: -10px;
}

#kc-locale ul {
    background-color: var(--rkt-card-bg);
    border: 1px solid var(--rkt-card-border);
    border-radius: 8px;
    display: none;
    top: 20px;
    min-width: 100px;
    padding: 4px 0;
}

#kc-locale-dropdown {
    display: inline-block;
}

#kc-locale-dropdown:hover ul {
    display: block;
}

#kc-locale-dropdown a,
#kc-locale-dropdown button {
    color: var(--rkt-text-muted);
    text-align: right;
    font-size: 13px;
}

#kc-current-locale-link::after {
    content: "\2c5";
    margin-left: 4px;
}

.login-pf .container {
    padding-top: 40px;
}

#kc-webauthn-settings-form {
    padding-top: 8px;
}

#kc-form-webauthn .select-auth-box-parent {
    pointer-events: none;
}

#kc-form-webauthn .select-auth-box-desc {
    color: var(--rkt-text-muted);
}

#kc-form-webauthn .select-auth-box-headline {
    color: var(--rkt-text);
}

#kc-form-webauthn .select-auth-box-icon {
    flex: 0 0 3em;
}

#kc-form-webauthn .select-auth-box-icon-properties {
    margin-top: 10px;
    font-size: 1.8em;
}

#kc-form-webauthn .select-auth-box-icon-properties.unknown-transport-class {
    margin-top: 3px;
}

#kc-form-webauthn .pf-l-stack__item {
    margin: -1px 0;
}

.subtitle {
    text-align: right;
    margin-top: 30px;
    color: var(--rkt-text-muted);
}

.required {
    color: #ff5050;
}

ol#kc-totp-settings {
    margin: 0;
    padding-left: 20px;
    color: var(--rkt-text-muted);
}

ul#kc-totp-supported-apps {
    margin-bottom: 10px;
    color: var(--rkt-text-muted);
}

#kc-totp-secret-qr-code {
    max-width: 150px;
    max-height: 150px;
}

#kc-totp-secret-key {
    background-color: var(--rkt-input-bg);
    color: var(--rkt-text);
    font-size: 16px;
    padding: 10px 0;
    border-radius: 8px;
}

#kc-oauth h3 {
    margin-top: 0;
    color: var(--rkt-text);
}

#kc-oauth ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#kc-oauth ul li {
    border-top: 1px solid var(--rkt-card-border);
    font-size: 12px;
    padding: 10px 0;
    color: var(--rkt-text-muted);
}

#kc-oauth ul li:first-of-type {
    border-top: 0;
}

#kc-oauth .kc-role {
    display: inline-block;
    width: 50%;
}

#kc-code textarea {
    width: 100%;
    height: 8em;
    background: var(--rkt-input-bg);
    color: var(--rkt-text);
    border: 1px solid var(--rkt-input-border);
    border-radius: 8px;
}

.kc-social-links {
    margin-top: 20px;
}

.kc-social-links li {
    width: 100%;
}

.kc-social-provider-logo {
    font-size: 23px;
    width: 30px;
    height: 25px;
    float: left;
}

.kc-social-gray {
    color: var(--rkt-text-muted);
}

.kc-social-item {
    margin-bottom: 8px;
    font-size: 14px;
    text-align: center;
}

.kc-social-item a {
    background: var(--rkt-input-bg) !important;
    border: 1px solid var(--rkt-input-border) !important;
    border-radius: var(--rkt-radius-sm) !important;
    color: var(--rkt-text) !important;
    transition: border-color 0.2s ease !important;
}

.kc-social-item a:hover {
    border-color: var(--rkt-orange) !important;
}

.kc-social-provider-name {
    position: relative;
}

.kc-social-icon-text {
    left: -15px;
}

.kc-social-grid {
    display: grid;
    grid-column-gap: 10px;
    grid-row-gap: 5px;
    grid-column-end: span 6;
    --pf-l-grid__item--GridColumnEnd: span 6;
}

.kc-social-grid .kc-social-icon-text {
    left: -10px;
}

.kc-social-section {
    text-align: center;
}

.kc-social-section hr {
    margin-bottom: 10px;
    border-color: var(--rkt-card-border);
}

.kc-login-tooltip {
    position: relative;
    display: inline-block;
}

.kc-login-tooltip .kc-tooltip-text {
    top: -3px;
    left: 160%;
    background-color: #222;
    visibility: hidden;
    color: #fff;
    min-width: 130px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    padding: 8px 12px;
    position: absolute;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 13px;
}

.kc-login-tooltip:hover .kc-tooltip-text {
    visibility: visible;
    opacity: 1;
}

.kc-login-tooltip .kc-tooltip-text::after {
    content: " ";
    position: absolute;
    top: 15px;
    right: 100%;
    margin-top: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent #222 transparent transparent;
}

#kc-terms-text {
    margin-bottom: 20px;
    color: var(--rkt-text-muted);
}

#kc-registration-terms-text {
    max-height: 100px;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 5px;
    color: var(--rkt-text-muted);
}

.select-auth-box-arrow {
    display: flex;
    align-items: center;
    margin-right: 2rem;
    color: var(--rkt-text-muted);
}

.select-auth-box-icon {
    display: flex;
    flex: 0 0 2em;
    justify-content: center;
    margin-right: 1rem;
    margin-left: 3rem;
}

.select-auth-box-parent {
    border-top: 1px solid var(--rkt-card-border);
    padding-top: 1rem;
    padding-bottom: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.select-auth-box-parent:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.select-auth-container {
    padding-bottom: 0px !important;
}

.select-auth-box-headline {
    font-size: 15px;
    color: var(--rkt-orange);
    font-weight: 600;
}

.select-auth-box-desc {
    font-size: 13px;
    color: var(--rkt-text-muted);
}

.select-auth-box-paragraph {
    text-align: center;
    font-size: 15px;
    margin-bottom: 5px;
    color: var(--rkt-text-muted);
}

#kc-form-login div.form-group:last-of-type,
#kc-register-form div.form-group:last-of-type,
#kc-update-profile-form div.form-group:last-of-type,
#kc-update-email-form div.form-group:last-of-type {
    margin-bottom: 0px;
}

.no-bottom-margin {
    margin-bottom: 0;
}

#kc-back {
    margin-top: 5px;
}

.login-pf-page .login-pf-brand {
    margin-top: 20px;
    max-width: 360px;
    width: 40%;
}

.login-pf-page .login-pf-signup {
    font-size: 14px;
    color: var(--rkt-text-muted);
}

#kc-content-wrapper .row {
    margin-left: 0;
    margin-right: 0;
}

.login-pf-page.login-pf-page-accounts {
    margin-left: auto;
    margin-right: auto;
}

.login-pf-page .btn-primary {
    margin-top: 0;
}

.login-pf-page .list-view-pf .list-group-item {
    border-bottom: 1px solid var(--rkt-card-border);
}

.login-pf-page .list-view-pf-description {
    width: 100%;
}

.card-pf form.form-actions .btn {
    float: right;
    margin-left: 10px;
}

.kc-recovery-codes-warning {
    margin-bottom: 32px;
}

.kc-recovery-codes-warning .pf-c-alert__description p {
    font-size: 0.875rem;
}

.kc-recovery-codes-list {
    list-style: none;
    columns: 2;
    margin: 16px 0;
    padding: 16px 16px 8px 16px;
    border: 1px solid var(--rkt-input-border);
    border-radius: 8px;
    background: var(--rkt-input-bg);
}

.kc-recovery-codes-list li {
    margin-bottom: 8px;
    font-size: 11px;
    color: var(--rkt-text);
}

.kc-recovery-codes-list li span {
    color: var(--rkt-text-muted);
    width: 16px;
    text-align: right;
    display: inline-block;
    margin-right: 1px;
}

.kc-recovery-codes-actions {
    margin-bottom: 24px;
}

.kc-recovery-codes-actions button {
    padding-left: 0;
    color: var(--rkt-orange);
}

.kc-recovery-codes-actions button i {
    margin-right: 8px;
}

.kc-recovery-codes-confirmation {
    align-items: baseline;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    #kc-container-wrapper {
        position: absolute;
        width: 100%;
    }

    .login-pf .container {
        padding-right: 80px;
    }

    #kc-locale {
        position: relative;
        text-align: right;
        z-index: 9999;
    }
}

@media (max-width: 767px) {
    .login-pf body {
        background: var(--rkt-bg);
    }

    #kc-header {
        padding-left: 15px;
        padding-right: 15px;
        float: none;
        text-align: center;
    }

    #kc-header-wrapper {
        padding: 20px 10px 0;
    }

    div.kc-logo-text-rkt {
        width: 180px;
        height: 50px;
    }

    .card-pf {
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 32px 24px;
        box-shadow: none;
    }

    #kc-info {
        margin: 30px -24px -32px;
        border-radius: 0;
    }

    #kc-form {
        float: none;
    }

    #kc-info-wrapper {
        border-top: 1px solid var(--rkt-card-border);
        background-color: transparent;
    }

    .login-pf .container {
        padding-top: 15px;
        padding-bottom: 15px;
    }

    #kc-locale {
        position: absolute;
        width: 200px;
        top: 20px;
        right: 20px;
        text-align: right;
        z-index: 9999;
    }

    .kc-social-grid {
        grid-column-end: 12;
        --pf-l-grid__item--GridColumnEnd: span 12;
    }

    .kc-social-grid .kc-social-icon-text {
        left: -15px;
    }
}

@media (min-height: 646px) {
    #kc-container-wrapper {
        bottom: 12%;
    }
}

@media (max-height: 645px) {
    #kc-container-wrapper {
        padding-top: 50px;
        top: 20%;
    }
}

/* Keycloak 26 renders the locale switcher trigger as <button> (was <a> in 22),
   which arrives with the browser's native button chrome and no longer matched
   the `#kc-locale-dropdown a` / `a#kc-current-locale-link` rules above.
   Reset it back to looking like the old inline link. */
#kc-current-locale-link {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: 13px;
    line-height: inherit;
    color: var(--rkt-text-muted);
    cursor: pointer;
    text-align: right;
}

/* --- Language switcher: dark-theme the open menu -------------------------- */
/* PatternFly 4 paints the open panel white
   (--pf-c-dropdown__menu--BackgroundColor -> --pf-global--BackgroundColor--light-100)
   and the hovered entry light grey with near-black text
   (--pf-c-dropdown__menu-item--hover--BackgroundColor / --hover--Color).
   liftoff only restyled the panel background and the link colour, so the
   entries themselves stayed light. Retint PatternFly's own custom properties on
   #kc-locale -- that element *is* the .pf-c-dropdown root, so an ID selector
   beats PatternFly's own class declaration and every descendant inherits the
   new values, regardless of how specific the consuming rules are. */
#kc-locale {
    --pf-c-dropdown__menu--BackgroundColor: var(--rkt-card-bg);
    --pf-c-dropdown__menu-item--BackgroundColor: transparent;
    --pf-c-dropdown__menu-item--Color: var(--rkt-text-muted);
    --pf-c-dropdown__menu-item--hover--BackgroundColor: rgba(255, 255, 255, 0.06);
    --pf-c-dropdown__menu-item--hover--Color: var(--rkt-text);
    --pf-c-dropdown__menu-item--focus--BackgroundColor: rgba(255, 255, 255, 0.06);
    --pf-c-dropdown__menu-item--focus--Color: var(--rkt-text);
}

/* Belt and braces: set the states directly too, so this keeps working if the
   markup stops carrying the PatternFly dropdown classes in a future release. */
#kc-locale ul {
    background-color: var(--rkt-card-bg);
}

#kc-locale ul li a {
    background-color: transparent;
    color: var(--rkt-text-muted);
}

#kc-locale ul li a:hover,
#kc-locale ul li a:focus {
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--rkt-text);
}

/* --- Registration call-to-action on its own line -------------------------- */
/* .button-register is intentionally `display: inline-block !important;
   width: auto !important` to keep its pill shape, but it lives in the same
   <span> as the intro text, so it flows inline and hangs off the end of the
   last wrapped line -- at every viewport width, not just on mobile.
   Promote it to its own line while preserving the pill: block for the line
   break, fit-content so it still hugs its label, auto side margins to stay
   centred under #kc-registration-container's text-align: center.
   This selector is (1,1,1) vs the .button-register rule's (0,1,0), so it wins
   despite the !important declarations there. */
#kc-registration span {
    display: block;
}

#kc-registration a.button-register {
    display: block !important;
    width: -webkit-fit-content !important;
    width: fit-content !important;
    margin-top: 16px;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* --- Password page (login-update-password.ftl) ---------------------------- */
/* Neutral intro line that replaces Keycloak's yellow "you must change your
   password" warning on the set-password step. */
.rkt-intro {
    margin: -4px 0 24px;
    color: var(--rkt-text-muted);
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
}

/* Show/hide toggle sits inside the input on the right, like an input adornment. */
.rkt-password-field {
    position: relative;
}

.login-pf .rkt-password-field input.pf-c-form-control {
    padding-right: 52px;
}

/* Edge ships its own reveal button; ours replaces it. */
.rkt-password-field input::-ms-reveal {
    display: none;
}

.rkt-password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 36px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--rkt-text-muted);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.rkt-password-toggle:hover {
    color: var(--rkt-text);
    background-color: rgba(255, 255, 255, 0.06);
}

.rkt-password-toggle:focus-visible {
    outline: 2px solid var(--rkt-orange);
    outline-offset: 0;
}

.rkt-password-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rkt-password-toggle .rkt-icon-hide,
.rkt-password-toggle[aria-pressed="true"] .rkt-icon-show {
    display: none;
}

.rkt-password-toggle[aria-pressed="true"] .rkt-icon-hide {
    display: block;
}

/* "Abbrechen" when the user changes their password from the account console. */
.login-pf .rkt-button-secondary {
    margin-top: 12px;
    background: transparent;
    border: 1px solid var(--rkt-card-border);
    border-radius: 50px;
    color: var(--rkt-text-muted);
    font-size: 15px;
    font-weight: 600;
    padding: 14px 32px;
    width: 100%;
}

.login-pf .rkt-button-secondary:hover {
    border-color: var(--rkt-text-muted);
    color: var(--rkt-text);
}
