/* ==========================================================
   STYLE GÉNÉRAL
   ========================================================== */

body {
    font-family: 'Segoe UI', sans-serif;

    background: linear-gradient(
        to right,
        #c5e1a5 0%,
        #c5e1a5 20%,
        #fff59d 45%,
        #fff59d 55%,
        #c5e1a5 80%,
        #c5e1a5 100%
    );

    color: #333;

    padding: 40px;
    margin: 0;

    min-height: 100vh;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
}


/* ==========================================================
   CONTENEUR PRINCIPAL
   ========================================================== */

.container {
    max-width: 800px;
    width: 100%;

    margin: 40px auto 0 auto;
    padding: 35px 30px;

    box-sizing: border-box;

    background: white;

    border-radius: 10px;

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);

    text-align: center;
}


/* ==========================================================
   PAGE D'ACCUEIL
   ========================================================== */

.home-container {
    animation: fadeIn 1s ease-in;
}


/* ==========================================================
   TITRES
   ========================================================== */

h1 {
    color: #2e7d32;

    font-size: 2em;

    margin-top: 0;
    margin-bottom: 5px;
}


/* ==========================================================
   PARAGRAPHES
   ========================================================== */

p {
    font-size: 1.1em;

    margin: 15px 0;
}


/* ==========================================================
   TEXTE D'ACCUEIL
   ========================================================== */

#typewriter {
    font-weight: bold;
    color: #1b5e20;

    min-height: 24px;

    margin-bottom: 25px;
}


/* ==========================================================
   BIENVENUE DANS LE HEADER
   ========================================================== */

.header-welcome {
    margin-left: auto;

    font-family: 'Segoe UI', sans-serif;

    text-align: right;
}


/* ----------------------------------------------------------
   Message de bienvenue
   ---------------------------------------------------------- */

.header-welcome-title {
    color: #333;

    font-size: 1rem;

    font-weight: 600;

    white-space: nowrap;
}


/* ----------------------------------------------------------
   Dernière connexion
   ---------------------------------------------------------- */

.header-welcome-login {
    margin-top: 3px;

    color: #666;

    font-size: 0.8rem;

    white-space: nowrap;
}


/* ==========================================================
   FORMULAIRES DE CONNEXION
   ========================================================== */

form label {
    display: block;

    width: 100%;
    max-width: 400px;

    margin: 15px auto 6px auto;

    text-align: left;

    font-weight: 600;
}


/* ----------------------------------------------------------
   Champs de formulaire
   ---------------------------------------------------------- */

form input[type="text"] {
    display: block;

    width: 100%;
    max-width: 400px;

    padding: 12px 15px;

    margin: 0 auto 15px auto;

    box-sizing: border-box;

    border: 2px solid #c5e1a5;

    border-radius: 6px;

    font-family: 'Segoe UI', sans-serif;
    font-size: 1em;

    outline: none;

    transition: border-color 0.3s;
}


/* ----------------------------------------------------------
   Champ actif
   ---------------------------------------------------------- */

form input[type="text"]:focus {
    border-color: #7cb342;
}


/* ==========================================================
   NAVIGATION DES document
   ========================================================== */


/* ----------------------------------------------------------
   Barre de navigation
   ---------------------------------------------------------- */

.document-topbar {
    display: grid;

    grid-template-columns: 1fr auto 1fr;

    align-items: center;

    width: 100%;

    margin-bottom: 10px;
}


/* ----------------------------------------------------------
   Boutons de navigation
   ---------------------------------------------------------- */

.document-nav-button {
    height: 36px;
    min-width: 105px;

    padding: 0 12px;

    box-sizing: border-box;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: #558b2f;
    color: white;

    text-decoration: none;

    border: none;
    border-radius: 6px;

    font-family: 'Segoe UI', sans-serif;
    font-size: 0.9rem;
    font-weight: bold;

    white-space: nowrap;

    transition: background-color 0.2s;
}


/* ----------------------------------------------------------
   Position du bouton Retour
   ---------------------------------------------------------- */

