:root {
    --h2-blue: #0868d7;
    --h2-blue-dark: #0756b3;
    --h2-turquoise: #36b5a4;
    --h2-violet: #9d3db7;
    --h2-ink: #182236;
    --h2-muted: #667085;
    --h2-line: #d9e0e8;
    --h2-canvas: #f5f8fb;
    --h2-danger: #b42318;
    --h2-radius: 18px;
    --h2-control-radius: 4px;
    --h2-shadow: 0 20px 60px rgba(18, 41, 76, 0.10), 0 2px 10px rgba(18, 41, 76, 0.05);
}

html,
body {
    min-height: 100%;
}

body.login-pf {
    min-height: 100vh;
    margin: 0;
    background:
            radial-gradient(circle at 12% 10%, rgba(54, 181, 164, 0.09), transparent 28rem),
            radial-gradient(circle at 90% 5%, rgba(157, 61, 183, 0.06), transparent 24rem),
            var(--h2-canvas);
    color: var(--h2-ink);
    font-family: "Roboto", "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body.login-pf::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(8, 104, 215, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.32), transparent 46%);
}

.h2-auth-shell {
    position: relative;
    z-index: 1;
    width: min(1440px, calc(100% - 48px));
    min-height: calc(100vh - 78px);
    margin: 0 auto;
    padding: 58px 0 28px;
}

.h2-brand-header {
    display: flex;
    justify-content: center;
    margin-bottom: 38px;
}

#kc-client-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 68px;
}

#kc-client-logo img {
    display: block;
    width: auto;
    max-width: min(330px, 75vw);
    max-height: 72px;
    object-fit: contain;
}

.h2-auth-card.card-pf {
    position: relative;
    width: min(1220px, 100%);
    max-width: 1220px;
    margin: 0 auto;
    padding: 44px 48px 46px;
    overflow: visible;
    border: 1px solid rgba(199, 209, 221, 0.9);
    border-radius: var(--h2-radius);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--h2-shadow);
}

.h2-auth-card.card-pf:not(.h2-auth-card-wide) {
    width: min(760px, 100%);
    max-width: 760px;
}

.h2-auth-card-header {
    position: relative;
    min-height: 54px;
    margin: 0;
}

#kc-page-title {
    margin: 0;
    padding: 0;
    color: var(--h2-ink);
    font-size: clamp(30px, 3vw, 40px);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.h2-locale {
    position: absolute;
    z-index: 20;
    top: -4px;
    right: 0;
}

#kc-current-locale-link {
    display: inline-flex;
    gap: 9px;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--h2-muted);
    font: inherit;
    cursor: pointer;
}

#kc-current-locale-link:hover,
#kc-current-locale-link:focus-visible {
    background: #f1f5f9;
    color: var(--h2-ink);
}

#kc-locale-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: max-content;
    min-width: 160px;
    max-height: 260px;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    list-style: none;
    border: 1px solid var(--h2-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.14);
}

#kc-locale-menu[hidden] {
    display: none;
}

#kc-locale-menu a {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--h2-ink);
    text-decoration: none;
}

#kc-locale-menu a:hover,
#kc-locale-menu a:focus-visible {
    background: #eef5ff;
    color: var(--h2-blue);
}

.h2-login-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1.05fr) minmax(280px, 0.95fr) minmax(230px, 0.82fr);
    gap: 44px;
    align-items: stretch;
    margin-top: 20px;
}

.h2-login-column,
.h2-alternative-column,
.h2-illustration-column {
    min-width: 0;
}

.h2-alternative-column {
    display: flex;
    flex-direction: column;
    padding-left: 44px;
    border-left: 1px solid var(--h2-line);
}

.h2-illustration-column {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    padding: 0;
}

.h2-illustration-column img {
    display: block;
    width: 135%;
    max-width: 420px;
    height: auto;
    object-fit: contain;
}

.h2-field {
    margin-bottom: 21px;
}

.h2-field label,
.h2-sso > label {
    display: block;
    margin: 0 0 8px;
    color: var(--h2-ink);
    font-size: 15px;
    font-weight: 500;
}

.h2-field .pf-c-form-control,
.h2-sso .pf-c-form-control,
.h2-auth-card input[type="text"],
.h2-auth-card input[type="password"],
.h2-auth-card input[type="email"] {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 1px solid #b9c5d3;
    border-radius: var(--h2-control-radius);
    background: #fff;
    color: var(--h2-ink);
    font-size: 16px;
    line-height: 50px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.h2-field .pf-c-form-control:focus,
.h2-sso .pf-c-form-control:focus,
.h2-auth-card input:focus {
    outline: 0;
    border-color: var(--h2-blue);
    box-shadow: 0 0 0 3px rgba(8, 104, 215, 0.14);
}

.h2-auth-card [aria-invalid="true"] {
    border-color: var(--h2-danger) !important;
}

.h2-password-field {
    position: relative;
}

.h2-password-field input {
    padding-right: 48px !important;
}

.h2-password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    transform: translateY(-50%);
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #475467;
    cursor: pointer;
}

