/* ==========================================================================
   1. VARIABLES & CONFIGURATION GENERALE
   ========================================================================== */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #e67e22;
    --secondary-hover: #d35400;
    --text-color: #333333;
    --text-muted: #7f8c8d;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #ccc;
    --success-bg: #d4edda;
    --success-text: #155724;
    --success-border: #c3e6cb;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --error-border: #f5c6cb;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 20px;
}

/* ==========================================================================
   2. CONTENEURS DE FORMULAIRE & ADMINISTRATION (FACTORISÉS)
   ========================================================================== */
.form-container, .admin-container { 
    margin: 60px auto; 
    padding: 25px 30px; 
    background: var(--card-bg);
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.form-container { 
    max-width: 400px; 
}

.admin-container { 
    max-width: 600px; 
    margin-top: 40px;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.form-header h2 {
    margin: 0;
}

/* Sections spécifiques à la console admin */
.section-admin {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.section-admin:last-child {
    border-bottom: none;
}

.actuel {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.actuel strong { 
    color: var(--primary-color); 
}

/* ==========================================================================
   3. IMAGES & LOGOS
   ========================================================================== */
.logo-titre {
    height: 60px;
    width: auto;
}

.logo-grand {
    height: 90px;
}

/* ==========================================================================
   4. CHAMPS DE SAISIE
   ========================================================================== */
.champ { 
    margin-bottom: 15px; 
}

.champ label { 
    display: block;
    margin-bottom: 5px; 
    font-weight: 600;
}

.champ input, .champ select { 
    width: 100%; 
    padding: 10px; 
    box-sizing: border-box; 
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
}

/* Gestion des CGU */
.champ-cgu { 
    display: flex; 
    align-items: flex-start;
    gap: 10px; 
    margin: 20px 0;
}

.champ-cgu input { 
    width: auto; 
    margin-top: 4px; 
    cursor: pointer; 
}

.champ-cgu label { 
    display: inline;
    cursor: pointer; 
}

/* ==========================================================================
   5. BOUTONS (FACTORISÉS)
   ========================================================================== */
/* ==========================================================================
   5. BOUTONS (FACTORISÉS & SÉCURISÉS)
   ========================================================================== */
/* ==========================================================================
   5. BOUTONS (FACTORISÉS)
   ========================================================================== */
/* Uniquement pour les formulaires d'accès et la console admin */
.form-container button[type="submit"], 
.admin-container button[type="submit"], 
.btn-admin {
    display: block;
    width: 100%;
    padding: 10px 15px;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
    text-decoration: none;
}

/* Bouton submit classique par défaut */
button[type="submit"] {
    background-color: var(--primary-color);
    color: white;
}

button[type="submit"]:hover {
    background-color: #1a252f;
}

.btn-admin {
    background-color: var(--secondary-color);
    color: white;
}

.btn-admin:hover {
    background-color: var(--secondary-hover);
}

/* Bouton de déconnexion spécifique à la page portfolio_admin.php (hors navbar) */
.admin-container .btn-deconnexion {
    display: block;
    width: 100%;
    padding: 10px 15px;
    background-color: var(--text-muted);
    color: white;
    margin-top: 20px;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    box-sizing: border-box;
}

.admin-container .btn-deconnexion:hover {
    background-color: #c0392b;
}

/* ==========================================================================
   6. NOTIFICATIONS & ERREURS (FACTORISÉES)
   ========================================================================== */
.erreur, .msg, .msg-success, .msg-error {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-weight: bold;
    font-size: 0.9rem;
    text-align: center;
}

/* États spécifiques */
.erreur, .msg-error {
    background-color: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
}

.msg-success {
    background-color: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

/* ==========================================================================
   7. LIENS & REGLAGES DIVERS
   ========================================================================== */
.link-container {
    margin-top: 15px;
    text-align: center;
}

.inscription-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    text-decoration: none;
    color: #007bff;
}

.inscription-link:hover {
    text-decoration: underline;
}