/* IIHF split-screen branding for Keycloak login/register/reset-password/OTP pages.
   Layered on top of keycloak.v2's own css/styles.css (loaded first via theme.properties'
   parent-fallback resource resolution). Values ported from the Blazor reference:
   Client/Shared/AuthSplitLayout.razor.css, AuthTabSwitcher.razor.css, LoginComponent.razor.css. */

/* The reference renders everything in Roboto (MudBlazor's typography, from Google Fonts). Served
   from the theme instead: the variable font, latin and latin-ext subsets, covers 400/500/700. */
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/roboto-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/roboto-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --pf-v5-global--FontFamily--text: Roboto, Helvetica, Arial, sans-serif;
    --pf-v5-global--FontFamily--heading: Roboto, Helvetica, Arial, sans-serif;
}

html, body {
    font-family: Roboto, Helvetica, Arial, sans-serif;
    color: #424242;
    letter-spacing: 0.15px;
}

body#keycloak-bg {
    background: #fdfdfd;
}

/* MudBlazor's scrollbars, page and dropdown lists alike. The 8px gutter is also what the
   reference's column widths are measured against. */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c4c4c4;
    border-radius: 1px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a6a6a6;
}

/* ---- Split-screen shell ---- */

.iihf-auth-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    background-color: #fdfdfd;
}

.iihf-auth-visual {
    display: flex;
    flex-direction: column;
    color: #fff;
    background: linear-gradient(180deg, #2b6994 0%, #0a2f62 34%, #021d4d 58%, #001a49 100%);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.iihf-auth-visual-top {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
}

.iihf-auth-visual-top::before,
.iihf-auth-visual-top::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.6;
}

