/* --- 1. Réinitialisation Basique --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif; /* Assure-toi que Lato est importée dans le HTML */
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    padding: 20px;
}

/* --- 2. Styles Généraux de Conteneur et Typographie --- */
.container {
    max-width: 1200px;
    margin: 20px auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1, h2 {
    text-align: center;
    color: #0056b3;
    margin-bottom: 25px;
    font-weight: 700;
}

h2 {
    font-size: 1.8em;
    margin-top: 20px;
}

p {
    margin-bottom: 10px;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
}

/* --- 3. Styles Spécifiques au Formulaire --- */
.main-center {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Alignement en haut pour les grands formulaires */
    padding: 20px;
    min-height: calc(100vh - 40px); /* Ajuste pour le padding du body */
}

.form-enregistre {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 900px; /* Largeur max pour le formulaire */
}

.diviseforms {
    display: flex;
    flex-wrap: wrap; /* Permet le retour à la ligne pour le responsive */
    gap: 20px; /* Espacement entre les colonnes de formulaire */
    margin-bottom: 20px;
}

.bloc-formOne,
.bloc-formTwo {
    flex: 1; /* Permet aux blocs de prendre la place disponible */
    min-width: 300px; /* Largeur minimale avant de passer à la ligne */
}

.label-input {
    margin-bottom: 15px;
}

.label-input label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.label-input input[type="text"],
.label-input input[type="email"],
.label-input input[type="number"],
.label-input input[type="date"],
.label-input select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.label-input input[type="text"]:focus,
.label-input input[type="email"]:focus,
.label-input input[type="number"]:focus,
.label-input input[type="date"]:focus,
.label-input select:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.label-inp {
    display: flex;
    flex-direction: column; /* Pour que label et select soient superposés */
    flex: 1;
}

.label-input > .label-inp {
    margin-right: 10px; /* Espace entre les deux selects sur la même ligne */
}

.label-input > .label-inp:last-child {
    margin-right: 0;
}

.spanred {
    color: red;
    margin-right: 3px;
}

.sub-back {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

.submit {
    background-color: #007bff;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit:hover {
    background-color: #0056b3;
}

.view {
    display: flex;
    align-items: center;
    font-size: 1.1em;
    color: #555;
}

.view .back {
    margin-right: 8px;
}

.view i {
    font-size: 1.2em;
    color: #555;
}

/* --- 4. Styles Spécifiques au Tableau (pour liste_pre_inscriptions.php) --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

th, td {
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    text-align: left;
}

th {
    background-color: #f8f8f8;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
}

tr:nth-child(even) {
    background-color: #fdfdfd;
}

tr:hover {
    background-color: #f1f1f1;
}

.action-buttons a {
    display: inline-block;
    padding: 8px 12px;
    margin: 2px;
    border-radius: 5px;
    text-decoration: none;
    color: white;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
    text-align: center;
    white-space: nowrap; /* Empêche le texte de se couper */
}
.action-buttons .btn-validate { background-color: #28a745; }
.action-buttons .btn-validate:hover { background-color: #218838; }
.action-buttons .btn-decline { background-color: #dc3545; }
.action-buttons .btn-decline:hover { background-color: #c82333; }

.no-data {
    text-align: center;
    padding: 30px;
    color: #777;
    font-size: 1.1em;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-top: 20px;
}

/* --- 5. Messages de Statut --- */
.status-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Styles pour les messages d'erreur JS (si tu utilises pre_inscription.js) */
.error-text {
    color: #dc3545; /* Rouge pour les erreurs */
    font-size: 0.85em;
    margin-top: 5px;
    display: block; /* S'assure que le message est sur sa propre ligne */
}

/* --- 6. Responsive Design (Media Queries) --- */

/* Pour les écrans plus petits que 768px (tablettes et mobiles) */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container, .form-enregistre {
        padding: 20px;
        margin: 10px auto;
    }

    .diviseforms {
        flex-direction: column; /* Empile les colonnes sur les petits écrans */
        gap: 0; /* Réduit l'espacement */
    }

    .bloc-formOne,
    .bloc-formTwo {
        min-width: unset; /* Annule la largeur minimale */
        width: 100%; /* Prend toute la largeur disponible */
    }

    .label-input > .label-inp {
        margin-right: 0;
        margin-bottom: 10px; /* Ajoute de l'espace entre les champs empilés */
    }
    
    .label-input > .label-inp:last-child {
        margin-bottom: 0;
    }

    .sub-back {
        flex-direction: column; /* Empile les boutons */
        align-items: center;
        gap: 15px;
    }

    .submit {
        width: 100%;
        padding: 15px;
    }

    .view {
        width: 100%;
        justify-content: center;
    }

    table, thead, tbody, th, td, tr {
        display: block; /* Empile les éléments du tableau */
    }

    thead tr {
        position: absolute;
        top: -9999px; /* Cache les en-têtes (sera visible en tant que labels) */
        left: -9999px;
    }

    tr {
        border: 1px solid #ccc;
        margin-bottom: 15px;
        border-radius: 8px;
    }

    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    td:before {
        content: attr(data-label); /* Utilise l'attribut data-label pour l'en-tête */
        position: absolute;
        left: 0;
        width: 45%;
        padding-left: 15px;
        font-weight: 600;
        text-align: left;
        white-space: nowrap;
    }

    .action-buttons {
        display: flex; /* Maintient les boutons sur une ligne */
        justify-content: center;
        padding-top: 10px;
        border-top: 1px solid #eee;
        margin-top: 10px;
    }
}

/* Pour les très petits écrans (mobiles étroits) */
@media (max-width: 480px) {
    .form-enregistre {
        padding: 15px;
    }

    .submit {
        font-size: 1em;
    }

    .view {
        font-size: 1em;
    }
}