.document-topbar .document-nav-button:first-child {
    justify-self: start;
}


/* ----------------------------------------------------------
   Position du bouton Déconnexion
   ---------------------------------------------------------- */

.document-topbar .document-nav-button:last-child {
    justify-self: end;
}


/* ----------------------------------------------------------
   Survol des boutons de navigation
   ---------------------------------------------------------- */

.document-nav-button:hover {
    background-color: #33691e;
}


/* ----------------------------------------------------------
   Espace réservé lorsque Retour n'existe pas
   ---------------------------------------------------------- */

.document-nav-placeholder {
    width: 105px;
    height: 36px;
}


/* ==========================================================
   BOUTON TÉLÉCHARGEMENT
   ========================================================== */


/* ----------------------------------------------------------
   Bouton principal
   ---------------------------------------------------------- */

.document-download-button {
    height: 36px;
    min-width: 125px;

    padding: 0 14px;

    box-sizing: border-box;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: #558b2f;
    color: white;

    border: none;
    border-radius: 6px;

    font-family: 'Segoe UI', sans-serif;
    font-size: 0.9rem;
    font-weight: bold;

    white-space: nowrap;

    cursor: pointer;

    transition: background-color 0.2s;
}


/* ----------------------------------------------------------
   Survol du bouton téléchargement
   ---------------------------------------------------------- */

.document-download-button:hover:not(:disabled) {
    background-color: #33691e;
}


/* ----------------------------------------------------------
   Bouton désactivé
   ---------------------------------------------------------- */

.document-download-button:disabled {
    background-color: #558b2f;
    color: white;

    cursor: not-allowed;

    opacity: 1;
}


/* ==========================================================
   DOSSIERS
   ========================================================== */

.folder-link {
    display: block;

    width: 100%;

    box-sizing: border-box;

    padding: 14px;
    margin: 12px 0;

    background: #f1f8e9;
    color: #33691e;

    text-decoration: none;
    text-align: left;

    border-radius: 5px;

    border-left: 5px solid #7cb342;

    font-weight: bold;

    transition:
        background-color 0.2s,
        color 0.2s;
}


/* ----------------------------------------------------------
   Survol des dossiers
   ---------------------------------------------------------- */

.folder-link:hover {
    background-color: #7cb342;
    color: white;
}


/* ==========================================================
   LISTE DES FICHIERS
   ========================================================== */


/* ----------------------------------------------------------
   Conteneur de la liste
   ---------------------------------------------------------- */

.file-list {
    width: 100%;

    margin-top: 15px;
}


/* ==========================================================
   EN-TÊTE DE LA LISTE DES FICHIERS
   ========================================================== */

.file-header {
    display: grid;

    grid-template-columns: 30px 1fr 140px;

    align-items: center;

    width: 100%;

    box-sizing: border-box;

    padding: 12px;

    background: #f1f8e9;
    color: #33691e;

    font-weight: 600;

    text-align: left;
}


/* ----------------------------------------------------------
   Colonne du nom
   ---------------------------------------------------------- */

.file-header span:first-of-type {
    grid-column: 2;
}


/* ----------------------------------------------------------
   Colonne de la taille
   ---------------------------------------------------------- */

.file-header span:last-of-type {
    grid-column: 3;
}


/* ==========================================================
   LIGNE D'UN FICHIER
   ========================================================== */

.file-item {
    display: grid;

    grid-template-columns: 30px 1fr 140px;

    align-items: center;

    width: 100%;

    box-sizing: border-box;

    padding: 12px;

    background: #ffffff;

    border-bottom: 1px solid #eef1f6;

    text-align: left;

    transition: background-color 0.2s;
}


/* ----------------------------------------------------------
   Survol d'une ligne
   ---------------------------------------------------------- */

.file-item:hover {
    background: #f8fafc;
}


/* ==========================================================
   CASES À COCHER
   ========================================================== */

.file-checkbox {
    width: 16px;
    height: 16px;
    margin: 4px;
    cursor: pointer;
}


/* ==========================================================
   LIEN DU NOM DE FICHIER
   ========================================================== */

