/* ==========================================================================
   CHARTE GRAPHIQUE GLOBALE : BLEU SOMBRE & OR ÉLÉGANT
   ========================================================================== */

html {
    overflow-x: hidden;
    height: 100%;
}

body { 
    /* La police Sansation est chargée via Google Fonts dans le fichier HTML */
    font-family: 'Sansation', 'Segoe UI', Arial, sans-serif; 
    margin: 0; 
    padding: 0; 
    background-color: #0a1128; /* Bleu nuit très sombre */
    color: #e2e8f0; /* Blanc cassé pour une lecture confortable */
    line-height: 1.6;
    overflow-x: hidden; /* Empêche l'ascenseur horizontal (ex: bandeau vidéo en 100vw) */
    width: 100%;
    min-height: 100%;
    /* Mise en page "sticky footer" : header + main + footer empilés,
       main s'étire pour occuper l'espace restant, le footer reste en bas
       même si le contenu d'une page (incluse via /pages) est très court. */
    display: flex;
    flex-direction: column;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background-color: #000714; /* Fond encore plus sombre pour le header */
    border-bottom: 2px solid #c5a880; /* Ligne fine couleur Or satiné */
    position: relative;
    z-index: 10; /* S'assure que le menu reste au-dessus de la vidéo */
    flex-shrink: 0;
}

header .logo img { 
    height: 60px; 
    filter: brightness(1.2); /* Ajuste la luminosité du logo */
}

nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    gap: 30px;
}

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

nav a { 
    margin-left: 25px; 
    text-decoration: none; 
    color: #c5a880; /* Couleur Or */
    font-weight: 700; /* Utilise la graisse "Bold" de Sansation */
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

nav a:hover { 
    color: #e6c699; /* Or plus clair au survol */
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #c5a880;
    cursor: pointer;
    padding: 6px;
    align-items: center;
    justify-content: center;
}

.nav-toggle svg {
    pointer-events: none;
}
.nav-admin {
    display: flex;
    align-items: center;
}

.nav-admin-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #c5a880;
    border: 1px solid transparent;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.nav-admin-logout:hover {
    background-color: #1c2d5a;
    color: #e6c699;
    border-color: #c5a880;
}

.nav-admin-logout svg {
    pointer-events: none;
}

/* ==========================================================================
   CONTENEUR PRINCIPAL
   ========================================================================== */

main { 
    flex: 1 0 auto; /* Occupe tout l'espace restant entre le header et le footer */
    width: 100%;
    padding: 60px 50px; 
    max-width: 1100px; 
    margin: 0 auto; 
}

h2, h3 { 
    color: #c5a880; /* Titres en Or */
    font-weight: normal;
    letter-spacing: 0.5px;
}

h2 { 
    font-size: 1.8rem; 
    border-bottom: 1px solid #1c2d5a; 
    padding-bottom: 10px; 
    margin-top: 50px; 
    position: relative;
    z-index: 2;
}

/* ==========================================================================
   SECTION HERO VIDÉO (Titre + Sous-titre sur fond vidéo)
   ========================================================================== */

.video-banner-container {
    position: relative;
    /* Force le plein écran horizontal malgré la restriction de <main> */
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    
    /* Compense le padding-top de 60px de <main> pour coller exactement sous le header */
    margin-top: -60px; 
    
    /* Hauteur dynamique : 75% de la hauteur de l'écran du visiteur */
    height: 75vh; 
    min-height: 500px;
    
    overflow: hidden;
    margin-bottom: 60px;
    background-color: #000714;
    
    /* Découpe diagonale (légèrement adoucie pour les grandes hauteurs) */
    clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
    
    /* Flexbox pour centrer le texte à l'intérieur */
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Voile sombre pour garantir la lisibilité du texte (plus foncé en bas) */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(10, 17, 40, 0.4) 0%, rgba(10, 17, 40, 0.8) 100%);
    z-index: 2;
}