.h2-password-toggle:hover,
.h2-password-toggle:focus-visible {
    background: #eef3f8;
    color: var(--h2-blue);
}

.h2-form-options {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    min-height: 30px;
    margin: -3px 0 20px;
    font-size: 14px;
}

.h2-form-options a {
    color: var(--h2-blue);
}

.h2-checkbox {
    display: inline-flex;
    gap: 9px;
    align-items: center;
    color: var(--h2-muted);
    font-weight: 400;
    cursor: pointer;
}

.h2-checkbox input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--h2-blue);
}

.h2-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: var(--h2-control-radius);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.h2-button:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.h2-button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(8, 104, 215, 0.18);
}

.h2-button-primary {
    border-color: var(--h2-blue);
    background: var(--h2-blue);
    color: #fff !important;
    box-shadow: 0 6px 14px rgba(8, 104, 215, 0.18);
}

.h2-button-primary:hover {
    border-color: var(--h2-blue-dark);
    background: var(--h2-blue-dark);
}

.h2-button-secondary {
    border-color: var(--h2-blue);
    background: #fff;
    color: var(--h2-blue) !important;
}

.h2-button-secondary:hover {
    background: #f3f8ff;
}

.h2-registration {
    display: grid;
    gap: 9px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--h2-line);
    color: var(--h2-muted);
    font-size: 14px;
}

.h2-section-divider {
    display: flex;
    gap: 14px;
    align-items: center;
    margin: 0 0 18px;
    color: var(--h2-muted);
    font-size: 14px;
    white-space: nowrap;
}

.h2-section-divider::before,
.h2-section-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--h2-line);
}

.h2-provider-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.h2-provider-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 10px 44px;
    border: 1px solid #c5cfdb;
    border-radius: var(--h2-control-radius);
    background: #fff;
    color: var(--h2-ink) !important;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.h2-provider-button:hover,
.h2-provider-button:focus-visible {
    border-color: #93a4b7;
    background: #f8fafc;
    text-decoration: none;
    box-shadow: 0 0 0 3px rgba(8, 104, 215, 0.08);
}

.h2-provider-button i {
    position: absolute;
    left: 17px;
    width: 22px;
    margin: 0;
    color: #263244;
    font-size: 20px;
    text-align: center;
}

.h2-sso {
    margin-top: 24px;
    padding-top: 23px;
    border-top: 1px solid var(--h2-line);
}

.h2-alternative-column .h2-sso {
    margin-top: auto;
}

.h2-sso .h2-section-divider {
    display: none;
}

.h2-sso-only {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.h2-sso-only .h2-section-divider {
    display: flex;
}

.h2-sso .h2-button {
    margin-top: 12px;
}

.h2-field-error {
    display: block;
    margin-top: 7px;
    color: var(--h2-danger);
    font-size: 13px;
    line-height: 1.35;
}

.h2-field-error[hidden] {
    display: none;
}

.h2-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0 0 22px;
    padding: 12px 14px;
    border: 1px solid #b9c5d3;
    border-radius: 9px;
    background: #f8fafc;
    font-size: 14px;
}

.h2-alert-error {
    border-color: #f4b8b3;
    background: #fff4f3;
    color: #912018;
}

.h2-alert-success {
    border-color: #a6dccb;
    background: #effaf6;
    color: #176b53;
}

.h2-alert-warning {
    border-color: #f2ce8d;
    background: #fff8e8;
    color: #7a4d0b;
}

.h2-alert-info {
    border-color: #a9c8ef;
    background: #f0f6ff;
    color: #174c87;
}

.h2-attempted-username {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 12px 0 4px;
    font-size: 17px;
}

.h2-another-way {
    width: min(420px, 100%);
    margin: 22px auto 0;
}

#kc-info {
    margin-top: 24px;
}

/* Registration and dynamic user-profile forms inherited from Keycloak 26. */
#kc-register-form {
    width: min(640px, 100%);
    margin: 22px auto 0;
}

#kc-register-form.form-horizontal .form-group,
#kc-register-form .form-group {
    display: block;
    margin: 0 0 20px;
}

#kc-register-form [class*="col-"] {
    float: none;
    width: 100%;
    min-height: 0;
    padding-right: 0;
    padding-left: 0;
}

#kc-register-form label,
#kc-register-form .pf-c-form__label,
#kc-register-form .pf-c-form__label-text {
    display: block;
    margin: 0 0 8px;
    color: var(--h2-ink);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
}

#kc-register-form input[type="text"],
#kc-register-form input[type="email"],
#kc-register-form input[type="password"],
#kc-register-form input[type="tel"],
#kc-register-form input[type="url"],
#kc-register-form input[type="number"],
#kc-register-form select,
#kc-register-form textarea {
    width: 100%;
    min-height: 50px;
    padding: 11px 14px;
    border: 1px solid #b9c5d3;
    border-radius: var(--h2-control-radius) !important;
    background: #fff;
    color: var(--h2-ink);
    font-size: 16px;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