.file-name {
    color: #33691e;

    font-weight: 500;

    text-decoration: none;
}


/* ----------------------------------------------------------
   Titre du fichier
   ---------------------------------------------------------- */

.file-title {
    text-decoration: none;
}


/* ----------------------------------------------------------
   Soulignement uniquement du nom au survol
   ---------------------------------------------------------- */

.file-name:hover .file-title {
    text-decoration: underline;
}


/* ----------------------------------------------------------
   Icône du fichier
   ---------------------------------------------------------- */

.file-icon {
    text-decoration: none;
}


/* ==========================================================
   TAILLE DU FICHIER
   ========================================================== */

.file-size {
    text-align: left;
}


/* ==========================================================
   RECHERCHE DES FICHIERS
   ========================================================== */


/* ----------------------------------------------------------
   Conteneur de recherche
   ---------------------------------------------------------- */

.search-container {
    width: 100%;

    margin: 15px 0;
}


/* ----------------------------------------------------------
   Champ de recherche
   ---------------------------------------------------------- */

.search-input {
    width: 100%;

    box-sizing: border-box;

    padding: 12px 15px;

    border: 2px solid #c5e1a5;

    border-radius: 6px;

    font-family: 'Segoe UI', sans-serif;
    font-size: 1em;

    outline: none;

    transition: border-color 0.3s;
}


/* ----------------------------------------------------------
   Champ actif
   ---------------------------------------------------------- */

.search-input:focus {
    border-color: #7cb342;
}


/* ----------------------------------------------------------
   Texte indicatif
   ---------------------------------------------------------- */

.search-input::placeholder {
    color: #999;

    opacity: 0.5;
}


/* ==========================================================
   BARRE D'ACTIONS
   ========================================================== */

.action-container {
    display: flex;

    flex-direction: row;

    align-items: center;

    width: 100%;
    max-width: 100%;

    gap: 15px;

    margin: 35px auto 20px auto;
}


/* ==========================================================
   STYLE COMMUN DES BOUTONS
   ========================================================== */

.btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    box-sizing: border-box;

    text-decoration: none;

    border-radius: 6px;

    font-weight: bold;

    gap: 8px;

    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);

    transition:
        transform 0.2s,
        background-color 0.3s;
}


/* ----------------------------------------------------------
   Animation au survol
   ---------------------------------------------------------- */

.btn:hover {
    transform: translateY(-2px);
}


/* ==========================================================
   BOUTON ADHÉRENT
   ========================================================== */

.btn-adherent {
    width: 60%;

    padding: 16px;

    background-color: #558b2f;
    color: white;

    font-size: 1.1em;
}


/* ----------------------------------------------------------
   Survol
   ---------------------------------------------------------- */

.btn-adherent:hover {
    background-color: #33691e;
}


/* ==========================================================
   BOUTON PERSONNEL
   ========================================================== */

.btn-personnel {
    width: 40%;

    padding: 16px 10px;

    background-color: #e1ebdd;
    color: #455056;

    font-size: 1em;
}


/* ----------------------------------------------------------
   Survol
   ---------------------------------------------------------- */

.btn-personnel:hover {
    background-color: #cadbc3;

    color: #333;
}


/* ==========================================================
   ICÔNES DES BOUTONS
   ========================================================== */

.btn-icon {
    font-size: 1.5em;

    vertical-align: middle;

    line-height: 1;
}


/* ==========================================================
   BOUTON DE VALIDATION
   ========================================================== */

.btn-ok {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding: 14px 24px;

    min-height: 48px;

    box-sizing: border-box;

    background-color: #558b2f;
    color: white;

    text-decoration: none;

    border: none;

    border-radius: 6px;

    font-family: 'Segoe UI', sans-serif;

    font-size: 1em;
    font-weight: bold;

    line-height: 1.2;

    cursor: pointer;

    transition: background-color 0.3s;

    margin: 5px;
}


/* ----------------------------------------------------------
   Survol
   ---------------------------------------------------------- */

.btn-ok:hover {
    background-color: #33691e;
}