.iihf-auth-visual-top::before {
    left: 0;
    background: linear-gradient(to right, #0a2f62 0%, transparent 100%);
}

.iihf-auth-visual-top::after {
    right: 0;
    background: linear-gradient(to left, #0a2f62 0%, transparent 100%);
}

.iihf-auth-players-frame {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.iihf-auth-players-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    filter: drop-shadow(0 20px 36px rgba(0, 0, 0, 0.35));
}

.iihf-auth-visual-bottom {
    flex: 0 0 auto;
    padding: clamp(1.5rem, 3vw, 4rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
}

.iihf-auth-visual-title {
    margin: 0;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.15;
    max-width: 18ch;
    letter-spacing: -0.02em;
}

.iihf-auth-visual-subtitle {
    margin: 0;
    opacity: 0.95;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.125rem);
    line-height: 1.6;
    max-width: 50ch;
}

.iihf-auth-visual-branding {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.iihf-auth-partner-logos {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.iihf-auth-partner-logo {
    height: clamp(16px, 2.5vw, 20px);
    width: auto;
    object-fit: contain;
    opacity: 0.9;
}

.iihf-auth-partner-logo--large {
    height: clamp(28px, 4vw, 40px);
}

.iihf-auth-partner-separator {
    width: 2px;
    height: clamp(28px, 4vw, 40px);
    background-color: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

/* ---- Form panel ----
   The reference drops the form in at the top of the panel behind a fixed spacer, rather than
   centring it vertically: pages of different heights (login, register, OTP) then all start on the
   same line instead of sliding up and down. */

.iihf-auth-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: calc(1.5rem + clamp(3rem, 8vh, 6rem)) 1.5rem 3rem;
    background-color: #fdfdfd;
}

/* .pf-v5-c-login is a 100vh flex box that centres its container; the reference starts the form at a
   fixed offset from the top of the panel instead, so collapse it to a plain block. */
.iihf-auth-form-panel .pf-v5-c-login {
    display: block;
    min-height: 0;
    height: auto;
    padding: 0;
}

/* Its container is a two-column grid with its own padding and gutters, which left the form column
   and the tab switcher on different edges. Collapse it to a plain, centred block and let the panel
   supply the padding.
   The width reproduces the reference's column: a MudContainer (24px side padding, 16px under
   600px) holding a MudGrid (spacing 3: -12px margins, 12px item padding) whose item is
   xs=12 / sm=10 / md=7 / lg=6 / xl=5 of 12, then MudCardContent's 16px padding. Fields and the tab
   track end up (panel content - 24px) x item% - 56px wide: 268px at 1440, 201px at 1024. */
.iihf-auth-form-panel .pf-v5-c-login__container {
    display: block;
    max-width: none;
    width: calc(100% - 64px);
    padding: 0;
    margin: 0 auto;
}

@media (min-width: 600px) {
    .iihf-auth-form-panel .pf-v5-c-login__container {
        width: calc((100% - 24px) * 10 / 12 - 56px);
    }
}

@media (min-width: 960px) {
    .iihf-auth-form-panel .pf-v5-c-login__container {
        width: calc((100% - 24px) * 7 / 12 - 56px);
    }
}

@media (min-width: 1280px) {
    .iihf-auth-form-panel .pf-v5-c-login__container {
        width: calc((100% - 24px) * 6 / 12 - 56px);
    }
}

@media (min-width: 1920px) {
    .iihf-auth-form-panel .pf-v5-c-login__container {
        width: calc((100% - 24px) * 5 / 12 - 56px);
    }
}

/* The reference has no card: the form sits directly on the panel background, so the white fill,
   drop shadow and 4px blue header rule PatternFly draws all come off. */
.iihf-auth-form-panel .pf-v5-c-login__main {
    width: 100%;
    background: transparent;
    box-shadow: none;
    border: none;
}

.iihf-auth-form-panel .pf-v5-c-login__main-header {
    /* PatternFly's header is a two-column grid with a 16px gap for header utilities we never
       render, which shifted the centred title 8px left of the column's centre. */
    display: block;
    border-top: none;
    padding: 0;
    text-align: center;
}

.iihf-auth-form-panel .pf-v5-c-login__main-body,
.iihf-auth-form-panel .pf-v5-c-login__main-footer {
    padding: 0;
}

@media (max-width: 899.98px) {
    .iihf-auth-shell {
        grid-template-columns: 1fr;
    }

    .iihf-auth-visual {
        display: none;
    }

    .iihf-auth-form-panel {
        padding: calc(1rem + clamp(3rem, 8vh, 6rem)) 1rem 2rem;
    }
}

/* ---- Tab switcher ---- */

/* Matched through .pf-v5-c-login__main to outrank PatternFly's
   `.pf-v5-c-login__main > :first-child:not(.pf-v5-c-login__main-header)`, which otherwise pads the
   tab track with the 48px meant for a card header. */
.iihf-auth-form-panel .pf-v5-c-login__main > .iihf-auth-tabs {
    display: flex;
    gap: 0;
    margin: 0 0 48px;
    background-color: #f0f2f5;
    border-radius: 8px;
    padding: 4px;
    width: 100%;
    /* The reference's tabs-header is sticky, on a canvas band 16px wider each side, so the
       switcher stays put while a long form (register) scrolls under it. */
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: -16px 0 0 #fdfdfd, 16px 0 0 #fdfdfd;
}

.iihf-auth-tab {
    flex: 1;
    text-align: center;
    padding: 8px 1.5rem;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.43;
    letter-spacing: normal;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.iihf-auth-tab:hover {
    color: #374151;
    text-decoration: none;
}

.iihf-auth-tab--active,
.iihf-auth-tab--active:hover {
    background-color: #002d62;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 45, 98, 0.15);
}

.iihf-auth-tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 45, 98, 0.1);
}

/* ---- Header title ("Sign In" / "Register") ---- */

.pf-v5-c-title.pf-m-3xl,
#kc-page-title {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 32px;
    color: #002d62;
}

/* ---- Links ---- */

/* MudLink: navy, underlined on hover only. */
.iihf-auth-form-panel a:not(.pf-v5-c-button):not(.iihf-auth-tab) {
    color: #002d62;
    text-decoration: none;
}

.iihf-auth-form-panel a:not(.pf-v5-c-button):not(.iihf-auth-tab):hover {
    text-decoration: underline;
}

/* "Forgot your password?" rides in the password field's helper text; the reference sets it in
   16px body1 text 18px under the field, with the Sign In button 64px under the field. */
#kc-form-login .pf-v5-c-input-group ~ .pf-v5-c-form__helper-text {
    margin-top: 16px;
}

/* buttons.ftl gives the row pf-v5-u-pt-xs, an !important utility. */
#kc-form-login .pf-v5-c-form__actions {
    padding-top: 12px !important;
}

#kc-form-login .pf-v5-c-input-group ~ .pf-v5-c-form__helper-text .pf-v5-c-helper-text__item-text {
    font-size: 1rem;
    line-height: 24px;
}

