html,
body {
    min-height: 100%;
    height: 100%;
    margin: 0;
    overflow-x: hidden;
    background: url("../img/background.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000000; /* fallback color */
}


/* Hide default Keycloak header/logo text */
#kc-header,
#kc-header-wrapper,
.kc-logo-text {
    display: none !important;
}

/* Outer login layout */
.pf-v5-c-login {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Custom logo ABOVE the login box */
.pf-v5-c-login::before {
    content: "";
    display: block;
    background: url("../img/boxarr-logo.png") no-repeat center;
    background-size: contain;
    width: 2200px;
    height: 80px;
    margin-bottom: 30px;
}

/* Center the container */
.pf-v5-c-login__container {
    display: flex !important;
    justify-content: center !important;
    max-width: 860px !important;
    margin: 0 auto !important;
}

/* Main login container */
.pf-v5-c-login__main,
.pf-v5-c-login__main .card-pf {
    margin: 0 auto !important;
    background: rgba(28, 47, 67, 0.1) !important;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(28, 47, 67, 0.1) !important;
    border-radius: 5px !important;
}

/* Keep inner body transparent */
.pf-v5-c-login__main-body {
    background: transparent !important;
}

/* Base text color in the login box */
.pf-v5-c-login__main {
    color: #cd9600;
}

/* Title */
#kc-page-title,
.pf-v5-c-title.pf-m-3xl {
    text-align: center !important;
    width: 100%;
    color: #cd9600 !important;
}

/* Labels */
.pf-v5-c-login__main .pf-v5-c-form__label,
.pf-v5-c-login__main .pf-v5-c-form__label-text {
    color: #cd9600 !important;
}

/* Inputs */
.pf-v5-c-login__main input {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    border-radius: 6px;
}

/* Ensure login options row is visible */
#kc-form-options,
#kc-form-options .checkbox,
#kc-form-options-wrapper,
.login-pf-settings,
.pf-v5-c-login__main .pf-v5-c-form {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Put remember me and forgot password on one row */
#kc-form-options {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    text-align: left !important;
    margin-top: 12px !important;
}

#kc-form-options .checkbox,
#kc-form-options-wrapper {
    width: 100% !important;
}

/* Remember me text */
.pf-v5-c-check__label,
#kc-form-options label,
#kc-form-options span {
    color: #cd9600 !important;
}

/* Links */
:root {
    --pf-v5-global--link--Color: #cd9600;
}

#kc-form-options a,
.pf-v5-c-login__main a {
    color: #cd9600 !important;
}

/* Optional hover color for links */
#kc-form-options a:hover,
.pf-v5-c-login__main a:hover {
    color: #e8b63a !important;
}

/* Login button base (red) */
#kc-login {
    background-color: #da4236 !important;
    border-color: #da4236 !important;
    color: #ffffff !important;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

/* Hover state */
#kc-login:hover {
    background-color: #990000 !important;
    border-color: #990000 !important;
}

/* Active (when clicked) */
#kc-login:active {
    background-color: #660000 !important;
    border-color: #660000 !important;
}


/* Center Google button content */
#social-google {
    position: relative;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Position the icon independently on the left */
#social-google svg {
    position: absolute;
    left: 15px;
    width: 20px;
    height: 20px;
}


/* Remove blue outline */
#social-google,
#social-google:focus,
#social-google:active {
    outline: none !important;
    box-shadow: none !important;
}

/* Hover */
#social-google:hover {
    background: rgb(200, 200, 200) !important;
    border-color: #e8b63a !important;
}

#social-google {
    background: rgba(28, 47, 67, 0.6) !important;
    justify-content: center !important;
    gap: 10px;
    background-color: #ffffff !important;
    color: #000000 !important;
    transition: all 0.2s ease;
}


#kc-login,
#kc-login:hover,
#kc-login:focus,
#kc-login:active {
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

/* Make login/register cards a consistent width */
.pf-v5-c-login__main {
    width: 100%;
    max-width: 460px !important;
    min-width: 460px !important;
    margin: 0 auto !important;
    box-sizing: border-box;
}

#kc-login span,
#kc-login * {
    text-decoration: none !important;
}

/* Register button */
#kc-form-buttons input[type="submit"] {
    background-color: #da4236 !important;
    border: 1px solid #da4236 !important;
    color: #ffffff !important;
    border-radius: 8px;
}

/* Hover */
#kc-form-buttons input[type="submit"]:hover {
    background-color: #990000 !important;
    border-color: #990000 !important;
}

/* Active */
#kc-form-buttons input[type="submit"]:active {
    background-color: #660000 !important;
    border-color: #660000 !important;
}

/* Remove divider line above SSO / footer */
.pf-v5-c-login__main-footer-band {
    border-top: none !important;
}