/* ==========================================================
   ANCIENS BOUTONS DE NAVIGATION
   ========================================================== */

.btn-exit,
.btn-back {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding: 14px 24px;

    min-height: 48px;

    box-sizing: border-box;

    background-color: #558b2f;
    color: white;

    text-decoration: none;

    border-radius: 6px;

    font-family: 'Segoe UI', sans-serif;

    font-size: 1em;
    font-weight: bold;

    line-height: 1.2;

    cursor: pointer;

    transition: background-color 0.3s;

    margin: 5px;
}


/* ----------------------------------------------------------
   Survol
   ---------------------------------------------------------- */

.btn-exit:hover,
.btn-back:hover {
    background-color: #33691e;
}


/* ==========================================================
   LIEN DE CONTACT
   ========================================================== */

.contact-link {
    display: inline-block;

    margin-top: 15px;

    color: #558b2f;

    text-decoration: none;

    font-weight: 600;

    font-size: 0.95em;

    transition: color 0.2s;
}


/* ----------------------------------------------------------
   Survol
   ---------------------------------------------------------- */

.contact-link:hover {
    text-decoration: underline;

    color: #2e7d32;
}


/* ==========================================================
   DATE DE MISE À JOUR
   ========================================================== */

.update-date {
    font-size: 0.85em;

    color: #888;

    margin-top: 15px;
    margin-bottom: 0;
}


/* ==========================================================
   ESPACE AVANT LE FOOTER
   ========================================================== */

.spacer {
    flex: 1 0 auto;
}


/* ==========================================================
   FOOTER
   ========================================================== */

opvl-footer {
    display: block;

    width: 100%;

    margin-top: auto;
}


/* ==========================================================
   INDICATEUR DE CHARGEMENT
   ========================================================== */


/* ----------------------------------------------------------
   Fond de chargement
   ---------------------------------------------------------- */

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}


/* ----------------------------------------------------------
   Overlay visible
   ---------------------------------------------------------- */

.loading-overlay.is-visible {
    opacity: 1;

    pointer-events: all;
}


/* ----------------------------------------------------------
   Overlay en attente
   ---------------------------------------------------------- */

.loading-overlay.is-pending {
    pointer-events: all;
}


/* ==========================================================
   ANIMATION DU CHARGEMENT
   ========================================================== */

.loading-spinner {
    width: 42px;
    height: 42px;

    border: 5px solid #c5e1a5;

    border-top-color: #558b2f;

    border-radius: 50%;

    animation: loadingSpin 0.8s linear infinite;
}


/* ----------------------------------------------------------
   Rotation
   ---------------------------------------------------------- */

@keyframes loadingSpin {

    to {
        transform: rotate(360deg);
    }

}


/* ==========================================================
   ANIMATION D'APPARITION
   ========================================================== */

@keyframes fadeIn {

    from {
        opacity: 0;

        transform: translateY(100px);
    }

    to {
        opacity: 1;

        transform: translateY(0);
    }

}


/* ==========================================================
   PAGES D'ERREUR
   ========================================================== */


/* ----------------------------------------------------------
   Conteneur d'erreur
   ---------------------------------------------------------- */

.error-box {
    background: white;

    padding: 40px 30px;

    border-radius: 10px;

    max-width: 900px;
    width: 100%;

    margin: 40px auto 0 auto;

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);

    box-sizing: border-box;

    text-align: center;
}


/* ==========================================================
   CODE D'ERREUR
   ========================================================== */

.error-code {
    color: #558b2f;

    font-size: 3.5em;

    margin: 0 0 10px 0;
}


/* ==========================================================
   RESPONSIVE - TABLETTE ET MOBILE
   ========================================================== */