/* ---- Inputs & labels ----
   Read off the reference's MudBlazor fields: label body2 (14px/20px, #424242) sitting directly on
   the field, 12px between one field and the next label; field 52px, #f3f4f6 fill, 1px #d1d5db,
   6px radius, 12px side padding, 16px #424242 text, placeholder at .42 opacity. */

.iihf-auth-form-panel .pf-v5-c-form {
    gap: 12px;
}

.iihf-auth-form-panel .pf-v5-c-form__label-text,
.iihf-auth-form-panel .pf-v5-c-form__label,
.iihf-auth-form-panel .pf-v5-c-check__label {
    color: #424242;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 20px;
}

.iihf-auth-form-panel .pf-v5-c-form__group {
    margin: 0;
}

/* kcFormGroupLabelClass carries pf-v5-u-pb-xs, an !important utility. */
.iihf-auth-form-panel .pf-v5-c-form__group-label {
    padding-bottom: 0 !important;
    font-size: 0.875rem;
    line-height: 20px;
}

.iihf-auth-form-panel .pf-v5-c-form-control,
.iihf-auth-form-panel .pf-v5-c-form-control > input,
.iihf-auth-form-panel .pf-v5-c-form-control > select,
.iihf-auth-form-panel .pf-v5-c-form-control > textarea,
.iihf-auth-form-panel #kc-attempted-username {
    color: #424242;
    -webkit-text-fill-color: #424242;
    font-size: 1rem;
    letter-spacing: 0.15px;
}

.iihf-auth-form-panel .pf-v5-c-form-control > input::placeholder,
.iihf-auth-form-panel .pf-v5-c-form-control > input::-webkit-datetime-edit {
    color: rgba(66, 66, 66, 0.42);
    -webkit-text-fill-color: rgba(66, 66, 66, 0.42);
    opacity: 1;
}

.pf-v5-c-form-control {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    min-height: 52px;
}

/* The control fills the field's full inner height so its text sits on the vertical centre, as
   the reference's does; PatternFly's own 36px control otherwise hugs the top edge. */
.pf-v5-c-form-control > input,
.pf-v5-c-form-control > select {
    height: 50px;
    padding-top: 0;
    padding-bottom: 0;
}

.pf-v5-c-form-control > input,
.pf-v5-c-form-control > select,
.pf-v5-c-form-control > textarea {
    background-color: transparent;
    border: none;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* ---- Dropdowns ----
   Gender, country and favourite team are MudAutocompletes in the reference. iihf-combobox.js
   turns each .iihf-select into the same: a text field that filters a popover list. Without the
   script the native select still works, with the same chevron. */

.iihf-select {
    position: relative;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-opacity='.54' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 24px;
}

.iihf-select > select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.75rem;
}

.iihf-select:has(> select > option[value=""]:checked) > select {
    color: rgba(66, 66, 66, 0.42);
    -webkit-text-fill-color: rgba(66, 66, 66, 0.42);
}

.iihf-combo {
    background-image: none;
}

/* The select stays where it was, so the browser can still autofill it and anchor its validation
   bubble there, but it is invisible and out of the tab order. */
.iihf-combo > .iihf-combo__native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.iihf-auth-form-panel .iihf-combo > .iihf-combo__input {
    width: 100%;
    padding-right: 2.75rem;
    text-overflow: ellipsis;
    outline: none;
}

.iihf-combo__chevron {
    position: absolute;
    top: 50%;
    right: 12px;
    width: 24px;
    height: 24px;
    margin-top: -12px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-opacity='.54' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") center / 24px no-repeat;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.iihf-combo--open .iihf-combo__chevron {
    transform: rotate(180deg);
}

/* MudPopover: white paper, 4px radius, elevation 8, 300px tall at most, fading in over 251ms. */
.iihf-combo__list {
    position: absolute;
    z-index: 30;
    top: calc(100% + 1px);
    left: -1px;
    right: -1px;
    max-height: 300px;
    margin: 0;
    padding: 8px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    list-style: none;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);
    animation: iihf-fade-in 251ms ease;
}

.iihf-combo--up .iihf-combo__list {
    top: auto;
    bottom: calc(100% + 1px);
}

@keyframes iihf-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* MudListItem: 48px rows, body1 text. Hover is the neutral 6% wash; the highlighted row (the
   current pick on open, then the keyboard cursor) is navy text on a 6% navy wash. */
