/* style.css */
/* k3m_css_fct_analysegrain.css */


@media print {
    .no-print {
        display: none !important;
    }

    /* Optionnel : Ajuster la mise en page pour l'impression */
    body {
        background-image: none !important; /* Enlève l'image de fond du labo */
        background-color: white !important;
        padding-top: 0 !important;
    }
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 75vh;      /* Prend toute la hauteur de la fenêtre */
    background-image: url(../img/labo-scientifique.svg);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: top;
    background-color: #f3f3f3;
    font-size: 0.85em;
    font-family: 'Poppins', sans-serif;
    }

/* Important : décaler le contenu pour qu'il ne commence pas sous la barre fixe */
body {
    padding-top: 50px;
}

/* scroll bar ********************************************/

body::-webkit-scrollbar {
  width: 27px;
}

body::-webkit-scrollbar-track {
  background: #1f585a;
  border-radius: 1px;
}

body::-webkit-scrollbar-thumb {
  background-color: #2ea282;
  background-image: url('img/scrollbar_agri-fusion.png');
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 1px;
}

@supports not selector(::-webkit-scrollbar) {
  body {
    scrollbar-color: #2ea282 #1f585a;
  }
}
    .header-container {
        /* text-align: center; */
        margin-bottom: 150px; 
        width: 1200px;
    }

    .header-container p {
        margin: 0px 0;
        font-size: 0.9rem;
    }

    .login-box-login, .login-box {
        background-color: rgba(255, 255, 255, 0.9);
        padding: 0px 20px 20px 20px;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }
    .login-box-login {
        width: 400px;

    }
    .login-box {
        width: 900px;

    }
.logo-title { 
    margin: 0px;
    color: #2ea282; /* 1f585a */
    font-size: 30px;
    font-variant-caps: small-caps;
}
.btn-link {
            transition: opacity 0.2s;
        }
        .btn-link:hover {
            opacity: 0.8;
        }

#session-warning-banner {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background-color: #ff9800; /* Orange d'alerte */
        color: white;
        text-align: center;
        padding: 15px;
        z-index: 9999;
        font-weight: bold;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    #session-warning-banner button {
        margin-left: 20px;
        padding: 5px 15px;
        cursor: pointer;
        background: white;
        color: #ff9800;
        border: none;
        border-radius: 4px;
        font-weight: bold;
    }


.sub-title { 
    text-align: center; 
    color: #7f8c8d; 
    margin-bottom: 30px; 
    font-size: 14px; 
}

.alert { 
    background: #fee2e2; 
    color: #dc2626; 
    padding: 12px; 
    border-radius: 5px; 
    margin-bottom: 20px; 
    font-size: 14px; 
    border: 1px solid #fecaca; 
    text-align: center; 
}

label { 
    display: block; 
    margin-bottom: 8px; 
    color: #34495e; 
    font-weight: 500; 
}

input { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid #d1d5db; 
    border-radius: 6px; 
    box-sizing: border-box; 
    transition: border 0.3s; 
/*    margin-bottom: 20px; */
}

input:focus { 
    border-color: #27ae60; 
    outline: none; 
}

button { 
    width: 100%; 
    padding: 12px; 
    background-color: #308580; 
    color: white; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 16px; 
    font-weight: 600; 
}

button:hover { 
    background-color: #7bcbb6; 
}

.version { 
    text-align: center; 
    margin-top: 25px; 
    font-size: 11px; 
    color: #bdc3c7; 
}
.k3m-motpasseoublie {
    text-align: right;
    padding-bottom: 15px;
}
.k3m-sincrireauportail {
    text-align: left;
    padding-top: 25px;
}

/* les boutons fonctions ******************************/
.k3m-but_fct {
    display: flex;          /* Active le mode flex */
    justify-content: flex-end; /* Aligne le contenu à droite */
/*    width: 100%;             S'assure que le conteneur prend toute la largeur */
}

/* Nettoyage du bouton pour séparer le fond de la forme */
.k3m-but_fct a {
    display: inline-block;
    margin-bottom: 15px;
    background: #308580;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s; /* Petit effet de survol sympa */
}

