/* --- RESET & BASES --- */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; 
}

:root {
    --primary-color: #108204;
    --primary-hover: #0d6b03;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
}

body { 
    background: #e8f9e8; 
    background: linear-gradient(180deg, #e8f9e8 0%, #dedfdf 100%);
    min-height: 100vh; 
}

/* --- HEADER --- */
.header { 
    background: var(--primary-color); 
    color: #fff; 
    padding: 10px 40px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.logo { display: flex; align-items: center; gap: 20px; }
.ensa-logo-img { height: 70px; width: auto; }
.logo-text { display: flex; flex-direction: column; }
.logo-title { font-size: 20px; font-weight: bold; }

.btn-admin-link { 
    color: white; 
    text-decoration: none; 
    border: 1px solid white; 
    padding: 8px 15px; 
    border-radius: 5px; 
    font-size: 14px; 
    font-weight: bold; 
    transition: 0.3s;
}
.btn-admin-link:hover { background: rgba(255,255,255,0.2); }

/* --- LAYOUT --- */
.container { 
    display: flex; 
   /* max-width: 1400px; /* Légèrement plus large pour le confort */
    margin: 0 auto;
    padding: 30px 40px; 
    gap: 30px; 
}

.sidebar { 
    width: 280px; 
    background: #fff; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.1); 
    height: fit-content; 
}

.content { 
    flex: 1; 
    background: #fff; 
    padding: 30px; 
    border-radius: 8px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
}

/* --- BOUTONS DE NAVIGATION INTERNE --- */
.main-buttons {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 8px;
    border-left: 5px solid var(--primary-color);
}

.btn {
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: 0.3s;
    border: none;
    cursor: pointer;
}

.btn:hover { background: var(--primary-hover); }

.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 18px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    margin-left: 10px;
    transition: 0.3s;
}
.btn-outline:hover { background: var(--primary-color); color: white !important; }

/* --- FORMULAIRE & GRILLE --- */
.form-container-flex { display: flex; align-items: flex-start; gap: 25px; }
.form-wrapper { flex: 2; }
.illustration-container { flex: 1; display: flex; align-items: center; justify-content: center; }

.form-content { display: none; }
.form-content.active-form { display: block !important; }

.personal-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 10px;
}

.form-content label { 
    display: block; 
    margin-top: 15px; 
    margin-bottom: 5px; 
    font-weight: 600; 
    color: #444; 
    font-size: 14px; 
}

.form-content input, .form-content select, .form-content textarea { 
    display: block; 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 6px; 
    box-sizing: border-box;
}

/* --- BOUTONS SIDEBAR --- */
.formule { 
    width: 100%; 
    padding: 12px; 
    margin-bottom: 10px; 
    border: 1px solid #ddd; 
    background: #f9fafb; 
    cursor: pointer; 
    border-radius: 6px; 
    text-align: left; 
    transition: 0.3s;
}
.formule.active { 
    background: var(--primary-color) !important; 
    color: #fff !important; 
    font-weight: bold; 
    border-color: var(--primary-color);
}

/* --- ACTIONS FORMULAIRE --- */
.submit { 
    margin-top: 25px; 
    padding: 15px; 
    width: 100%; 
    background: var(--primary-color); 
    color: white; 
    border: none; 
    border-radius: 6px; 
    font-weight: bold; 
    cursor: pointer; 
    font-size: 16px;
    transition: 0.3s;
}
.submit:hover { background: var(--primary-hover); }

/* --- ETATS & VALIDATION --- */
.required-star { color: var(--danger-color); margin-left: 3px; font-weight: bold; }

input:invalid:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.2);
}

/* --- IMAGES --- */
.side-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
    border-radius: 12px;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .form-container-flex { flex-direction: column; }
    .illustration-container { width: 100%; order: -1; } /* Image au dessus sur tablette */
}

@media (max-width: 600px) {
    .container { flex-direction: column; padding: 15px; }
    .sidebar { width: 100%; }
    .personal-info-grid { grid-template-columns: 1fr; gap: 0; }
    .header { padding: 10px 20px; flex-direction: column; gap: 10px; text-align: center; }
}