.iihf-combo__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    line-height: 24px;
    letter-spacing: 0.15px;
    color: #424242;
    /* The field sets -webkit-text-fill-color, which the list would otherwise inherit. */
    -webkit-text-fill-color: currentcolor;
    cursor: pointer;
    user-select: none;
    transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.iihf-combo__option[hidden] {
    display: none;
}

.iihf-combo__option:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

.iihf-combo__option.is-active {
    color: #002d62;
    background-color: rgba(0, 45, 98, 0.06);
}

.iihf-combo__option img {
    flex: 0 0 auto;
    height: 14px;
    width: auto;
}

/* PatternFly draws the focus state as an inset ::after border, which reads as a hard black box
   around the field. The reference's fields do not change on focus at all (only the caret shows),
   so neither do these. */
.pf-v5-c-form-control::after {
    display: none;
}

/* ...and its resting border is a ::before inset inside ours: a faint second edge in every field,
   and a stray divider in front of the password toggle. */
.pf-v5-c-form-control::before {
    display: none;
}

.pf-v5-c-form-control > input:focus {
    outline: none;
}

/* Chrome paints autofilled fields pale blue; hold the field fill and dark text instead. */
.pf-v5-c-form-control > input:-webkit-autofill,
.pf-v5-c-form-control > input:-webkit-autofill:hover,
.pf-v5-c-form-control > input:-webkit-autofill:focus {
    -webkit-text-fill-color: #424242;
    -webkit-box-shadow: inset 0 0 0 1000px #f3f4f6;
    box-shadow: inset 0 0 0 1000px #f3f4f6;
}

/* Field errors: MudBlazor's helper text, 12px error red 3px under the field. */
.iihf-auth-form-panel [id^="input-error-container"] .pf-v5-c-form__helper-text {
    margin-top: 3px;
}

.iihf-auth-form-panel .pf-v5-c-helper-text__item-text.pf-m-error {
    color: #f44336;
    font-size: 0.75rem;
    line-height: 1.66;
    letter-spacing: 0.4px;
}

/* The reference marks an error with the message alone: no status icon in the field. */
.iihf-auth-form-panel .pf-v5-c-helper-text__item-icon,
.iihf-auth-form-panel .pf-v5-c-form-control__utilities {
    display: none;
}

.iihf-auth-form-panel .pf-v5-c-check {
    margin: 0.35rem 0;
}

/* Consent checkboxes, as iihf-login's MudCheckBox: the 18px box sits in a 48px round hit area that
   washes navy on hover, flush with the fields' left edge, and the copy is body1 (16px/24px). The
   reference's copy carries a 20px top margin inside the row, and the box centres on the whole row,
   margin included. Rows start right under the field above (the negative margin cancels the
   form's 12px gap) and 8px under the previous row. */
.iihf-consent {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin: -12px 0 0;
}

.iihf-consent + .iihf-consent {
    margin-top: -4px;
}

.iihf-consent__control {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.iihf-consent__control:hover {
    background-color: rgba(0, 45, 98, 0.04);
}

.iihf-consent__control:has(:focus-visible) {
    background-color: rgba(0, 45, 98, 0.12);
}

.iihf-consent__box {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 2px solid #002d62;
    border-radius: 2px;
    background: transparent;
    flex-shrink: 0;
    cursor: pointer;
    outline: none;
    transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Material's check_box glyph: a white tick knocked out of a navy square. */
.iihf-consent__box:checked {
    background: #002d62 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='3 3 18 18'%3E%3Cpath fill='%23fff' d='M10 17l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E") center / 18px no-repeat;
}

.iihf-consent__text {
    padding-top: 20px;
    font-size: 1rem;
    line-height: 24px;
    letter-spacing: 0.15px;
    color: #424242;
    font-weight: 400;
    cursor: pointer;
}

.iihf-consent__text a {
    color: #002d62;
    text-decoration: none;
}

.iihf-consent__text a:hover {
    text-decoration: underline;
}

body[data-page-id="login-register"] .pf-v5-c-form__label-required,
body[data-page-id="login-register"] .subtitle {
    display: none;
}

.iihf-auth-form-panel .pf-v5-c-button.pf-m-primary,
.iihf-auth-form-panel input.pf-m-primary {
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
}

.iihf-auth-form-panel .pf-v5-c-button.pf-m-primary:disabled,
.iihf-auth-form-panel input.pf-m-primary:disabled {
    background-color: #6b7280;
    color: #9ca3af;
    -webkit-text-fill-color: #9ca3af;
    box-shadow: none;
    opacity: 1;
    cursor: not-allowed;
}

/* The password policy hint under the password field; field errors live in
   #input-error-container-* and must stay visible. */
body[data-page-id="login-register"] .pf-v5-c-input-group ~ .pf-v5-c-form__helper-text {
    display: none;
}

/* The reference's register labels all carry mt-3, the first one included, so its first field
   starts 12px lower than on Sign In. */
body[data-page-id="login-register"] #kc-register-form {
    padding-top: 12px;
}

/* The reference's MudCardActions sit 32px under the last consent, and their 8px padding against
   the card content's 16px puts Register 8px left of the fields. */
body[data-page-id="login-register"] #kc-form-buttons {
    margin: 20px 0 0 -8px;
}

