:root {
    --keycloak-logo-url: url(../img/ug-logo.png);
    --keycloak-logo-height: 55px;
    --keycloak-logo-width: 174px;
}
#kc-header-wrapper .kc-logo-text,
div.kc-logo-text {
    background-image: url(../img/ug-logo.png) !important;
    height: 55px !important;
    width: 174px !important;
    max-width: 100% !important;
}
.pf-v5-c-login__container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}
.pf-v5-c-login__main {
    max-width: 400px !important;
    width: 92% !important;
    margin: 0 auto !important;
    border-radius: 0 0 12px 12px !important;
    position: relative !important;
    border-top: none !important;
    overflow: visible !important;
}
.pf-v5-c-login__main::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    background-color: var(--keycloak-card-top-color, #0066CC) !important;
    animation: ugTopBarBreathe 3s ease-in-out infinite !important;
    z-index: 2 !important;
}
@keyframes ugTopBarBreathe {
    0%, 100% {
        box-shadow:
            0 0 2px rgba(0, 102, 204, 0.15),
            0 1px 4px rgba(0, 102, 204, 0.08);
        filter: brightness(1);
    }
    50% {
        box-shadow:
            0 0 5px rgba(43, 154, 243, 0.45),
            0 1px 10px rgba(0, 102, 204, 0.32),
            0 2px 16px rgba(0, 102, 204, 0.18);
        filter: brightness(1.09);
    }
}
@media (prefers-reduced-motion: reduce) {
    .pf-v5-c-login__main::before {
        animation: none !important;
    }
}
.pf-v5-c-login__main-body {
    padding-left: 36px !important;
    padding-right: 36px !important;
}
#kc-form-wrapper,
#kc-social-providers {
    max-width: 320px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
.pf-v5-c-login__main-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    border-top: none !important;
}
.pf-v5-c-login__main-header h1,
#kc-page-title {
    font-size: 1.45rem !important;
    white-space: nowrap !important;
    text-align: center !important;
    justify-self: center !important;
    margin: 0 auto !important;
}

/* ═══════════════════════════════════════════════════════════════
   Sign In — UG Royal Navy & Gold Accent Structured Button
   ═══════════════════════════════════════════════════════════════ */

.pf-v5-c-form__actions {
    display: flex !important;
    justify-content: center !important;
}

#kc-login {
    width: 220px !important;
    max-width: 100% !important;
    height: 44px !important;
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin: 8px auto 0 auto !important;
    padding: 0 24px !important;
    border-radius: 10px !important;
    position: relative !important;
    overflow: hidden !important;
    cursor: pointer !important;

    /* Solid-depth UG Royal Navy linear gradient */
    background: linear-gradient(180deg, #133B6E 0%, #0B2545 100%) !important;
    border: 1px solid #1E4E8C !important;

    /* Tactile inner specular edge + subtle elevation */
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 2px 6px rgba(11, 37, 69, 0.22),
        0 8px 20px rgba(11, 37, 69, 0.14) !important;

    /* Typography */
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
    line-height: 1 !important;
    color: #FFFFFF !important;
    text-shadow: none !important;

    transition: all 180ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

#kc-login::before {
    display: none !important;
    content: none !important;
}

#kc-login::after {
    content: '→' !important;
    position: static !important;
    inset: unset !important;
    width: auto !important;
    height: auto !important;
    border: none !important;
    pointer-events: none !important;
    display: inline-block !important;
    font-size: 1.05rem !important;
    line-height: 1 !important;
    color: #D4AF37 !important;
    transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

#kc-login:hover {
    transform: translateY(-1px) !important;
    background: linear-gradient(180deg, #1B4D8E 0%, #133B6E 100%) !important;
    border-color: rgba(212, 175, 55, 0.55) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 4px 12px rgba(11, 37, 69, 0.28),
        0 12px 24px rgba(11, 37, 69, 0.18) !important;
}

#kc-login:hover::after {
    transform: translateX(3px) !important;
}

#kc-login:active {
    transform: translateY(0px) !important;
    background: linear-gradient(180deg, #0B2545 0%, #081C35 100%) !important;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.25),
        0 1px 4px rgba(11, 37, 69, 0.20) !important;
}

#kc-login:focus-visible {
    outline: 2px solid #D4AF37 !important;
    outline-offset: 3px !important;
}

/* ═══════════════════════════════════════════════════════════════
   2FA / Passkey pages — button spacing
   ═══════════════════════════════════════════════════════════════ */

/* Space between Sign In / Sign in with Passkey and "Try Another Way" */
#kc-select-try-another-way-form {
    margin-top: 24px !important;
}

#try-another-way {
    margin-top: 8px !important;
    display: block !important;
    text-align: center !important;
}

/* Passkey authenticate button — add bottom margin */
#authenticateWebAuthnButton {
    margin-bottom: 10px !important;
}

/* Mobile: extra breathing room between buttons */
@media (max-width: 480px) {
    .pf-v5-c-login__main-body {
        padding-left: 24px !important;
        padding-right: 24px !important;
    }

    #kc-select-try-another-way-form {
        margin-top: 28px !important;
    }

    #kc-login {
        width: 220px !important;
        max-width: 100% !important;
        height: 44px !important;
        padding: 0 20px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Social providers
   ═══════════════════════════════════════════════════════════════ */

