@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');

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

body, h1 {
    font-family: "Open Sans", Helvetica, Arial, sans-serif !important;
    font-size: 12px;
    line-height: 1.66666667;
    color: rgb(54, 54, 54) !important;
    background-color: #fff;
}

a {
    color: rgb(0, 153, 211) !important;
}

.text-center {
    text-align: center;
}

.pf-v5-c-login {
    display: flex;
    align-items: center;
    flex-direction: column;
    height: 100vh;
    padding: 0 1rem;
    max-width: 1024px;
    margin: 0 auto;
    justify-content: space-between;

    .pf-v5-c-title {
        font-weight: 300;
    }
}

.pf-v5-c-login__main {
    box-shadow: none;
}

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

.pf-v5-c-login__main-header {
    border-top: none;
    grid-template-columns: none !important;
    text-align: center;
}

.pf-v5-c-login__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 20px 10px !important;
    margin: 0 auto 20px !important;
    border-bottom: 1px solid #f6f6f6;
}

.pf-v5-c-brand {
    margin: 0 !important;
}

.pf-v5-c-form__label-text {
    font-weight: normal !important;
}

.pf-v5-c-check__label {
    font-size: var(--pf-v5-global--FontSize--sm) !important;
}

.pf-v5-c-check {
    align-items: center;

    .pf-v5-c-check__input {
        align-self: center;
        transform: none;
    }
}

.login-footer {
    display: flex;
    padding: 2rem 0;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--pf-v5-global--BorderColor--100);
    width: 100%;
    flex-wrap: wrap;

    .kc-login-footer-links {
        display: contents;
    }
}

/* Info section - top margin + bottom padding */
.pf-v5-c-login__main-footer-band:first-child {
    margin-block-start: var(--pf-v5-global--spacer--lg);
}

.pf-v5-c-login__main-footer-band:last-child {
    padding-bottom: 0;
}

/* Info section */

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

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;
}

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

.kc-login-tooltip .kc-tooltip-text {
    top: -3px;
    left: 160%;
    background-color: black;
    visibility: hidden;
    color: #fff;

    min-width: 130px;
    text-align: center;
    border-radius: 2px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
    padding: 5px;

    position: absolute;
    opacity: 0;
    transition: opacity 0.5s;
}

/* Show tooltip */
.kc-login-tooltip:hover .kc-tooltip-text {
    visibility: visible;
    opacity: 0.7;
}

/* Arrow for tooltip */
.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 black transparent transparent;
}

#kc-recovery-codes-list {
    columns: 2;
}

#certificate_subjectDN {
    overflow-wrap: break-word
}

#kc-verify-email-form {
    margin-top: 24px;
    margin-bottom: 24px;
}

#kc-header-wrapper {
    font-size: 29px;
    text-transform: uppercase;
    letter-spacing: 3px;
    line-height: 1.2em;
    white-space: normal;
    color: var(--pf-v5-global--Color--light-100) !important;
    text-align: center;
}

#kc-locale ul {
    background-color: var(--pf-v5-global--BackgroundColor--light-100);
    display: none;
    top: 24px;
    right: 0;
    min-width: 240px;
    padding: 0;
    box-shadow: var(--pf-v5-global--BoxShadow--md);
}

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

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

#kc-locale-dropdown a {
    color: rgb(54, 54, 54) !important;
    text-decoration: none;
    font-size: var(--pf-v5-global--FontSize--md);
}

#kc-locale-dropdown button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: rgb(54, 54, 54) !important;
    text-align: right;
    font-size: var(--pf-v5-global--FontSize--md);
}

.pf-c-dropdown__menu {
    position: absolute;
    top: var(--pf-c-dropdown__menu--Top);
    z-index: var(--pf-c-dropdown__menu--ZIndex);
    padding-top: var(--pf-c-dropdown__menu--PaddingTop);
    padding-bottom: var(--pf-c-dropdown__menu--PaddingBottom);
    background: var(--pf-c-dropdown__menu--BackgroundColor);
    background-clip: padding-box;
    box-shadow: var(--pf-c-dropdown__menu--BoxShadow);
}

.pf-c-dropdown__menu-item {
    display: block;
    padding: .5rem 1rem;
    white-space: nowrap;
}

.pf-c-dropdown__menu-item:hover {
    background-color: var(--pf-v5-global--BackgroundColor--light-300);
}

#kc-code pre code {
    word-break: break-all;
}

hr {
    margin-top: var(--pf-v5-global--spacer--sm);
    margin-bottom: var(--pf-v5-global--spacer--md);
}

#kc-social-providers svg:not(.google) {
    filter: invert(47%) sepia(88%) saturate(7486%) hue-rotate(199deg) brightness(91%) contrast(101%);
}

#kc-social-providers svg {
    height: var(--pf-v5-global--FontSize--xl);
}

#kc-terms-text {
    margin-bottom: 20px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;

    ul {
        list-style: initial;
    }

    ul li {
        margin-left: 20px;
    }

    :where(h1,h2,h3,h4,h5,h6) {
        font-family: inherit;
        font-weight: 500;
        margin: 20px 0 10px 0;
    }

    h3 {
        font-size: 1rem;
    }

    h4 {
        font-size: 0.875rem;
    }

    p {
        margin-bottom: 10px;
    }

}

@media (prefers-color-scheme: dark) {
    #kc-social-providers svg:not(.google) {
        filter: invert(54%) sepia(96%) saturate(2028%) hue-rotate(174deg) brightness(99%) contrast(97%);
    }
}

@media (min-width: 768px) {
    div.pf-v5-c-login__main-header {
        grid-template-columns: 70% 30%;
    }
}