/* The password field and its show/hide toggle are two input-group items; give the group the field
   chrome and strip it from the children so they read as one control. */
.iihf-auth-form-panel .pf-v5-c-input-group {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
}

.iihf-auth-form-panel .pf-v5-c-input-group .pf-v5-c-form-control {
    background-color: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    min-height: 50px;
}

.iihf-auth-form-panel .pf-v5-c-input-group .pf-v5-c-button {
    background-color: transparent;
    border: none;
    color: #757575;
    min-height: 50px;
}

/* The reference's password field has no toggle; ours keeps it, drawn as a plain end adornment
   (like the dropdown chevrons) rather than a separate segment behind PatternFly's divider. */
.iihf-auth-form-panel .pf-v5-c-input-group__item {
    border: none;
}

/* PatternFly paints button outlines with an ::after overlay, so the element border alone leaves the
   stock blue ring behind. */
.iihf-auth-form-panel .pf-v5-c-input-group .pf-v5-c-button::after {
    display: none;
}

/* Guest/registered login form doesn't show a "remember me" checkbox in the reference design */
#kc-form-login .pf-v5-c-check {
    display: none;
}

/* ---- Buttons ----
   The reference's primary is a compact, content-width button sitting at the start of the actions
   row -- not a block button. buttons.ftl always adds kcButtonBlockClass (width: 100%), so that is
   overridden here rather than by forking every page that submits a form. */

.iihf-auth-form-panel .pf-v5-c-button.pf-m-primary {
    background-color: #002d62;
    border-radius: 4px;
    min-height: 0;
    width: auto;
    padding: 6px 16px;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.75;
    letter-spacing: 0.4px;
    /* MudButton filled: elevation 2 at rest, 4 on hover, 8 while pressed. */
    box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.iihf-auth-form-panel .pf-v5-c-button.pf-m-primary:hover:not(:disabled) {
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12);
}

.iihf-auth-form-panel .pf-v5-c-button.pf-m-primary:active:not(:disabled) {
    box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);
}

.iihf-auth-form-panel .pf-v5-c-button.pf-m-primary::after {
    display: none;
}

/* The actions row carries margin: -8px to cancel an 8px margin PatternFly puts on each of its
   children. Left half-undone that offsets the row from the fields, so drop both halves and space
   siblings with a gap instead -- this is what keeps Sign In, Submit and "Back to Login" on the same
   left edge as the inputs and social buttons. */
.iihf-auth-form-panel .pf-v5-c-form__actions {
    margin: 0;
    gap: 0.5rem;
}

.iihf-auth-form-panel .pf-v5-c-form__actions > * {
    margin: 0;
}

.pf-v5-c-button.pf-m-primary:hover {
    background-color: #001f45;
}

/* ---- Social provider divider + buttons ---- */

/* social-providers.ftl emits the "or continue with" caption as a footer band *before*
   #kc-social-providers, so it is the footer's first child; #kc-info is the other band and keeps
   its own rule. */
.iihf-auth-form-panel .pf-v5-c-login__main-footer-band:not(#kc-info) {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-top: none;
    padding: 0;
    margin: 24px 0 16px;
    /* The reference caption is 13px on its 1.43 line. */
    line-height: 18.6px;
}

.iihf-auth-form-panel .pf-v5-c-login__main-footer-band:not(#kc-info)::before,
.iihf-auth-form-panel .pf-v5-c-login__main-footer-band:not(#kc-info)::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: #d0d5dd;
}

/* The caption carries pf-v5-u-font-size-sm and pf-v5-u-color-200, both !important utilities. */
.iihf-auth-form-panel .pf-v5-c-login__main-footer-band:not(#kc-info) .pf-v5-c-login__main-footer-band-item {
    font-size: 0.8125rem !important;
    color: #667085 !important;
    white-space: nowrap;
}

#kc-social-providers ul {
    padding: 0;
    margin: 0;
}

