/* I-PMO — feuille de style de l'écran d'accueil
 *
 * Toutes les dimensions verticales sont exprimées en fraction de la hauteur
 * de la fenêtre (vh) : la page tient toujours dans l'écran, sans défilement.
 */

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

html,
body {
    height: 100%;
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #dde3eb;
    color: #1f2937;
    font-family: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Bandeau supérieur ---------- */

.bandeau {
    flex-shrink: 0;
}

.bandeau-bleu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 7vh;
    min-height: 44px;
    padding: 0 18px;
    background: linear-gradient(90deg, #17325c, #1d4f91);
    color: #fff;
    position: relative;
    z-index: 10;
}

.titre {
    margin: 0;
    font-family: "Segoe UI", Montserrat, Arial, sans-serif;
    font-size: clamp(16px, 2.6vh, 20px);
    font-weight: 600;
    letter-spacing: 0.2px;
}

.compte {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.compte-identite {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.25;
    min-width: 0;
}

.compte-nom {
    font-size: clamp(12px, 1.7vh, 13px);
    font-weight: 600;
    white-space: nowrap;
}

.compte-fonction {
    font-size: 11px;
    opacity: 0.75;
    white-space: nowrap;
}

.deconnexion {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 6px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.deconnexion:hover,
.deconnexion:focus-visible {
    background: rgba(255, 255, 255, 0.18);
}

.bandeau-gris {
    height: 5vh;
    min-height: 30px;
    border-bottom: 1px solid #dde3ec;
    background: #fff;
    color: #334155;
}

.indicateurs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 2.4vw, 34px);
    margin: 0;
    padding: 0 12px;
    list-style: none;
    color: #475569;
    font-size: clamp(11px, 1.6vh, 12.5px);
    white-space: nowrap;
    overflow: hidden;
}

.indicateurs strong {
    display: inline-block;
    min-width: 1.9em;
    margin-right: 0.3em;
    padding: 0.1em 0.45em;
    border-radius: 999px;
    background: #eaf1fb;
    color: #1d4f91;
    font-weight: 600;
    text-align: center;
}

.indicateurs .alerte strong {
    background: #fee2e2;
    color: #b91c1c;
}

/* ---------- Menu déroulant du bandeau ---------- */

.menu-deroulant {
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
}

.menu-bouton {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.menu-bouton::after {
    content: "";
    border: 5px solid transparent;
    border-top-color: currentColor;
    border-bottom-width: 0;
    transition: transform 0.25s;
}

.menu-deroulant:hover .menu-bouton,
.menu-deroulant:focus-within .menu-bouton {
    background: rgba(255, 255, 255, 0.28);
}

.menu-deroulant:hover .menu-bouton::after,
.menu-deroulant:focus-within .menu-bouton::after {
    transform: rotate(180deg);
}

/* Bouton rond « + » du menu Projets (accueil) */
.menu-bouton.menu-plus {
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
}
.menu-bouton.menu-plus::after { display: none; }
.menu-plus span { display: block; margin-top: -2px; transition: transform 0.25s; }
.menu-deroulant:hover .menu-plus span,
.menu-deroulant:focus-within .menu-plus span { transform: rotate(45deg); }

.menu-liste {
    position: absolute;
    top: 100%;
    left: 50%;
    min-width: 210px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    border-radius: 0 0 8px 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    /* Fermé : replié vers le haut */
    transform: translateX(-50%) scaleY(0);
    transform-origin: top center;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s ease, opacity 0.2s ease, visibility 0s 0.25s;
}

.menu-deroulant:hover .menu-liste,
.menu-deroulant:focus-within .menu-liste {
    transform: translateX(-50%) scaleY(1);
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.menu-liste a {
    display: block;
    padding: 9px 18px;
    border-left: 3px solid transparent;
    color: #1f2937;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s, padding-left 0.15s, border-color 0.15s;
}

.menu-liste a:hover,
.menu-liste a:focus-visible,
.menu-liste a[aria-current="page"] {
    padding-left: 24px;
    border-left-color: #2563eb;
    background: #eaf1fb;
    color: #1d4f91;
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    .tuile,
    .pastille,
    .libelle,
    .menu-liste,
    .menu-liste a,
    .menu-bouton::after {
        transition: none;
    }

    .tuile:hover,
    .tuile:hover .pastille,
    .tuile:focus-visible,
    .tuile:focus-visible .pastille {
        transform: none;
    }
}

/* ---------- Contenu ---------- */

.accueil {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2vh;
    padding: 1vh 16px;
}

/* ---------- Logo ---------- */

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.logo svg {
    height: 19vh;
    width: auto;
    aspect-ratio: 240 / 200;
}

.logo-nom {
    font-family: "Segoe UI", Montserrat, Arial, sans-serif;
    font-size: clamp(16px, 3.2vh, 26px);
    letter-spacing: 1px;
    line-height: 1;
    font-weight: 300;
}

.logo-nom strong {
    font-weight: 900;
}

.logo-slogan {
    font-family: "Segoe UI", Montserrat, Arial, sans-serif;
    font-size: clamp(11px, 1.8vh, 15px);
    font-style: italic;
    color: #94a3b8;
    letter-spacing: 1px;
}

/* ---------- Grille des modules ---------- */

.grille {
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 1vh 2.5vh;
}

.tuile {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 17vh;
    max-width: 23vw;
    padding: 1vh 0.5vh;
    border-radius: 8px;
    border: 1px solid transparent;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}

.tuile:hover,
.tuile:focus-visible {
    background: #fff;
    border-color: #c9dbf5;
    box-shadow: 0 6px 18px rgba(29, 79, 145, 0.12);
    outline: none;
    transform: translateY(-0.5vh);
}

.tuile:hover .pastille,
.tuile:focus-visible .pastille {
    transform: scale(1.14) rotate(-4deg);
    filter: drop-shadow(0 0.8vh 1vh rgba(0, 0, 0, 0.28));
}

.tuile:hover .libelle,
.tuile:focus-visible .libelle {
    color: #1d4f91;
}

.tuile:active .pastille {
    transform: scale(0.96);
}

.pastille {
    display: block;
    width: 10.5vh;
    height: 10.5vh;
    max-width: 18vw;
    max-height: 18vw;
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s;
}

.libelle {
    margin-top: 0.6vh;
    font-size: clamp(11px, 1.55vh, 13px);
    font-weight: 500;
    color: #334155;
    line-height: 1.35;
    text-align: center;
    transition: color 0.2s;
}

/* ---------- Page d'un module ---------- */

.module {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.module h2 {
    margin: 2vh 0 1vh;
    font-size: clamp(18px, 3.4vh, 26px);
    font-weight: normal;
}

.module p {
    margin: 0 0 3vh;
    color: #666;
}

.retour {
    padding: 10px 22px;
    border: 1px solid #4a90e2;
    background: linear-gradient(#e3f0ff, #c3defd);
    color: #0a50a8;
    text-decoration: none;
}

.retour:hover,
.retour:focus-visible {
    background: #c3defd;
}

/* ---------- Pied de page ---------- */

.pied {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 4vh;
    min-height: 26px;
    padding: 0 18px;
    border-top: 1px solid #dde3ec;
    background: #fff;
    color: #64748b;
    font-size: 11.5px;
    white-space: nowrap;
}

.en-ligne::before {
    content: "";
    display: inline-block;
    width: 0.7em;
    height: 0.7em;
    margin-right: 0.5em;
    border-radius: 50%;
    background: #2fb14f;
}

/* ---------- Page de connexion ---------- */

.page-connexion {
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px;
    overflow: auto;
    background: linear-gradient(160deg, #1d4f91 0%, #17325c 60%, #0f2342 100%);
}

.carte-connexion {
    width: 100%;
    max-width: 380px;
    padding: 28px 32px 24px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}

.carte-connexion .logo svg {
    height: 110px;
}

.carte-connexion .logo-nom {
    font-size: 24px;
}

.carte-connexion .logo-slogan {
    font-size: 13px;
}

.carte-connexion h1 {
    margin: 20px 0 14px;
    font-family: "Segoe UI", Montserrat, Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    color: #17325c;
}

.carte-connexion label {
    display: block;
    margin: 12px 0 5px;
    font-size: 13px;
    color: #444;
}

.carte-connexion input[type="text"],
.carte-connexion input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #c5cedb;
    border-radius: 6px;
    font: inherit;
    font-size: 13.5px;
}

.carte-connexion input:focus-visible {
    border-color: #0a72d6;
    outline: 3px solid rgba(10, 114, 214, 0.22);
}

.carte-connexion button {
    width: 100%;
    margin-top: 20px;
    padding: 11px;
    border: 0;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}

.carte-connexion button:hover,
.carte-connexion button:focus-visible {
    background: #1d4ed8;
}

.message-erreur {
    margin: 0 0 4px;
    padding: 9px 12px;
    border: 1px solid #f1b5b5;
    border-radius: 6px;
    background: #fdecec;
    color: #a61b1b;
    font-size: 13px;
}

.demo {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 18px;
    padding: 10px 12px;
    border: 1px dashed #e0b74a;
    border-radius: 6px;
    background: #fff8e1;
    color: #6b5310;
    font-size: 12px;
}

.demo strong {
    flex-basis: 100%;
}

.demo code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    font-weight: bold;
    color: #222;
}

.mention-connexion {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
}

/* ---------- Cloche de notifications (bandeau) ---------- */

.bandeau-bleu > .cloche { margin-left: auto; margin-right: -4px; }
.cloche { position: relative; flex-shrink: 0; }
.cloche > summary {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%; cursor: pointer; list-style: none;
    color: #fff; transition: background .15s;
}
.cloche > summary::-webkit-details-marker { display: none; }
.cloche > summary:hover, .cloche[open] > summary { background: rgba(255, 255, 255, .14); }
.cloche > summary:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.cloche svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cloche .pastille-nb {
    position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px;
    border: 2px solid #1d4f91; border-radius: 999px; background: #dc2626; color: #fff;
    font: 600 10px/13px "Segoe UI", system-ui, sans-serif; text-align: center; box-sizing: border-box;
}
.cloche-panneau {
    position: absolute; top: calc(100% + 8px); right: -8px; z-index: 50; width: 380px; max-width: calc(100vw - 24px);
    border: 1px solid #dde3ec; border-radius: 8px; background: #fff; color: #1f2937;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18); font: 13px/1.4 "Segoe UI", system-ui, -apple-system, sans-serif; text-align: left;
}
.cloche-tete { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px; border-bottom: 1px solid #eef1f5; }
.cloche-tete strong { font-size: 13.5px; }
.cloche-tete span { color: #64748b; font-size: 12px; }
.cloche-panneau ul { max-height: 360px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.cloche-panneau li + li { border-top: 1px solid #f1f4f8; }
.cloche-panneau li a { display: flex; gap: 10px; padding: 9px 14px; color: inherit; text-decoration: none; }
.cloche-panneau li a:hover { background: #f5f8fc; }
.cloche-panneau li.lue { opacity: .6; }
.cloche-panneau li b { display: block; font-size: 12.5px; font-weight: 600; }
.cloche-panneau li small { display: block; margin-top: 1px; color: #475569; font-size: 12px; }
.cloche-vide { margin: 0; padding: 22px 14px; color: #64748b; text-align: center; }
.cloche-pied { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 14px; border-top: 1px solid #eef1f5; background: #fafbfd; border-radius: 0 0 8px 8px; }
.cloche-pied a { color: #1d4f91; font-size: 12px; font-weight: 600; text-decoration: none; }
.cloche-pied a:hover { text-decoration: underline; }
.cloche-pied form { margin: 0; }
.cloche-pied button { white-space: nowrap; padding: 0; border: 0; background: none; color: #64748b; font: inherit; font-size: 12px; cursor: pointer; }
.cloche-pied button:hover { color: #1d4f91; text-decoration: underline; }

[class^="niveau-"] { flex-shrink: 0; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; }
.niveau-rouge { background: #dc2626; }
.niveau-jaune { background: #d97706; }
.niveau-bleu  { background: #2563eb; }

/* Page Notifications */
.barre-filtres { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0; }
.barre-filtres .badge { text-decoration: none; }
.barre-filtres .espace { flex: 1; }
.liste-notifications { margin: 0; padding: 0; list-style: none; border: 1px solid #dde3ec; border-radius: 8px; background: #fff; }
.liste-notifications li { display: flex; align-items: flex-start; gap: 12px; padding: 11px 16px; }
.liste-notifications li + li { border-top: 1px solid #eef1f5; }
.liste-notifications li > a { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.liste-notifications li > a:hover b { color: #1d4f91; text-decoration: underline; }
.liste-notifications li b { font-size: 13px; font-weight: 600; }
.liste-notifications li small { display: block; margin-top: 2px; color: #475569; font-size: 12.5px; }
.liste-notifications li.lue { background: #fafbfc; }
.liste-notifications li.lue b, .liste-notifications li.lue small { color: #94a3b8; }
.liste-notifications form { margin: 0; }
@media print { .cloche { display: none; } }

/* Logo compact en haut à gauche du bandeau (toutes les pages) */
.marque-bandeau { display: flex; align-items: center; gap: 8px; flex-shrink: 0; color: #fff; text-decoration: none; padding-right: 14px; margin-right: 2px; border-right: 1px solid rgba(255, 255, 255, .22); }
.marque-icone { display: flex; align-items: center; justify-content: center; width: 34px; height: 30px; background: #fff; padding: 2px 3px; }
.marque-icone svg { width: 100%; height: 100%; }
.marque-nom { font-size: 15px; font-weight: 600; letter-spacing: .3px; white-space: nowrap; }
.marque-nom strong { color: #ff8a8a; }
.marque-bandeau:hover .marque-nom { text-decoration: underline; }
.marque-et-titre { display: flex; align-items: center; gap: 14px; }
@media (max-width: 700px) { .marque-nom { display: none; } .marque-bandeau { padding-right: 10px; } }