/* Textes sur la vidéo */
.hero-content {
    position: relative;
    z-index: 3; /* Oblige le texte à rester au-dessus de l'overlay et de la vidéo */
    text-align: center;
    max-width: 900px;
    padding: 0 40px;
    /* On remonte un peu le texte pour compenser visuellement la diagonale du bas */
    transform: translateY(-20px); 
}

.hero-content h1 {
    color: #e2e8f0; /* Reste du mot en blanc cassé */
    font-size: 3.5rem; 
    margin-top: 0;
    margin-bottom: 20px;
    /* Ombre portée élégante pour détacher le titre de la vidéo */
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.6); 
    font-weight: normal;
}

/* Chaque ligne du titre (ligne1 à ligne4 dans index.xml) occupe sa propre ligne */
.hero-content h1 .hero-title-line {
    display: block;
}

/* Première lettre de chaque mot du titre, en Or */
.hero-content h1 .title-initial {
    color: #c5a880;
}

.hero-content .intro {
    color: #e2e8f0;
    font-size: 1.4rem;
    font-style: italic;
    margin: 0 auto;
    line-height: 1.6;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   GRILLE DE L'ÉQUIPE
   ========================================================================== */

.team-grid { 
    display: flex; 
    gap: 30px; 
    margin-top: 30px; 
}

.team-member { 
    background: #111e38; /* Bleu un peu plus clair pour détacher les cartes */
    padding: 30px; 
    border-radius: 4px; 
    flex: 1; 
    border: 1px solid #1c2d5a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.team-member h3 { 
    margin-top: 0; 
    color: #e2e8f0; 
}

/* Stylisation du rôle sous le nom */
.team-member h3 span { 
    color: #c5a880;
    font-size: 0.9rem;
    text-transform: uppercase;
    display: block;
    margin-top: 5px;
}

/* Stylisation des initiales en gras (générées par PHP) */
.team-member h3 strong {
    color: #c5a880; /* Optionnel : mettre les initiales en or également */
    font-weight: 700;
}

/* Petite présentation facultative (<desc> dans index.xml) */
.team-member-desc {
    color: #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-top: 12px;
}

.team-member-desc p {
    margin: 0 0 8px 0;
}

.team-member-desc a {
    color: #c5a880;
}

/* Photo du membre de l'équipe */
.team-member-photo {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #1c2d5a;
}

.team-member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ==========================================================================
   GALERIE PHOTOS
   ========================================================================== */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.gallery-item {
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #1c2d5a;
    aspect-ratio: 4 / 3;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* ==========================================================================
   CONTACT
   ========================================================================== */

.contact-section {
    margin-top: 30px;
    text-align: center;
    background: #111e38;
    border: 1px solid #1c2d5a;
    border-radius: 4px;
    padding: 40px;
}

.contact-section p {
    margin: 0 0 20px 0;
    color: #e2e8f0;
    font-size: 1.1rem;
}

.btn-contact-mail {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    background: #c5a880;
    color: #0a1128;
    padding: 12px 28px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: background 0.3s ease;
}

.btn-contact-mail:hover {
    background: #e6c699;
}

/* ==========================================================================
   CARTES "COMPÉTENCES" / "LABORATOIRES PARTENAIRES"
   ========================================================================== */

.feature-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 30px;
}

.section-intro {
    margin-top: 20px;
    color: #e2e8f0;
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 800px;
}

.section-intro p {
    margin: 0 0 10px 0;
}

.section-intro a {
    color: #c5a880;
}

.feature-card {
    display: flex;
    align-items: stretch;
    gap: 30px;
    background: #111e38;
    border: 1px solid #1c2d5a;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.feature-card:nth-child(even) {
    flex-direction: row-reverse;
}

.feature-card-photo {
    flex: 0 0 280px;
    overflow: hidden;
}

.feature-card-photo img {
    width: 100%;
    height: 100%;
    min-height: 200px;
    object-fit: cover;
    display: block;
}

.feature-card-content {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.feature-card-content h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #e2e8f0;
}

.feature-card-text {
    color: #e2e8f0;
    line-height: 1.6;
}

.feature-card-text p {
    margin: 0 0 10px 0;
}

.feature-card-text ul {
    margin: 10px 0;
    padding-left: 20px;
    list-style: disc;
}

.feature-card-text li {
    padding: 4px 0;
    border-bottom: none;
}

.feature-card-text a {
    color: #c5a880;
}

.btn-feature-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    text-decoration: none;
    background: #c5a880;
    color: #0a1128;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: background 0.3s ease;
    align-self: flex-start;
}