.iihf-auth-form-panel .pf-v5-c-button.pf-m-secondary {
    background-color: transparent;
    border: 1px solid #424242;
    border-radius: 4px;
    /* MudButton outlined: 5px 15px inside a 1px border on a 1.75 line, 36.5px tall. */
    min-height: 0;
    padding: 5px 15px;
    line-height: 1.75;
    /* kcFormSocialAccountListButtonClass carries pf-v5-u-justify-content-space-between, which is
       an !important utility -- centring the icon+label pair has to answer in kind. */
    justify-content: center !important;
    /* The reference's icon carries a 6px right margin. */
    gap: 6px;
    color: #424242;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.4px;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.iihf-auth-form-panel .pf-v5-c-button.pf-m-secondary:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

/* PatternFly paints the outline with an ::after overlay; drawn on top of the element's own border
   it doubled the reference's 1px outline, so the overlay goes and the border alone remains. */
.iihf-auth-form-panel .pf-v5-c-button.pf-m-secondary::after {
    display: none;
}

/* kcFormSocialAccountNameClass is pf-v5-u-m-auto (margin: auto !important), which shoves the icon
   to the far edge; the reference keeps icon and label together in the middle. */
#kc-social-providers .pf-v5-c-button .pf-v5-u-m-auto {
    margin: 0 !important;
}

#kc-social-providers svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Apple/TikTok ship no icon in social-providers.ftl's switch, so they fall through to the
   generic cube. Hide that and mask in the brand mark. */
#social-apple > svg,
#social-tiktok > svg {
    display: none;
}

#social-apple::before {
    content: '';
    width: 17px;
    height: 20px;
    flex-shrink: 0;
    background-color: #000;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 814 1000'%3E%3Cpath d='M788.1 340.9c-5.8 4.5-108.2 62.2-108.2 190.5 0 148.4 130.3 200.9 134.2 202.2-.6 3.2-20.7 71.9-68.7 141.9-42.8 61.6-87.5 123.1-155.5 123.1s-85.5-39.5-164-39.5c-76 0-103.7 40.8-165.9 40.8s-105-57.8-155.5-127.4C46 790.7 0 663 0 541.8c0-207.5 135.4-317.3 269-317.3 71 0 130.5 46.4 174.9 46.4 42.7 0 109.2-49 192.5-49 30.8 0 108.2 2.6 168.1 75.3zm-234-181.5c31.1-36.9 53.1-88.1 53.1-139.3 0-7.1-.6-14.3-1.9-20.1-50.6 1.9-110.8 33.7-147.1 75.8-28.5 32.4-55.1 83.6-55.1 135.5 0 7.8 1.3 15.6 1.9 18.1 3.2.6 8.4 1.3 13.6 1.3 45.4 0 102.5-30.4 135.5-71.3z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 814 1000'%3E%3Cpath d='M788.1 340.9c-5.8 4.5-108.2 62.2-108.2 190.5 0 148.4 130.3 200.9 134.2 202.2-.6 3.2-20.7 71.9-68.7 141.9-42.8 61.6-87.5 123.1-155.5 123.1s-85.5-39.5-164-39.5c-76 0-103.7 40.8-165.9 40.8s-105-57.8-155.5-127.4C46 790.7 0 663 0 541.8c0-207.5 135.4-317.3 269-317.3 71 0 130.5 46.4 174.9 46.4 42.7 0 109.2-49 192.5-49 30.8 0 108.2 2.6 168.1 75.3zm-234-181.5c31.1-36.9 53.1-88.1 53.1-139.3 0-7.1-.6-14.3-1.9-20.1-50.6 1.9-110.8 33.7-147.1 75.8-28.5 32.4-55.1 83.6-55.1 135.5 0 7.8 1.3 15.6 1.9 18.1 3.2.6 8.4 1.3 13.6 1.3 45.4 0 102.5-30.4 135.5-71.3z'/%3E%3C/svg%3E") center / contain no-repeat;
}