#kc-register-form textarea {
    min-height: 110px;
    resize: vertical;
}

#kc-register-form input:focus,
#kc-register-form select:focus,
#kc-register-form textarea:focus {
    outline: 0;
    border-color: var(--h2-blue);
    box-shadow: 0 0 0 3px rgba(8, 104, 215, 0.14);
}

#kc-register-form input[aria-invalid="true"],
#kc-register-form select[aria-invalid="true"],
#kc-register-form textarea[aria-invalid="true"] {
    border-color: var(--h2-danger) !important;
}

#kc-register-form .pf-c-input-group,
#kc-register-form .pf-v5-c-input-group {
    position: relative;
    display: flex;
}

#kc-register-form .pf-c-input-group > input,
#kc-register-form .pf-v5-c-input-group > input {
    flex: 1;
    padding-right: 48px;
}

#kc-register-form .pf-c-form__helper-text,
#kc-register-form .pf-v5-c-form__helper-text,
#kc-register-form .kc-feedback-text {
    display: block;
    margin-top: 7px;
    color: var(--h2-danger);
    font-size: 13px;
    line-height: 1.4;
}

#kc-register-form .checkbox,
#kc-register-form .pf-c-check,
#kc-register-form .pf-v5-c-check {
    margin: 18px 0;
    color: var(--h2-muted);
}

#kc-register-form .checkbox label,
#kc-register-form .pf-c-check__label,
#kc-register-form .pf-v5-c-check__label {
    display: inline-flex;
    gap: 9px;
    align-items: flex-start;
    margin: 0;
    color: var(--h2-muted);
    font-weight: 400;
}

#kc-register-form input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--h2-blue);
}

#kc-register-form #kc-form-buttons {
    width: 100%;
    margin: 28px 0 0;
}

#kc-register-form #kc-form-buttons .pf-c-button,
#kc-register-form #kc-form-buttons .pf-v5-c-button,
#kc-register-form #kc-form-buttons input[type="submit"],
#kc-register-form #kc-form-buttons button[type="submit"] {
    display: block;
    width: 100%;
    min-height: 50px;
    padding: 11px 18px;
    border: 1px solid var(--h2-blue) !important;
    border-radius: var(--h2-control-radius) !important;
    background: var(--h2-blue) !important;
    color: #fff !important;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    box-shadow: 0 6px 14px rgba(8, 104, 215, 0.18);
    cursor: pointer;
}

#kc-register-form #kc-form-buttons .pf-c-button:hover,
#kc-register-form #kc-form-buttons .pf-v5-c-button:hover,
#kc-register-form #kc-form-buttons input[type="submit"]:hover,
#kc-register-form #kc-form-buttons button[type="submit"]:hover {
    border-color: var(--h2-blue-dark) !important;
    background: var(--h2-blue-dark) !important;
}

#kc-register-form #kc-form-options {
    width: 100%;
    margin-top: 18px;
    text-align: center;
}

#kc-register-form #kc-form-options a {
    color: var(--h2-blue);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

#kc-register-form #kc-form-options a:hover,
#kc-register-form #kc-form-options a:focus-visible {
    color: var(--h2-blue-dark);
    text-decoration: underline;
}

#kc-register-form .g-recaptcha {
    max-width: 100%;
    overflow: hidden;
}

.welcome-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 58px;
    padding: 0 24px 22px;
    color: var(--h2-muted);
    font-size: 13px;
}

.welcome-content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    color: inherit;
    font: inherit;
    text-align: center;
}

.welcome-content a {
    color: #475467;
    text-decoration: none;
}

.welcome-content a:hover,
.welcome-content a:focus-visible {
    color: var(--h2-blue);
    text-decoration: underline;
}

@media (max-width: 1050px) {
    .h2-auth-card.card-pf {
        padding-inline: 38px;
    }

    .h2-login-grid {
        grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
        gap: 36px;
    }

    .h2-illustration-column {
        display: none;
    }
}

@media (max-width: 720px) {
    .h2-auth-shell {
        width: min(100% - 24px, 560px);
        min-height: auto;
        padding: 28px 0 18px;
    }

    .h2-brand-header {
        margin-bottom: 22px;
    }

    #kc-client-logo img {
        max-height: 58px;
    }

    .h2-auth-card.card-pf {
        padding: 28px 22px 30px;
        border-radius: 14px;
    }

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

    .h2-auth-card-header {
        min-height: 74px;
    }

    #kc-page-title {
        padding-top: 42px;
        font-size: 30px;
    }

    .h2-locale {
        top: -7px;
        right: -7px;
    }

    .h2-login-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        margin-top: 10px;
    }

    .h2-alternative-column {
        padding: 28px 0 0;
        border-top: 1px solid var(--h2-line);
        border-left: 0;
    }

    .h2-alternative-column .h2-sso {
        margin-top: 24px;
    }

    .h2-alternative-column .h2-sso-only {
        margin-top: 0;
    }

    .h2-form-options {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