/* Social providers — center the list */
#kc-social-providers ul {
    display: flex !important;
    justify-content: center !important;
    list-style: none !important;
}

/* Microsoft 365 — square logo button */
#social-microsoft {
    width: 48px !important;
    height: 48px !important;
    min-width: unset !important;
    padding: 8px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
}

#social-microsoft span {
    display: none !important;
}

#social-microsoft svg {
    display: none !important;
}

#social-microsoft::before {
    content: '';
    display: block;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 21 21'%3E%3Crect x='0' y='0' width='10' height='10' fill='%23F25022'/%3E%3Crect x='11' y='0' width='10' height='10' fill='%237FBA00'/%3E%3Crect x='0' y='11' width='10' height='10' fill='%2300A4EF'/%3E%3Crect x='11' y='11' width='10' height='10' fill='%23FFB900'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.pf-v5-c-login__main-footer-band-item {
    white-space: pre-line !important;
    text-align: center !important;
    line-height: 1.8 !important;
}


/* ═══════════════════════════════════════════════════════════════
   Option 2: Account Category 2-Pill Switch + Locked Suffix Badge
   UG Royal Navy (#0B2545 -> #133B6E) & UG Gold (#D4AF37 / #FDE68A)
   ═══════════════════════════════════════════════════════════════ */

.ug-role-switch-wrap {
    margin-bottom: 14px !important;
}

.ug-role-switch-label {
    display: block !important;
    font-family: var(--pf-v5-c-form__label--FontFamily, 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif) !important;
    font-size: var(--pf-v5-c-form__label--FontSize, 0.875rem) !important;
    font-weight: var(--pf-v5-c-form__label-text--FontWeight, 700) !important;
    color: var(--pf-v5-c-form__label--Color, #151515) !important;
    margin-bottom: 6px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
}

.ug-role-switch {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    background: #F1F5F9 !important;
    border: 1px solid #CBD5E1 !important;
    border-radius: 8px !important;
    padding: 4px !important;
}

.ug-role-pill {
    appearance: none !important;
    -webkit-appearance: none !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: #334155 !important;
    border-radius: 6px !important;
    padding: 6px 8px !important;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1px !important;
    cursor: pointer !important;
    transition: all 150ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.ug-role-pill:hover {
    background: #E2E8F0 !important;
    color: #0B2545 !important;
}

.ug-role-pill .role-title {
    font-size: 0.80rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

.ug-role-pill .role-dom {
    font-size: 0.69rem !important;
    font-weight: 500 !important;
    color: #64748B !important;
    line-height: 1.2 !important;
}

.ug-role-pill.is-active {
    background: linear-gradient(180deg, #133B6E 0%, #0B2545 100%) !important;
    color: #FFFFFF !important;
    border-color: #D4AF37 !important;
    box-shadow: 0 2px 5px rgba(11, 37, 69, 0.22) !important;
}

.ug-role-pill.is-active .role-dom {
    color: #FDE68A !important;
}

.ug-role-pill:focus-visible {
    outline: 2px solid #D4AF37 !important;
    outline-offset: 2px !important;
}

.ug-username-field-wrap {
    position: relative !important;
}

.ug-username-field-wrap.has-suffix input#username {
    padding-right: 122px !important;
    font-weight: 500 !important;
}

.ug-locked-suffix-badge {
    position: absolute !important;
    right: 6px !important;
    height: 26px !important;
    padding: 0 9px !important;
    border-radius: 5px !important;
    background: #EEF2F6 !important;
    border: 1px solid #CBD5E1 !important;
    color: #0B2545 !important;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    line-height: 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    pointer-events: none !important;
    user-select: none !important;
    white-space: nowrap !important;
    z-index: 3 !important;
}

.ug-locked-suffix-badge.is-hidden {
    display: none !important;
}


/* ═══════════════════════════════════════════════════════════════
   Microsoft 365 Option A: 48x48 Square Tile + "Microsoft 365" Caption Below
   ═══════════════════════════════════════════════════════════════ */

#social-microsoft picture,
#social-microsoft img {
    display: none !important;
}

#kc-social-providers ul li {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

#social-microsoft {
    width: 48px !important;
    height: 48px !important;
    border-radius: 10px !important;
    border: 1px solid #CBD5E1 !important;
    background: #FFFFFF !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
    position: relative !important;
    margin: 0 auto !important;
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease !important;
}

#social-microsoft:hover {
    transform: translateY(-1px) !important;
    border-color: #94A3B8 !important;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12) !important;
}

#kc-social-providers ul li::after {
    content: 'Microsoft 365' !important;
    display: block !important;
    margin-top: 6px !important;
    font-family: var(--pf-v5-c-form__label--FontFamily, 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif) !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    color: var(--pf-v5-c-form__label--Color, #151515) !important;
    letter-spacing: 0.01em !important;
    text-align: center !important;
}