.k3m-but_fct a:hover {
    background: #7bcbb6;    /* Assombrit un peu au survol */
}



/* Formulaire de demande */
    .form-container { 
        background: #fffffff0; 
        margin: auto; 
        padding: 0px 20px 20px 20px;  
        box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
        width: 100%; 
        max-width: 950px;
    }
    .k3m-identification {
        text-align: center;
    }
    h1, h2 { color: #2c3e50; }

/* Demande d'une analyse de grains *************************************/
/* Conteneur principal des tests */
.grid-tests {
/*    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px 25px;
    background: #ffffff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px; */
display: none;
    margin-left: 30px;
    padding: 10px;
    border-left: 2px solid #ccc;
    
}


/* Classe qui sera ajoutée par JavaScript */
.grid-tests.active {
    display: block;
}

/* Option B : Pour griser les éléments (si vous préférez les voir) */
.grid-tests.disabled {
    opacity: 0.4;
    pointer-events: none; /* Empêche de cliquer sur les checkboxes */
}


/* Alignement de chaque étiquette (label) */
.grid-tests label {
/*    display: flex;*/
    align-items: center; /* Aligne verticalement la checkbox et le texte */
    font-size: 15px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
/*    padding: 5px; */
}

/* Style de la case à cocher */
.grid-tests input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px; /* Espace entre la case et le texte */
    cursor: pointer;
    accent-color: #27ae60; /* Couleur verte Agri-Fusion pour la coche */
}

/* Effet au survol pour aider l'utilisateur */
.grid-tests label:hover {
    background-color: #f0fdf4;
    border-radius: 4px;
}


/* Conteneur parent */
.ramassage-wrapper {
    display: flex;
    flex-wrap: wrap; /* Permet le retour à la ligne sur mobile */
    gap: 15px;       /* Espace entre les deux colonnes */
    margin-top: 20px;
}

/* Style de chaque option (colonne) */
.adresseramassage-option {
    flex: 1;          /* Les colonnes prennent la même largeur */
    min-width: 250px; /* Si l'écran fait moins de 500px (250x2), elles s'empilent */
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.adresseramassage-option:hover {
    background-color: #f9f9f9;
}

/* Style par défaut du placeholder */
#adresseramassage_precision::placeholder {
    color: #999; /* Couleur grise standard */
}

/* Style quand l'option 'Adresse différente' est active */
#adresseramassage_precision.alerte-placeholder::placeholder {
    color: red;
    font-weight: bold;
    opacity: 1; /* Assure que la couleur est vive sur tous les navigateurs */
}


/* Formulaire liste des demandes et/ou analyses réalisées *******************/

/* Conteneur principal */
.grid-container {
    display: grid;
    /* Définit 4 colonnes : Libellé | Valeur | Libellé | Valeur */
    grid-template-columns: 2fr 1fr 2fr 1fr; 
    width: 100%;
    border-top: 1px solid #ddd;
    border-left: 1px solid #ddd;
}

/* En-têtes */
.grid-header {
    background-color: #f2f2f2;
    font-weight: bold;
    padding: 12px;
    border-right: 1px solid #ddd;
    border-bottom: 2px solid #ccc;
    text-align: left;
}

/* Cellules standards */
.grid-cell {
    padding: 10px;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    min-height: 20px;
}

/* Style spécifique pour les labels */
.grid-cell.label {
    background-color: #fafafa;
    color: #555;
}

/* Style spécifique pour les valeurs */
.grid-cell.value {
    font-weight: bold;
    text-align: center;
}

/* Texte "En cours..." */
.pending {
    color: #e67e22;
    font-style: italic;
    font-weight: normal;
}

/* Version Mobile : On repasse sur 2 colonnes si l'écran est petit */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr 1fr;
    }
    /* Masquer les deux derniers headers sur mobile pour éviter la répétition */
    .grid-header:nth-child(3), 
    .grid-header:nth-child(4) {
        display: none;
    }
}



