* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    overflow-x: hidden;
    background-image: url('/img/BANDEAU.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
}

#logoFO {
    position: fixed;
    top: 14px;
    right: 14px;
    width: 12%;
    height: auto;
    z-index: 150;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 15.625%;
    height: 100vh;
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    z-index: 50;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
    overflow: hidden;
    background-image: url('/img/MENU.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

.sidebar.hidden { transform: translateX(-15.625vw); }

.sidebar-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}

.sidebar-content {
    position: relative;
    z-index: 2;
    padding: 12px;
    color: white;
    margin-top: 35vh;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1a1a2e;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    padding: 12px 16px;
    transition: background 0.2s, box-shadow 0.2s;
    letter-spacing: 0.3px;
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sidebar-nav-link svg { flex-shrink: 0; width: 20px; height: 20px; }
.sidebar-nav-link:hover { background: rgba(255,255,255,0.92); box-shadow: 0 4px 14px rgba(0,0,0,0.2); }
.sidebar-nav-link.active { background: rgba(255,255,255,0.9); font-weight: 700; }
.sidebar-content nav a:first-child { border-radius: 8px 8px 0 0; }
.sidebar-content nav a:last-child  { border-radius: 0 0 8px 8px; }

.menu-toggle {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 150;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    border: 1px solid rgba(255,255,255,0.35);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: left 0.3s cubic-bezier(.4,0,.2,1), background 0.2s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover { background: rgba(255,255,255,0.28); }
.menu-toggle.menu-hidden  { left: 14px; }
.menu-toggle.menu-visible { left: calc(15.625% + 14px); }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 40;
}
.sidebar-backdrop.visible { display: block; }

.main-content {
    position: relative;
    z-index: 1;
    margin-left: 0;
    padding: 60px 30px 40px;
    transition: margin-left 0.3s cubic-bezier(.4,0,.2,1);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.content-wrapper {
    width: 100%;
    max-width: 740px;
    text-align: center;
}

.page-title {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
    margin-bottom: 6px;
}

.page-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    font-weight: 300;
    margin-bottom: 28px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.divider {
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, rgba(255,255,255,0.8), rgba(255,255,255,0.2));
    border-radius: 2px;
    margin: 0 auto 28px;
}

/* Carousel */

.carousel-scene {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 6px 0;
}

.carousel-card {
    width: 124px;
    min-height: 60px;
    padding: 10px 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.center-card {
    width: 140px;
}

.side-card {
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.22);
    cursor: pointer;
    opacity: 0.72;
    transition: opacity 0.2s, background 0.2s;
}
.side-card:hover { opacity: 1; background: rgba(255,255,255,0.24); }
.side-card.empty { visibility: hidden; pointer-events: none; }

.center-card {
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(255,255,255,0.95);
    box-shadow: 0 4px 20px rgba(0,0,0,0.28);
}

.carousel-card-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-align: center;
    line-height: 1.4;
    color: #fff;
}
.center-card .carousel-card-label { color: #1a1a2e; }

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
}

.carousel-btn {
    background: rgba(255,255,255,0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    line-height: 1;
    flex-shrink: 0;
}
.carousel-btn:hover:not(:disabled) { background: rgba(255,255,255,0.26); }
.carousel-btn:disabled { opacity: 0.28; cursor: default; }

/* Aperçu PDF */

.pdf-preview-section {
    margin-top: 24px;
}

.pdf-preview-wrapper {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    max-height: 420px;
    background: #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}

.pdf-preview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: #fff;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.pdf-preview-canvas {
    display: block;
    width: 100%;
}

/* Bouton ouvrir */

.archives-hidden { display: none; }

.archives-empty {
    color: rgba(255,255,255,0.55);
    font-size: 15px;
    text-align: center;
    padding: 40px 0;
}

.carousel-open-wrapper { text-align: center; }

.carousel-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 24px;
    background: rgba(255,255,255,0.9);
    color: #1a1a2e;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.2px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    margin-top: 16px;
}
.carousel-open-btn:hover {
    background: #fff;
    transform: translateY(-1px);
}

@media (max-width: 900px) {
    .sidebar { width: 28%; }
    .sidebar.hidden { transform: translateX(-28vw); }
    .menu-toggle.menu-visible { left: calc(28% + 14px); }
}

@media (max-width: 600px) {
    body { background-attachment: scroll; }

    .sidebar { width: 85vw; max-width: 320px; }
    .sidebar.hidden { transform: translateX(-85vw); }
    .sidebar-content { margin-top: 52vh; padding: 1.5vw; }

    .menu-toggle { top: 12px; left: 3vw; width: 44px; height: 44px; font-size: 20px; }
    .menu-toggle.menu-hidden  { left: 3vw; }
    .menu-toggle.menu-visible { left: calc(85vw + 2vw); }

    .main-content { padding: 8vh 4vw 3vh; }
    .content-wrapper { max-width: 100%; }
    .page-title { font-size: 22px; }
    .page-subtitle { font-size: 13px; margin-bottom: 2vh; }
    .divider { margin-bottom: 2vh; }

    #cardLeft2, #cardRight2 { display: none; }
    .carousel-card { width: 110px; min-height: 52px; }
    .center-card   { width: 124px; }
    .carousel-open-btn { font-size: 12px; padding: 8px 16px; }
    .sidebar-nav-link { font-size: 17px; padding: 1.8vh 3vw; }

    .pdf-preview-wrapper { max-height: 320px; }
}

@media (max-width: 360px) {
    .page-title { font-size: 19px; }
    .sidebar-nav-link { font-size: 15px; padding: 1.5vh 2.5vw; }
}