@media (max-width: 768px) {

    /* ======================================================
       CORRECTION DES ESPACEMENTS GÉNÉRAUX
       ====================================================== */

    body {
        padding: 15px;
    }


    /* ======================================================
       CONTENEUR PRINCIPAL - MOBILE
       ====================================================== */

    .container {
        width: 100%;

        margin-top: 60px;

        padding: 25px 15px;
    }


    /* ======================================================
       BIENVENUE - MOBILE
       ====================================================== */

    .header-welcome {
        display: none;
    }


    /* ======================================================
       NAVIGATION DOCUMENT - MOBILE
       ====================================================== */

    .document-nav-button,
    .document-download-button {
        min-width: 42px;
        width: 42px;

        padding: 0;

        justify-content: center;
    }


    /* ------------------------------------------------------
       Masquage du texte des boutons
       ------------------------------------------------------ */

    .document-nav-button .button-text,
    .document-download-button .button-text {
        display: none;
    }


    /* ======================================================
       BARRE D'ACTIONS - MOBILE
       ====================================================== */

    .action-container {
        display: flex;

        flex-direction: column;

        align-items: stretch;

        width: 60%;
        max-width: 60%;

        gap: 10px;

        margin: 25px auto 20px auto;
    }


    /* ======================================================
       BOUTON ADHÉRENT - MOBILE
       ====================================================== */

    .btn-adherent {
        width: 100%;
        max-width: 100%;

        padding: 14px 10px;

        font-size: 0.9em;
    }


    /* ======================================================
       BOUTON PERSONNEL - MOBILE
       ====================================================== */

    .btn-personnel {
        width: 100%;
        max-width: 100%;

        padding: 14px 10px;

        font-size: 0.9em;
    }


    /* ======================================================
       LISTE DES FICHIERS - MOBILE
       ====================================================== */

    .file-header,
    .file-item {
        grid-template-columns: 30px 1fr 90px;

        padding: 10px;
    }


    /* ======================================================
       TAILLE DES TEXTES - MOBILE
       ====================================================== */

    h1 {
        font-size: 1.6em;
    }

    p {
        font-size: 1em;
    }


    /* ======================================================
       BOUTONS DE VALIDATION - MOBILE
       ====================================================== */

    .btn-ok,
    .btn-exit,
    .btn-back {
        max-width: 100%;

        padding: 12px 18px;

        font-size: 0.95em;
    }


    /* ======================================================
       PAGE D'ERREUR - MOBILE
       ====================================================== */

    .error-box {
        padding: 30px 15px;

        margin-top: 20px;
    }

    .error-code {
        font-size: 2.8em;
    }
}


/* ==========================================================
   RESPONSIVE - PETITS TÉLÉPHONES
   ========================================================== */

@media (max-width: 480px) {

    /* ======================================================
       ESPACEMENTS
       ====================================================== */

    body {
        padding: 10px;
    }


    .container {
        margin-top: 60px;
        padding: 20px 12px;
        border-radius: 8px;
    }


    /* ======================================================
       TITRES
       ====================================================== */

    h1 {
        font-size: 1.4em;
    }


    /* ======================================================
       BARRE D'ACTIONS
       ====================================================== */

    .action-container {
        gap: 8px;

        margin-top: 20px;
    }


    /* ======================================================
       BOUTONS ADHÉRENT ET PERSONNEL
       ====================================================== */

    .btn-adherent,
    .btn-personnel {
        width: 100%;

        padding: 13px 8px;

        font-size: 0.85em;

        gap: 5px;
    }


    /* ======================================================
       ICÔNES
       ====================================================== */

    .btn-icon {
        font-size: 1.3em;
    }


    /* ======================================================
       LISTE DES FICHIERS
       ====================================================== */

    .file-header,
    .file-item {
        grid-template-columns: 25px 1fr 70px;

        padding: 8px;
    }


    .file-size {
        font-size: 0.85em;
    }


    /* ======================================================
       BOUTONS DE NAVIGATION
       ====================================================== */

    .btn-ok,
    .btn-exit,
    .btn-back {
        width: 100%;

        margin: 5px 0;

        padding: 12px 10px;

        font-size: 0.9em;
    }


    /* ======================================================
       PAGE D'ERREUR
       ====================================================== */

    .error-box {
        padding: 25px 12px;
    }

    .error-code {
        font-size: 2.4em;
    }
}
