@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- 1. FOND DE PAGE ET LOGO --- */
body {
    background: url('../img/bg.jpg') no-repeat center center fixed !important;
    background-size: cover !important;
    position: relative;
    z-index: 0;
    font-family: 'Inter', sans-serif !important;
}
#kc-header {
    margin-bottom: 32px;
}

header {
    display: none !important;
}

h1 {
    font-size: 20px;
    text-align: center;
    margin: 0 0 20px 0;
    font-weight: 500;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85); /* Un voile blanc semi-transparent */
    z-index: -1; /* Pour rester derrière le formulaire */
}

#kc-header-wrapper {
    background: url('../img/logo.png') no-repeat center bottom;
    background-size: contain;
    color: transparent !important;
    height: 80px;
    margin-bottom: 0;
    font-size: 0;
}

#kc-form {
    background-color: #fff;
    box-shadow: rgba(0, 0, 0, 0.2) 0 4px 6px -4px;
    border-radius: 8px;
    padding: 24px 48px;
}

#kc-info {
    background-color: #fff;
    box-shadow: rgba(0, 0, 0, 0.2) 0 4px 6px -4px;
    border-radius: 8px;
    padding: 24px 48px;
    margin-top: 12px;
}

/* --- 2. STRUCTURE DES BOÎTES --- */
.login-pf-page {
    max-width: 480px;
    margin: auto;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* On annule la grande boîte par défaut de Keycloak */
.pf-c-login__main, .card-pf {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* On cache le footer de base puisqu'on a fait nos propres liens */
.pf-c-login__main-footer {
    display: none !important;
}

/* Marges internes de la première boîte */
.pf-c-login__main-body {
    padding: 2.5rem 3rem !important;
    margin-bottom: 15px; /* L'espace entre les deux boîtes */
}

/* --- 3. CONTENU (Titre, Formulaire, Liens) --- */
.custom-title {
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 1.5rem;
}

.custom-form-group {
    margin-bottom: 0;
}

.custom-input {
    width: 100%;
    padding: 8px 12px;
    border: 0px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.95rem;
    box-sizing: border-box; /* Assure que le padding ne dépasse pas */
    outline: 1px solid #d1d5dc;
}

/* 1. On supprime l'espace sous le premier wrapper pour coller les deux champs */
.custom-form-group:not(#kc-form-buttons):first-of-type {
    margin-bottom: 0 !important;
}

/* 2. Le premier input (Email) : Arrondi en haut, plat en bas */
.custom-form-group:not(#kc-form-buttons):first-of-type .custom-input {
    border-radius: 4px 4px 0 0 !important;
}

/* 3. Le dernier input avant les boutons (Mot de passe) : Plat en haut, arrondi en bas */
.custom-form-group:not(#kc-form-buttons):nth-of-type(2) .custom-input {
    border-radius: 0 0 4px 4px !important;
    border-top: none !important; /* Évite d'avoir une bordure 2x plus épaisse au centre */
}

/* 4. On rajoute un peu d'air au-dessus du bouton pour compenser */
#kc-form-buttons.custom-form-group {
    margin-top: 15px !important;
}
.custom-input::placeholder {
    color: #999;
}

.custom-button {
    width: 100%;
    padding: 8px 12px;
    background-color: #1a56ff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

.custom-button:hover {
    background-color: #0b40d0;
}

/* Les petits textes sous le bouton */
.custom-links {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin-top: 10px;
    line-height: 1.5;
}

.custom-links a {
    color: #1a56ff;
    text-decoration: none;
    font-weight: 600;
}

.kc_lost_block {
    margin-top: 15px;
}


.pf-c-alert.pf-m-inline {
    margin-bottom: 15px;
    border-radius: 8px;
    border: 0 !important;
}

/* --- 4. LA DEUXIÈME BOÎTE --- */
.custom-events-box {
    text-align: center;
}

.custom-events-box a {
    color: #1a56ff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}