.k3m-container-boutons {
        display: flex;       /* Aligne les enfants sur une ligne */
        gap: 10px;           /* Crée l'espace de 10px entre chaque bouton */
        align-items: center; /* Aligne verticalement au centre si nécessaire */
        margin-top: 25px;
    }

    .btn-custom {
        background-color: #007bff; /* Ajoutez votre couleur de fond ici */
        color: white;
        padding: 10px 20px;
        text-decoration: none;
        border-radius: 5px;
        display: inline-block;
        font-family: sans-serif;
    }
    
    /* Optionnel : un petit effet au survol */
    .btn-custom:hover {
        opacity: 0.9;
    }

    .container { background: #fffffff0; padding: 0px 20px 20px 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
    table { width: 100%; border-collapse: collapse; /* margin-top: 20px; */ }
    th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }
    th { background-color: #2ea282; color: white; }
    .status { font-weight: bold; padding: 5px 10px; border-radius: 4px; }
    .status-demandee { background: #e1f5fe; color: #0288d1; }
    .status-terminee { background: #e8f5e9; color: #2e7d32; }

/* logout ******************************************************/
/* Barre fixée en haut de l'écran */
.top-bar {
    position: fixed;    
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;      
    pointer-events: none; 
    padding-top: 10px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 100%);
    height: 60px;
}

.top-bar-content {
    max-width: 1000px;
    margin: 0 auto;
    height: 50px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
}

.filter-bar {
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
}

.btn-logout {
    pointer-events: auto;
    background-color: #e74c3c;
    color: white !important;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, background 0.3s;
    white-space: nowrap;    /* Empêche le texte de revenir à la ligne */
}

.btn-logout:hover {
    background-color: #c0392b;
    transform: translateY(2px); /* Petit effet d'enfoncement au clic */
}

.btn-list {
    background-color: #34495e; /* Gris-bleu pour le bouton liste */
}

/* ADM - approbation nouveaux comptes  ********************************************/
.btn { padding: 8px 12px; border-radius: 4px; text-decoration: none; font-weight: bold; font-size: 0.85em; }
.btn-approve { background-color: #2ea282; color: white; }
.btn-delete { background-color: #d9534f; color: white; margin-left: 10px; }


/* PORTAIL DES ANALYSES  ********************************************/
/* Structure globale du tableau */
/* --- Base et Conteneur --- */
/* --- Conteneur et Tableau --- */
/* --- Conteneur et Table --- */
.table-container { 
    width: 100%; 
    overflow-x: auto; 
    margin-bottom: 20px; 
}
.table-analyses { 
    width: 100%; 
    border-collapse: collapse; 
    min-width: 400px; 
    font-family: sans-serif; 
}
.table-analyses th, .table-analyses td { 
    padding: 5px; 
    border-bottom: 1px solid #eee; 
    text-align: left; 
}
.table-analyses th { 
    background-color: #c3e3c496; /* #c3e3c4 */
    color: #2a6163;
    cursor: pointer; 
    font-size: 0.9rem; 
}

/* --- Boutons et Actions --- */
.btn-status { 
    border: none; 
    padding: 8px 12px; 
    border-radius: 8px; 
    cursor: pointer; 
    color: white; 
    font-size: 0.85rem; 
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    text-decoration: none;
    width: 75%;
}
.btn-pdf { 
    color: #e74c3c; 
    text-decoration: none; 
    font-size: 0.8rem; 
    margin-left: 10px; 
}
/* --- Vue Administrateur (Groupes) --- */
.group-wrapper { 
    margin-bottom: 50px; 
/*    border: 1px solid #ddd; */
    border-radius: 8px; 
    overflow: hidden; 
}
.group-header { 
/*
    background: #2a6163;
    color: #ffffff;
*/
    padding: 15px 15px 15px 0px;
    cursor: pointer; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    border: 1px solid #dee4dc;
}
.info-contact { 
    font-size: 0.75rem; 
    color: #666; 
}
/* --- Masquage Mobile (< 480px) --- */
@media (max-width: 480px) {
    .hide-mobile { display: none !important; }
    .group-header { flex-direction: column; align-items: flex-start !important; gap: 5px; }
}


/* Bouton de contrôle global pour Admin */
.global-control-container {
    margin-bottom: 15px;
    display: flex;
    justify-content: flex-end;
}

.btn-toggle-all {
/*    background-color: #6c757d; */
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-toggle-all:hover {
    background-color: #5a6268;
}

/* Styles existants conservés */
/* .table-container { width: 100%; overflow-x: auto; margin-bottom: 20px; }
.table-analyses { width: 100%; border-collapse: collapse; min-width: 400px; font-family: sans-serif; }
.table-analyses th, .table-analyses td { padding: 12px; border-bottom: 1px solid #eee; text-align: left; }
.table-analyses th { background-color: #f2f2f2; cursor: pointer; font-size: 0.9rem; }
*/
/* .btn-status { border: none; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: white; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 6px; } */
/* .group-wrapper { margin-bottom: 10px; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; } */
/* .group-header { background: #f8f9fa; padding: 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; } */
@media (max-width: 480px) {
    .hide-mobile { display: none !important; }
    .group-header { flex-direction: column; align-items: flex-start !important; gap: 5px; }
}



/* Style de la barre de progression */
.progress-container {
    background-color: #dee4dc;
    border-radius: 10px;
    margin-left: 15px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
width: 100px;
    height: 12px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-bar {
    background-color: #2ea282; /* Vert Agri-Fusion */
    transition: width 0.4s ease;

height: 100%;
    background: linear-gradient(90deg, #2ea282, #82c44d); /* Dégradé de vert */
    border-radius: 10px;
/*    transition: width 0.5s ease-in-out;*/
    transition: width 1s ease-out;
}

@media (max-width: 480px) {
    .progress-container {
        width: 100px;
        margin-left: 0;
        margin-top: 5px;
    }
}


/* Badge d'alerte de retard */
.badge-retard {
    background-color: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}


#filter-statut option[value="En attente de paiement"] {
    font-weight: bold;
    color: #e74c3c;
    background-color: #fdecea;
}

.btn-rappel {
    background-color: #f39c12;
    color: white;
    padding: 4px 10px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
    transition: background 0.2s;
}

.btn-rappel:hover {
    background-color: #e67e22;
    color: white;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.js-ligne-analyse {
    animation: fadeIn 0.8s ease-out;
}

/* 1. Définition de l'animation personnalisée */
@keyframes groupFadeInRight {
    from { 
        opacity: 0; 
        transform: translateX(-20px); /* Démarre 20px à gauche de sa position finale */
    }
    to { 
        opacity: 1; 
        transform: translateX(0);    /* Arrive à sa position naturelle */
    }
}

/* 2. Application de l'animation à la classe */
.group-fadein {
    /* Utilisation de 0.8s pour la cohérence avec vos lignes */
    animation: groupFadeInRight 0.8s ease-out;
}

/************************************************************* Page du formulaire Demande d'analyse */
/* Style pour le conteneur du bouton et du texte */
.clickable-label {
    display: inline-flex;    /* Aligne l'input et le texte sur la même ligne */
    align-items: center;     /* Centre verticalement le bouton par rapport au texte */
    cursor: pointer;         /* Change le curseur en main au survol */
    font-weight: bold;       /* Reprend l'aspect visuel du h4 */
    font-size: 1.2em;
    margin-top: 15px;
    white-space: nowrap;
}

/* Espacement entre le bouton radio et le texte */
.clickable-label input[type="radio"] {
    margin-right: 10px;      /* Espace à droite du bouton */
    cursor: pointer;
}

/* Optionnel : Changement de style au survol pour améliorer l'expérience utilisateur */
.clickable-label:hover .label-text {
    color: #0056b3;          /* Le texte change de couleur au survol */
}

.forfait-option {
    margin-top: 25px;
}
.grid-tests {
    display: none;
    margin-left: 55px;
    margin-top: 10px;
}

.form_section {
    margin-bottom: 75px;
}
.alert-success  {
    color: #2ea282;
    padding: 15px;
    font-size: 2em;
    font-weight: 600;
}