/* Consistent 5px rounding across the login page */
.pf-v5-c-login__main,
.pf-v5-c-login__main .card-pf,
.pf-v5-c-login__main-body,
.pf-v5-c-form-control,
.pf-v5-c-form-control input,
.pf-v5-c-input-group,
.pf-v5-c-input-group__item,
.pf-v5-c-button,
#kc-login,
#social-google {
  border-radius: 5px;
}
#password-show-password,
#password-show-password.pf-v5-c-button,
#password-show-password.pf-v5-c-button.pf-m-control,
#password-confirm-show-password,
#password-confirm--show-password.pf-v5-c-button,
#password-confirm--show-password.pf-v5-c-button.pf-m-control{
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-top-right-radius: 5px !important;
  border-bottom-right-radius: 5px !important;
}
/* Keep joined password field + toggle visually aligned */
.pf-v5-c-input-group {
  border-radius: 5px !important;
  overflow: hidden;
}
.pf-v5-c-input-group .pf-v5-c-form-control,
.pf-v5-c-input-group .pf-v5-c-input-group__item,
.pf-v5-c-input-group .pf-v5-c-input-group__item.pf-m-fill {
  border-radius: 0 !important;
}
.pf-v5-c-input-group .pf-v5-c-input-group__item:first-child,
.pf-v5-c-input-group .pf-v5-c-form-control:first-child {
  border-top-left-radius: 5px !important;
  border-bottom-left-radius: 5px !important;
}
.pf-v5-c-input-group .pf-v5-c-input-group__item:last-child,
#password-show-password {
  border-top-right-radius: 5px !important;
  border-bottom-right-radius: 5px !important;
}

/* Force all button borders/chrome to transparent in every state */
.pf-v5-c-button,
.pf-v5-c-button::before,
.pf-v5-c-button::after,
.pf-v5-c-button:hover,
.pf-v5-c-button:hover::before,
.pf-v5-c-button:hover::after,
.pf-v5-c-button:focus,
.pf-v5-c-button:focus::before,
.pf-v5-c-button:focus::after,
.pf-v5-c-button:focus-visible,
.pf-v5-c-button:focus-visible::before,
.pf-v5-c-button:focus-visible::after,
.pf-v5-c-button:active,
.pf-v5-c-button:active::before,
.pf-v5-c-button:active::after,
.pf-v5-c-button:disabled,
.pf-v5-c-button[aria-disabled="true"],
a.pf-v5-c-button,
a.pf-v5-c-button:hover,
a.pf-v5-c-button:focus,
a.pf-v5-c-button:focus-visible,
a.pf-v5-c-button:active,
button,
button:hover,
button:focus,
button:focus-visible,
button:active {
  border-color: transparent !important;
  border-top-color: transparent !important;
  border-right-color: transparent !important;
  border-bottom-color: transparent !important;
  border-left-color: transparent !important;
  outline-color: transparent !important;
  box-shadow: none !important;
}
/* Remove all form-control border lines */
.pf-v5-c-form-control,
.pf-v5-c-form-control:hover,
.pf-v5-c-form-control:focus,
.pf-v5-c-form-control:focus-visible,
.pf-v5-c-form-control:focus-within,
.pf-v5-c-form-control:active {
  --pf-v5-c-form-control--before--BorderTopColor: transparent !important;
  --pf-v5-c-form-control--before--BorderRightColor: transparent !important;
  --pf-v5-c-form-control--before--BorderBottomColor: transparent !important;
  --pf-v5-c-form-control--before--BorderLeftColor: transparent !important;
  --pf-v5-c-form-control--after--BorderTopColor: transparent !important;
  --pf-v5-c-form-control--after--BorderRightColor: transparent !important;
  --pf-v5-c-form-control--after--BorderBottomColor: transparent !important;
  --pf-v5-c-form-control--after--BorderLeftColor: transparent !important;
  --pf-v5-c-form-control--before--BorderColor: transparent !important;
  --pf-v5-c-form-control--after--BorderColor: transparent !important;
  --pf-v5-c-helper-text__item-text--Color
  border-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}
/* Also remove borders from the input itself */
.pf-v5-c-form-control input,
.pf-v5-c-form-control input:hover,
.pf-v5-c-form-control input:focus,
.pf-v5-c-form-control input:focus-visible,
.pf-v5-c-form-control input:active {
  border-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}


.pf-v5-c-helper-text__item.pf-m-error {
   --pf-v5-c-helper-text__item-text--Color: #da4236 !important;
   font-weight: bold;

}

/* Hide only the "Or sign in with" text, not the Register link */
.pf-v5-c-login__main-footer > .pf-v5-c-login__main-footer-band:first-of-type > span {
    display: none !important;
}

#kc-form-buttons input[type="submit"] {
    margin-top: 20px;
}
#kc-form-buttons {
    background-color: #da4236 !important;
    border-color: #da4236 !important;
    color: #ffffff !important;
}

/* SAML button styled like Google */
#social-saml {
    background-color: #ffffff !important;
    border: 1px solid #dadce0 !important;
    color: #3c4043 !important;

    position: relative;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Resize SAML icon */
#social-saml svg {
    width: 20px !important;
    height: 20px !important;
    position: absolute;
    left: 15px;
}

#social-saml span {
    margin: 0 auto;
}

#social-saml:hover {
    background-color: #f7f7f7 !important;
    border-color: #c6c6c6 !important;
}

/* Apply to all social buttons */
#kc-social-providers a {
    background-color: #ffffff !important;
    border: 1px solid #dadce0 !important;
    color: #3c4043 !important;

    position: relative;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Icons */
#kc-social-providers a svg {
    width: 20px;
    height: 20px;
    position: absolute;
    left: 15px;
}

/* Hover */
#kc-social-providers a:hover {
    background-color: #f7f7f7 !important;
}

input[type="submit"].pf-v5-c-button,
button.pf-v5-c-button[type="submit"],
#kc-form-buttons,
#kc-form-buttons input[type="submit"] {
    border-radius: 8px !important;
}

/* Ensure New user / Register link is visible */
#kc-info,
#kc-info-wrapper,
#kc-registration-container,
#kc-registration {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#kc-registration a {
    display: inline !important;
    color: #cd9600 !important;
}