.btn-feature-link:hover {
    background: #e6c699;
}

/* ==========================================================================
   EN CAS D'URGENCE
   ========================================================================== */

.urgency-section {
    margin-top: 30px;
    background: #1c2d5a;
    border-left: 4px solid #c5a880;
    border-radius: 4px;
    padding: 30px 40px;
}

.urgency-text {
    color: #e2e8f0;
    line-height: 1.7;
    font-size: 1.05rem;
}

.urgency-text p {
    margin: 0 0 10px 0;
}

.urgency-text ul {
    margin: 10px 0;
    padding-left: 20px;
    list-style: disc;
}

.urgency-text li {
    padding: 4px 0;
    border-bottom: none;
}

.urgency-text a {
    color: #c5a880;
}

/* ==========================================================================
   LISTE HORAIRES
   ========================================================================== */

ul {
    list-style: none;
    padding: 0;
}

li {
    padding: 10px 0;
    border-bottom: 1px solid #1c2d5a;
}

/* ==========================================================================
   MODAL DE SÉCURITÉ (Professionnels de santé)
   ========================================================================== */

.modal {
    display: none; 
    position: fixed; 
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 7, 20, 0.85); /* Fond transparent sombre */
    align-items: center; 
    justify-content: center; 
    z-index: 1000;
}

.modal-content {
    background: #111e38; 
    padding: 40px; 
    border-radius: 4px; 
    text-align: center; 
    max-width: 450px;
    border: 2px solid #c5a880; /* Bordure Or */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-content h2 {
    margin-top: 0;
    border-bottom: none;
}

.modal-actions { 
    margin-top: 30px; 
    display: flex; 
    justify-content: space-around; 
}

/* ==========================================================================
   BOUTONS
   ==========================================================================
   
   /* Bouton Valider (Couleur Or) */
.btn-confirm {
    flex: 1;
    background: #c5a880;
    color: #0a1128;
    padding: 12px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.3s ease;
}

.btn-confirm:hover {
    background: #e6c699;
}

/* Bouton Annuler (Couleur Bleu sombre) */
.btn-cancel {
    flex: 1;
    background: #1c2d5a;
    color: #94a3b8;
    padding: 12px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.3s ease;
}

.btn-cancel:hover {
    background: #283e7c;
    color: #fff;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
    width: 100%;
    padding: 40px 50px;
    background-color: #000714; /* Même fond sombre que le header */
    border-top: 2px solid #c5a880; /* Ligne fine couleur Or satiné, en écho au header */
    margin-top: 60px;
    flex-shrink: 0;
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
}