#social-tiktok::before {
    content: '';
    width: 18px;
    height: 20px;
    flex-shrink: 0;
    background-color: #000;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-2.88 2.5 2.89 2.89 0 0 1-2.88-2.89 2.89 2.89 0 0 1 2.88-2.88c.28 0 .54.04.79.1v-3.5a6.37 6.37 0 0 0-.79-.05A6.34 6.34 0 0 0 6.26 15.3a6.34 6.34 0 0 0 6.34 6.34 6.34 6.34 0 0 0 6.34-6.34V8.31a8.18 8.18 0 0 0 4.76 1.52V6.4a4.85 4.85 0 0 1-1-.71z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-2.88 2.5 2.89 2.89 0 0 1-2.88-2.89 2.89 2.89 0 0 1 2.88-2.88c.28 0 .54.04.79.1v-3.5a6.37 6.37 0 0 0-.79-.05A6.34 6.34 0 0 0 6.26 15.3a6.34 6.34 0 0 0 6.34 6.34 6.34 6.34 0 0 0 6.34-6.34V8.31a8.18 8.18 0 0 0 4.76 1.52V6.4a4.85 4.85 0 0 1-1-.71z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---- "Don't have an account?" footer ---- */

/* MudDivider (mt-4 mb-2): a 1px #e0e0e0 rule 16px under the last social button, 8px above the
   footer line. */
.iihf-auth-form-panel #kc-info {
    border-top: 1px solid #e0e0e0;
    padding: 8px 0 0;
    /* The social list already ends with 8px of its own. */
    margin-top: 8px;
}

/* body2 copy with a body1 link, as the reference's footer line: 24px tall. */
#kc-registration-container {
    text-align: center;
    font-size: 0.875rem;
    line-height: 20px;
    color: #424242;
}

/* The reference puts "&nbsp;" plus a space before its link; this adds the second space. */
#kc-registration-container a {
    margin-left: 3.6px;
    font-size: 1rem;
    line-height: 24px;
}

/* ---- Reset password ----
   The reference (ResetPasswordRoot) puts a plain "Back to login" link where the tabs would be,
   the title 64px under it, the first label 12px under the title, and its button 8px left of the
   fields; hints are MudBlazor helper text. Keycloak's flow differs in content (email only, a link
   is mailed), so only the presentation is matched. */
body[data-page-id="login-login-reset-password"] .pf-v5-c-login__main {
    position: relative;
}

body[data-page-id="login-login-reset-password"] .pf-v5-c-login__main-header {
    padding-top: 64px;
}

body[data-page-id="login-login-reset-password"] #kc-reset-password-form {
    padding-top: 12px;
}

body[data-page-id="login-login-reset-password"] #kc-reset-password-form .pf-v5-c-form__actions {
    padding-top: 12px !important;
}

body[data-page-id="login-login-reset-password"] #kc-form-buttons {
    margin-left: -8px;
}

body[data-page-id="login-login-reset-password"] .pf-v5-c-form__actions > a.pf-m-secondary {
    position: absolute;
    top: 0;
    left: -16px;
    width: auto;
    min-height: 0;
    padding: 0;
    border: none;
    background: none;
    color: #002d62;
    font-size: 1rem;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 0.15px;
}

body[data-page-id="login-login-reset-password"] .pf-v5-c-form__actions > a.pf-m-secondary::after {
    display: none;
}

body[data-page-id="login-login-reset-password"] .pf-v5-c-form__actions > a.pf-m-secondary:hover {
    background: none;
    text-decoration: underline;
}

body[data-page-id="login-login-reset-password"] #kc-info-wrapper {
    text-align: left;
}

body[data-page-id="login-login-reset-password"] #kc-info-wrapper > span {
    font-size: 0.75rem !important;
    line-height: 1.66;
    letter-spacing: 0.4px;
    color: rgba(0, 0, 0, 0.54) !important;
}

/* The reference's error card (ErrorComponent) has no tabs: its title sits 16px lower than on
   Sign In and the copy runs left-aligned in body1, 4px under the title. */
body[data-page-id="login-error"] .pf-v5-c-login__main-header {
    padding-top: 16px;
}

.iihf-auth-form-panel #kc-error-message {
    text-align: left;
    padding-top: 4px;
}

.iihf-auth-form-panel #kc-error-message p {
    margin: 0;
    font-size: 1rem;
    line-height: 24px;
    color: #424242;
}

/* ---- Complete-profile (match staging /update-profile) ---- */

body[data-page-id="login-complete-profile"] .pf-v5-c-form:has(#kc-attempted-username) {
    display: none !important;
}

body[data-page-id="login-complete-profile"] .pf-v5-c-form__label-required,
body[data-page-id="login-complete-profile"] .subtitle {
    display: none;
}

