/* --- IMTBS-TSP Theme pour CAS 7.3 --- */

:root {
    --cas-theme-primary: #006d85;
    --mdc-theme-primary: #006d85;
}

body {
    background-color: #f5f5f5 !important;
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
}

/* 1. Masquer l'interface par défaut de CAS */
header#app-bar,
.mdc-top-app-bar,
aside#app-drawer {
    display: none !important;
}

.mdc-drawer-app-content.mdc-top-app-bar--fixed-adjust {
    padding-top: 50px !important; /* Espace en haut de la page */
    background-color: transparent !important;
}

/* Enlever l'image de fond globale de CAS 7 */
.bgimage {
    background-image: none !important;
}

/* 2. Le conteneur central (englobe Header + Boite de login) */
.imtbs-wrapper {
    width: 100%;
    max-width: 980px; /* La largeur exacte de la boîte de CAS 6 */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* 3. Le Header IMTBS */
.imtbs-header {
    position: relative;
    width: 100%;
    height: 287px;
    background: #ffffff url('/cas/images/fd_header-fd23feef7e4b9ec5971364355b9d2e15.png') top center no-repeat;
    /* On force l'image à couvrir toute la largeur de sa boîte de 980px */
    background-size: cover; 
    border: 1px solid #9db0bc;
    border-bottom: none;
    border-radius: 8px 8px 0 0; /* Coins arrondis en haut */
}

/* 4. Le Logo géant (réduit et positionné) */
.imtbs-header .logo {
    position: absolute;
    /* On lui donne une taille d'affichage contrainte (ex: 300x150) */
    width: 300px;
    height: 150px; 
    top: 50%;
    transform: translateY(-50%);
    right: 40px; /* Marge à droite */
    /* On utilise la nouvelle image */
    background: transparent url('/cas/images/Co-logos_IMT-BS_-_TSP_-_2024-d0916f22d07d810e9bfe9062c519ce70.png') right center no-repeat;
    /* Contain permet à l'image 2048x1021 de rentrer entièrement dans la div 300x150 sans être coupée */
    background-size: contain; 
}

/* 5. La boîte de connexion (CAS Main) */
#main-content {
    padding: 0 !important;
    margin: 0 auto !important; /* Centrage absolu */
    max-width: 980px !important; /* Exactement la taille du header */
    width: 100% !important;
}

.login-section, .mdc-card {
    background-color: white !important;
    border-radius: 0 0 8px 8px !important; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.1), 0 6px 6px rgba(0,0,0,0.1) !important;
    border: 1px solid #9db0bc !important;
    border-top: none !important;
    margin: 0 auto !important; /* Force le centrage de la carte */
    width: 100% !important;
    max-width: 980px !important;
}

/* On force la suppression des marges Bootstrap cachées */
.container-lg, .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

a { color: var(--cas-theme-primary); }
a:hover { color: #008ba8; }

/* Responsive (Mobile) */
@media screen and (max-width: 768px) {
    .imtbs-wrapper {
        max-width: 95%;
    }
    .imtbs-header {
        height: 150px;
        background: #ffffff url('/cas/images/smallbkgrd-18898f8762c639c08f5db0584a22ebb7.png') top center no-repeat;
        background-size: cover;
    }
    .imtbs-header .logo { 
        width: 150px; /* Logo plus petit sur mobile */
        height: 80px;
        right: 10px;
    }
}