.footer-copyright {
    margin: 0;
    font-size: 0.9rem;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

.btn-admin-access {
    font-family: inherit;
    font-size: 0.85rem;
    color: #c5a880;
    background: none;
    border: 1px solid #c5a880;
    border-radius: 20px;
    padding: 8px 22px;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-admin-access:hover {
    background-color: #c5a880;
    color: #0a1128;
}

/* ==========================================================================
   MODAL ADMIN - Formulaire de connexion
   ========================================================================== */

.admin-login-error {
    background-color: rgba(197, 60, 60, 0.15);
    color: #e08a8a;
    border: 1px solid rgba(224, 138, 138, 0.5);
    border-radius: 4px;
    padding: 10px 15px;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ==========================================================================
   ACCÈS PROTÉGÉ (page du menu verrouillée par mot de passe)
   ========================================================================== */

.page-lock-section {
    margin: 60px auto;
    max-width: 480px;
    text-align: center;
    background: #111e38;
    border: 1px solid #1c2d5a;
    border-radius: 4px;
    padding: 40px;
}

.page-lock-section h1 {
    color: #c5a880;
    font-size: 1.8rem;
    font-weight: normal;
    margin-top: 0;
    border-bottom: none;
}

.page-lock-section p {
    color: #e2e8f0;
    margin-bottom: 25px;
}

.page-lock-form .form-group {
    margin-bottom: 18px;
    text-align: left;
}

.page-lock-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

.page-lock-form .form-group input {
    width: 100%;
    padding: 10px 12px;
    background-color: #0a1128;
    border: 1px solid #1c2d5a;
    border-radius: 4px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.page-lock-form .form-group input:focus {
    outline: none;
    border-color: #c5a880;
}

.page-lock-form .btn-confirm {
    width: 100%;
}

#adminModal .form-group {
    margin-bottom: 18px;
    text-align: left;
}

#adminModal .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

#adminModal .form-group input {
    width: 100%;
    padding: 10px 12px;
    background-color: #0a1128;
    border: 1px solid #1c2d5a;
    border-radius: 4px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

#adminModal .form-group input:focus {
    outline: none;
    border-color: #c5a880;
}

/* ==========================================================================
   RESPONSIVE MOBILE
   ========================================================================== */
@media (max-width: 768px) {
    header {
        padding: 15px 20px;
        flex-wrap: wrap;
    }

    header .logo img {
        height: 42px;
    }

    /* La nav devient une barre qui peut passer à la ligne : 
       [logo] ... [icône admin] [hamburger]
       puis en dessous, les liens repliés en pleine largeur */
    nav {
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-toggle {
        display: flex;
        order: 3;
    }

    .nav-admin {
        order: 2;
    }

    /* Menu replié par défaut, affiché en pleine largeur sous le header quand ouvert */
    .nav-links {
        display: none;
        order: 4;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        margin-top: 10px;
        padding-top: 15px;
        border-top: 1px solid #1c2d5a;
    }

    .nav-links.nav-links-open {
        display: flex;
    }

    .nav-links a {
        margin-left: 0;
        padding: 10px 0;
        width: 100%;
    }

    /* CONTENU PRINCIPAL */
    main {
        padding: 30px 20px;
    }

    h2 {
        font-size: 1.4rem;
        margin-top: 35px;
    }

    /* BANDEAU VIDÉO */
    .video-banner-container {
        height: 55vh;
        min-height: 320px;
        margin-top: -30px;
        margin-bottom: 35px;
        clip-path: polygon(0 0, 100% 0, 100% 94%, 0 100%);
    }

    .hero-content {
        padding: 0 20px;
        transform: translateY(-10px);
    }

    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: 12px;
    }

    .hero-content .intro {
        font-size: 1.05rem;
    }

    /* ÉQUIPE : les cartes passent en colonne */
    .team-grid {
        flex-direction: column;
        gap: 20px;
        margin-top: 20px;
    }

    .team-member {
        padding: 20px;
    }

    /* MODALES : marges latérales pour ne pas toucher les bords */
    .modal-content {
        max-width: calc(100vw - 40px);
        padding: 30px 20px;
        box-sizing: border-box;
    }

    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }

    /* CARTES COMPÉTENCES / LABORATOIRES */
    .feature-card,
    .feature-card:nth-child(even) {
        flex-direction: column;
    }

    .feature-card-photo {
        flex: 0 0 auto;
        aspect-ratio: 16 / 9;
    }

    .feature-card-content {
        padding: 20px;
    }

    /* URGENCE */
    .urgency-section {
        padding: 20px;
    }

    /* GALERIE & CONTACT */
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }

    .contact-section {
        padding: 25px 20px;
    }

    /* FOOTER */
    .site-footer {
        padding: 30px 20px;
    }
}