/* LSB Custom Keycloak Theme - CSS Overrides Only
 * Following Keycloak best practices: customize CSS, not templates
 */

/*============================================
   FONT IMPORTS
   ============================================ */

/* TitilliumWeb Regular */
@font-face {
    font-family: "TitilliumWeb";
    src: url("../fonts/TitilliumWeb-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* TitilliumWeb Italic */
@font-face {
    font-family: "TitilliumWeb";
    src: url("../fonts/TitilliumWeb-Italic.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

/* TitilliumWeb Light */
@font-face {
    font-family: "TitilliumWeb";
    src: url("../fonts/TitilliumWeb-Light.ttf") format("truetype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* TitilliumWeb Light Italic */
@font-face {
    font-family: "TitilliumWeb";
    src: url("../fonts/TitilliumWeb-LightItalic.ttf") format("truetype");
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}

/* TitilliumWeb SemiBold */
@font-face {
    font-family: "TitilliumWeb";
    src: url("../fonts/TitilliumWeb-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* TitilliumWeb SemiBold Italic */
@font-face {
    font-family: "TitilliumWeb";
    src: url("../fonts/TitilliumWeb-SemiBoldItalic.ttf") format("truetype");
    font-weight: 600;
    font-style: italic;
    font-display: swap;
}

/* TitilliumWeb Bold */
@font-face {
    font-family: "TitilliumWeb";
    src: url("../fonts/TitilliumWeb-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* TitilliumWeb Bold Italic */
@font-face {
    font-family: "TitilliumWeb";
    src: url("../fonts/TitilliumWeb-BoldItalic.ttf") format("truetype");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

:root {
    --keycloak-card-top-color: #f72440 !important;
}


/* ============================================
   1. BACKGROUND - White instead of default
   ============================================ */
html,
body {
    background-color: #ffffff !important;
    background-image: none !important;
    margin: 0;
    padding: 0;
}

/* All possible container classes */
body,
.pf-v5-c-page,
.pf-v5-c-login,
.pf-v5-c-login__container,
.pf-v5-c-login__main,
.pf-v5-c-form-control,
.login-pf,
.login-pf-page,
#kc-container,
#kc-container-wrapper,
.pf-c-page,
.pf-c-login {
    background-color: #ffffff !important;
    background-image: none !important;
}

/* Center the layout */
body {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
}

.pf-v5-c-login__main {
    box-shadow: 0 1rem 2rem 0 rgba(0, 0, 0, 0.2) !important;
    border-radius: 6px !important;
}

div.pf-v5-c-login__main-header {
    display: flex;
}

.pf-v5-c-login__main > :last-child:not(.pf-v5-c-login__main-footer) {
    padding-block-end: 2rem;
}

/* ============================================
   2. LOGO - LSB Horizontal Logo
   ============================================ */
#kc-header,
.pf-v5-c-login__header,
.pf-c-login__header {
    text-align: center !important;
    width: 100% !important;
    margin-bottom: 2rem !important;
    order: -1 !important;
    display: block !important;
}

#kc-header-wrapper,
.pf-v5-c-brand,
.pf-c-brand {
    background-image: url("../img/logo.svg") !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
    background-position: center !important;
    height: 80px !important;
    margin: 0 auto 2rem !important;
    max-width: 300px !important;
    width: 100% !important;
    display: block !important;
    /* Hide all text content */
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    overflow: hidden !important;
}

/* Hide text in logo area */
#kc-header-wrapper *,
#kc-header-wrapper span,
.pf-v5-c-brand *,
.pf-c-brand *,
.kc-logo-text {
    display: none !important;
    visibility: hidden !important;
}

/* ============================================
   Form Title - "Sign in to your account"
   ============================================ */
#kc-page-title {
    color: #000000 !important;
    font-family: "TitilliumWeb", "Helvetica", "Arial", sans-serif !important;
    font-weight: 600 !important;
}

/* Keep title text consistent - don't show username in title */
#kc-page-title span {
    display: none !important;
}

/* ============================================
   3. FONTS - TitilliumWeb
   ============================================ */
body,
input,
button,
label,
a {
    font-family: "TitilliumWeb", "Helvetica", "Arial", sans-serif !important;
}

/* ============================================
   4. FORM CARD - Enhanced styling
   ============================================ */

.form-group label,
.pf-v5-c-form__label,
.pf-c-form__label {
    display: block !important;
    margin-bottom: 0.5rem !important;
}

.instruction, .pf-v5-c-check__label {
    color: black !important;
}

/* ============================================
   5. INPUT FIELDS - LSB Styling
   ============================================ */
input {
    border: 1px solid #d1d5db !important;
    background: #ffffff !important;
    color: #000000 !important;
    border-radius: 6px !important;
    padding: 0.625rem 0.75rem !important;
    font-size: 0.875rem !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

input:read-only {
    background-color: #f9fafb !important;
    cursor: not-allowed !important;
    color: #6b7280 !important;
}

.pf-v5-c-form-control:after {
    border-block-end: none !important;

}

.pf-v5-c-button:after {
    border: none;
}

#username:focus, #kc-attempted-username:focus, #password:focus {
    outline: none;
!important border-color: #f72440;
!important box-shadow: 0 0 0 2 px rgba(247, 36, 64, 0.25);
!important
}

/* ============================================
   6. BUTTONS - LSB Red Primary Button
   ============================================ */
.btn-primary,
.pf-v5-c-button.pf-m-primary,
.pf-c-button.pf-m-primary,
.pf-m-control,
input[type="submit"],
button[type="submit"],
#kc-login, #reset-login {
    background-color: #f72440 !important;
    border-color: #f72440 !important;
    color: #ffffff !important;
    border-radius: 4px !important;
    padding: 0.625rem 1rem !important;
    font-weight: 600 !important;
    transition: background-color 0.3s ease !important;
    cursor: pointer !important;
    border-width: 1px !important;
    position: relative;
    display: inline-block;
}

.pf-v5-c-button.pf-m-primary:hover, button[type="submit"]:hover, #kc-login:hover, #reset-login:hover, .pf-m-control:hover {
    background-color: rgb(247 36 64 / 0.75) !important;

}

.pf-v5-c-button.pf-m-secondary::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: #f72440;
    transition: width 300ms ease-in-out;
    pointer-events: none;
}

.pf-v5-c-button.pf-m-secondary:hover::before {
    width: 100%;
}


.btn-primary:focus,
.pf-v5-c-button:focus,
.pf-c-button:focus,
input[type="submit"]:focus,
button[type="submit"]:focus,
#kc-login:focus {
    outline: 2px solid #f72440 !important;
    outline-offset: 2px !important;
}

:where(.pf-v5-theme-dark) .pf-v5-c-input-group > * + * {
    border-inline-start: none;
}

.pf-m-secondary {
    background-color: #ffffff;
    border: 1px solid #f72440;
    font-weight: 600 !important;
    border-radius: 6px;
    position: relative;
}

/* ============================================
   7. LINKS - LSB Red with Animated Underline
   ============================================ */
a {
    color: #f72440 !important;
    text-decoration: none;
    position: relative;
    display: inline-block;
    transition: color 0.2s ease;
}

/* Animated underline effect - matching frontend */
a:not(.pf-v5-c-button)::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: #f72440;
    transition: width 300ms ease-in-out;
    pointer-events: none;
}

a:not(.pf-m-secondary):hover,
a:focus,
a:focus-visible,
a:active,
a:not(.pf-m-secondary):visited:hover {
    color: #f72440 !important;
    text-decoration: none !important;
}

a:hover::before,
a:focus-visible::before {
    width: 100%;
}

/* ============================================
   8. LABELS
   ============================================ */
label {
    color: #000000 !important;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.kc-tooltip-text {
    background-color: #f72440 !important;
    top: 5px !important;
}

.kc-login-tooltip:hover .kc-tooltip-text {
    opacity: 1 !important;
}

.kc-tooltip-text::after {
    border-color: transparent #f72440 transparent transparent !important;
}

/* ============================================
   10. ERROR MESSAGES - Red with icon
   ============================================ */
.pf-v5-c-alert {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #d22b2b;
    border-radius: 4px;
    padding: 1rem;
}

.pf-m-success {
    background-color: rgb(0 134 72 / 0.05);
    border-color: rgb(0 134 72 / 0.3);
    color: #008648
}

.pf-m-warning {
    background-color: rgb(165 105 0 / 0.05);
    border-color: rgb(165 105 0 / 0.3);
    color: #a56900;
}

/* ============================================
   11. INFO/INSTRUCTION SECTION - Footer styling
   ============================================ */
#kc-info {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #d1d5db;
}

#kc-info-wrapper p,
#kc-info-wrapper {
    font-family: "TitilliumWeb", "Helvetica", "Arial", sans-serif;
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    line-height: 1.5;
    margin: 0 2rem 1rem 2rem;
}
