/* CSS Keycloak adapté pour ressembler exactement au visuel souhaité */

/* === RESET ET BASE === */
* :not(.fa, .fas, .far, .fab, .ui-icon, .fc-icon) {
    font-family: "Lato", sans-serif !important;
}

/* === LAYOUT PRINCIPAL === */
.login-pf {
    background: none;
    height: 100vh;
    padding-bottom: 0;
    background-color: #F8F8FB;
}

.wrapper {
    background: url("../img/login-page-user.jpg"), url("../belfort_images/login-page-user.jpg") no-repeat !important;
    background-size: 65% 100% !important;
    background-position: center right !important;
    height: 100vh;
    min-height: 100vh;
}

/* === HEADER ET LOGO === */
#kc-header-wrapper {
    background-image: url(../belfort_images/logo-citoyen.png);
    background-size: auto 100px;
    background-position: 20px 20px;
    height: 170px;
    background-color: transparent;
    background-repeat: no-repeat;
    box-shadow: none;
    padding-left: 50px;
    margin-top: 0;
    margin-bottom: 20;
    width: 100%;
}

/* === CARTE PRINCIPALE === */
.login-pf-page {
    height: 100vh;
    display: flex;
    align-items: center;
}

.card-pf {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.16);
    padding: 40px;
    max-width: none;
    width: 35%;
    height: 100vh;
    margin: 0;
    border-top: none;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 0;
}

.login-pf .container {
    padding: 0;
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
}

/* === TITRE === */
.login-pf-header {
    display: none;
}

h1#kc-page-title,
.login-pf-header h1,
#kc-page-title {
    display: none !important;
}

/* === LABELS DES CHAMPS === */
.pf-c-form__label-text,
#kc-form-login div > label {
    font-weight: 700;
    color: #000 !important;
    font-size: 18px !important;
    margin-bottom: 8px;
    display: block;
}

/* === CHAMPS DE SAISIE === */
.pf-c-form-control,
.egoTextFieldGuidgetStyle,
.egoPasswordGuidgetStyle,
#username,
#password {
    border: 1px solid #5A5A5A !important;
    border-radius: 0 !important;
    height: 63px !important;
    color: #707070 !important;
    font-size: 18px !important;
    line-height: 1.1 !important;
    padding: 0 15px !important;
    width: 100% !important;
    background-color: #fff !important;
}

.pf-c-form-control:focus,
.egoTextFieldGuidgetStyle:focus,
.egoPasswordGuidgetStyle:focus,
#username:focus,
#password:focus {
    border-color: #7a1483 !important;
    outline: none !important;
    box-shadow: none !important;
}

.pf-c-form-control:hover,
.egoTextFieldGuidgetStyle:hover,
.egoPasswordGuidgetStyle:hover,
#username:hover,
#password:hover {
    border-color: #7a1483 !important;
}

/* === CONTENEURS DES CHAMPS === */
.form-group {
    margin-bottom: 20px;
}

.egoContainerTableStyle {
    position: relative;
}

/* === ICÔNE TOGGLE PASSWORD === */
.togglePassword,
i#togglePasswordOfMotDePasse_champcalcule4_5Qws {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #7a1483 !important;
    cursor: pointer;
    font-size: 18px;
    z-index: 3;
}
.togglePassword,
i#togglePasswordOfMotDePasse_champcalcule4_5Qws::before {
    color: white !important;
}

/* === BOUTON PRINCIPAL === */
#kc-login,
.pf-c-button.pf-m-primary,
input[name="login"],
input[type="submit"][name="login"] {
    background-color: #7a1483 !important;
    border: none !important;
    border-radius: 0 !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    height: 48px !important;
    padding: 0 32px !important;
    text-transform: uppercase !important;
    width: 100% !important;
    cursor: pointer;
    margin-top: 20px;
    display: block !important;
    visibility: visible !important;
}

#kc-login:hover,
.pf-c-button.pf-m-primary:hover,
input[name="login"]:hover {
    background-color: #550E5C !important;
    color: #fff !important;
}

/* === LIENS === */
a {
    color: #7a1483 !important;
    font-size: 16px !important;
    text-decoration: underline;
}

a:hover {
    color: #550E5C !important;
    text-decoration: none;
}

.login-pf a:hover {
    color: #550E5C !important;
}

/* === FOOTER === */
#ecitizFooterWrapper,
footer[role="contentinfo"],
#credits,
.login-pf-page footer {
    display: none !important;
}

.wrapper::after,
.login-pf::after {
    display: none !important;
}

/* === ICÔNES FONT AWESOME === */
.fa::before,
.fa-eye::before,
.fas::before,
.far::before {
    color: #7a1483 !important;
}

/* === CONTENU CENTRÉ === */
#kc-content {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 40px;
}

#kc-content-wrapper {
    margin-top: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

#kc-form-wrapper {
    margin-top: 0;
    width: 100%;
}

/* === RESPONSIVE === */
@media (max-width: 767px) {
    .wrapper {
        background: none !important; /* Suppression complète de l'image de fond sur mobile */
        background-color: #ffffff !important;
    }
    
    .card-pf {
        max-width: none;
        margin: 0 !important; /* Suppression des marges */
        padding: 20px !important;
        border-radius: 0 !important;
        width: 100% !important; /* Largeur complète sur mobile */
        height: 100vh !important;
        position: relative !important; /* Pas de position fixed sur mobile */
        left: auto !important;
        top: auto !important;
    }
    
    .login-pf .container {
        padding: 0 !important;
        height: 100vh !important;
        min-height: 100vh !important;
    }
    
    .login-pf-page {
        padding: 0 !important;
        height: 100vh !important;
    }
    
    #kc-header-wrapper {
        background-size: auto 50px;
        background-position: center 10px;
        height: 80px;
    }
    
    #kc-content {
        padding: 20px !important;
        max-width: none !important;
        width: 100% !important;
    }
    
    /* Liens sur mobile : permettre le retour à la ligne */
    #kc-registration a,
    .login-pf-signup a,
    .login-pf-settings a {
        white-space: normal !important; /* Autoriser le retour à la ligne sur mobile */
        overflow: visible !important;
        text-overflow: clip !important;
        font-size: 14px !important; /* Taille plus petite sur mobile */
    }
}

@media (min-width: 768px) {
    .login-pf .container {
        padding-right: 0;
    }
    
    .card-pf {
        width: 35% !important;
        height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        position: fixed;
        left: 0;
        top: 0;
    }
    
    .wrapper {
        background-position: right center !important;
        background-size: 65% 100vh !important;
    }
}

/* === CORRECTIONS SPÉCIFIQUES === */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

.pf-c-form-control:focus-visible,
#username:focus-visible,
#password:focus-visible {
    border-color: #7a1483 !important;
    outline: 2px solid #7a1483 !important;
    outline-offset: 2px;
}

.login-pf-page-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.login-pf-page {
    padding-bottom: 0;
    margin-bottom: 0;
}

.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-pf-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 50px;
    padding-right: 50px;
}

/* === LIENS APRÈS LE BOUTON === */
/* Approche simple pour les liens */
#kc-registration,
.login-pf-signup,
.login-pf-settings {
    margin-top: 20px;
}

#kc-registration a,
.login-pf-signup a,
.login-pf-settings a {
    display: block !important;
    margin: 10px 0 !important;
    color: #7a1483 !important;
    text-decoration: underline !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    white-space: nowrap !important; /* Empêcher le retour à la ligne dans les liens */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

#kc-registration a:hover,
.login-pf-signup a:hover,
.login-pf-settings a:hover {
    color: #550E5C !important;
    text-decoration: none !important;
}