/* iihf-login UpdateProfile, built from the same MudBlazor parts as register: no tabs, so the
   title sits 16px lower than on Sign In; the subtitle is a MudPaper (pa-3 mt-3) holding centred
   body2; labels carry mt-3; Save sits in MudCardActions like Register. */
body[data-page-id="login-complete-profile"] .pf-v5-c-login__main-header {
    padding-top: 16px;
}

.iihf-profile-subtitle {
    text-align: center;
    color: #424242;
    font-size: 0.875rem;
    line-height: 20px;
    letter-spacing: 0.15px;
    margin: 12px 0 0;
    padding: 12px;
    background: #fff;
    border-radius: 4px;
}

body[data-page-id="login-complete-profile"] #kc-complete-profile-form {
    padding-top: 12px;
}

body[data-page-id="login-complete-profile"] #kc-complete-profile-form > .pf-v5-c-form__group:has(#kc-complete-profile) {
    margin: 20px 0 0 -8px;
}

/* MudBlazor's disabled text colour. */
.iihf-auth-form-panel input:disabled:not(.pf-m-primary) {
    color: rgba(0, 0, 0, 0.38);
    -webkit-text-fill-color: rgba(0, 0, 0, 0.38);
    opacity: 1;
    cursor: not-allowed;
}

/* MudDatePicker's adornment: Material's filled "event" icon, 24px at .54 black, 12px in. */
.iihf-date {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-opacity='.54' d='M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 24px;
}

.iihf-date > input {
    padding-right: 2.75rem;
    cursor: pointer;
}

.iihf-auth-form-panel .pf-v5-c-form__group:has(.iihf-date) {
    position: relative;
}

.iihf-datepicker {
    position: absolute;
    z-index: 30;
    left: 0;
    top: calc(100% + 4px);
    width: 100%;
    max-width: 328px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.iihf-datepicker__header {
    background: #002d62;
    color: #fff;
    padding: 1rem 1.25rem 1.15rem;
}

.iihf-datepicker__year {
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.875rem;
    opacity: 0.9;
    padding: 0;
    cursor: pointer;
}

.iihf-datepicker__year:hover {
    opacity: 1;
    text-decoration: underline;
}

.iihf-datepicker__title {
    font-size: 1.75rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-top: 0.15rem;
}

.iihf-datepicker__body {
    padding: 0.75rem 0.85rem 1rem;
}

.iihf-datepicker__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.iihf-datepicker__nav-btn {
    border: none;
    background: transparent;
    color: #002d62;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.35rem;
}

.iihf-datepicker__dow,
.iihf-datepicker__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
}

.iihf-datepicker__dow {
    font-size: 0.75rem;
    color: #667085;
    margin-bottom: 0.25rem;
}

.iihf-datepicker__day {
    border: none;
    background: transparent;
    height: 36px;
    border-radius: 50%;
    font-size: 0.875rem;
    color: #1f2937;
    cursor: pointer;
}

.iihf-datepicker__day--empty {
    cursor: default;
}

.iihf-datepicker__day.is-today {
    font-weight: 600;
    color: #002d62;
}

.iihf-datepicker__day.is-selected {
    background: #002d62;
    color: #fff;
}

.iihf-datepicker__day:disabled {
    color: #d1d5db;
    cursor: default;
}

.iihf-datepicker__nav-btn:disabled {
    color: #d1d5db;
    cursor: default;
}

.iihf-datepicker__nav-label {
    border: none;
    background: transparent;
    font: inherit;
    color: inherit;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.iihf-datepicker__nav-label:hover,
.iihf-datepicker__month:not(:disabled):hover,
.iihf-datepicker__year-option:hover {
    background: #f3f4f6;
}

.iihf-datepicker__months {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
}

.iihf-datepicker__month,
.iihf-datepicker__year-option {
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 0.9375rem;
    color: #1f2937;
    cursor: pointer;
}

.iihf-datepicker__month {
    height: 48px;
}

.iihf-datepicker__month:disabled {
    color: #d1d5db;
    cursor: default;
}

.iihf-datepicker__years {
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 264px;
    overflow-y: auto;
}

.iihf-datepicker__year-option {
    flex: none;
    height: 40px;
}

.iihf-datepicker__month.is-selected,
.iihf-datepicker__year-option.is-selected {
    color: #002d62;
    font-size: 1.375rem;
    font-weight: 600;
}
