/* =========================================
   1. STYLES GLOBAUX & RESET
   ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { color: #333; background-color: #f9fbfd; line-height: 1.6; }

/* =========================================
   2. HEADER & NAVIGATION
   ========================================= */
header { background: #ffffff; box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; display: flex; justify-content: space-between; align-items: center; padding: 1rem 5%; }
.logo, .logo a { font-size: 1.2rem; font-weight: bold; color: #1a365d; text-decoration: none; transition: color 0.3s; }
.logo a:hover { color: #2b6cb0; }
nav { display: flex; align-items: center; }
nav a { text-decoration: none; color: #4a5568; margin-left: 2rem; font-weight: 500; transition: color 0.3s; }
nav a:hover, nav a.active { color: #2b6cb0; }
nav a.btn-nav { background-color: #2b6cb0; color: white; padding: 0.5rem 1rem; border-radius: 4px; }
nav a.btn-nav:hover { background-color: #2c5282; color: white; }

/* Menu Burger */
.menu-toggle { display: none; flex-direction: column; cursor: pointer; gap: 5px; background: none; border: none; }
.menu-toggle span { width: 25px; height: 3px; background-color: #1a365d; border-radius: 2px; transition: 0.3s; }

/* =========================================
   3. HERO SECTION
   ========================================= */
.hero { background: linear-gradient(rgba(26, 54, 93, 0.8), rgba(26, 54, 93, 0.8)), url('https://images.unsplash.com/photo-1629909613654-28e377c37b09?auto=format&fit=crop&w=1920&q=80') no-repeat center center/cover; color: white; padding: 10rem 5% 6rem; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hero h1 { font-size: 2.5rem; margin-bottom: 1.5rem; max-width: 800px; }
.hero p { font-size: 1.2rem; margin-bottom: 2rem; max-width: 700px; color: #edf2f7; }
.hero-buttons { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

/* =========================================
   4. FEATURES & PREREQUISITE
   ========================================= */
.features { padding: 5rem 5%; max-width: 1200px; margin: 0 auto; }
.features-title { text-align: center; margin-bottom: 3rem; }
.features-title h2 { font-size: 2rem; color: #1a365d; margin-bottom: 0.5rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.feature-card { background: white; padding: 2.5rem 2rem; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); border-top: 4px solid #3182ce; transition: transform 0.3s; }
.feature-card:hover { transform: translateY(-5px); }
.feature-card h3 { font-size: 1.3rem; color: #2d3748; margin-bottom: 1rem; }
.feature-card p { color: #4a5568; }
.prerequisite { background-color: #ebf8ff; border-left: 5px solid #3182ce; padding: 2rem 5%; max-width: 1000px; margin: 0 auto 5rem; border-radius: 0 8px 8px 0; }
.prerequisite h3 { color: #2b6cb0; margin-bottom: 0.5rem; }
.prerequisite p { color: #2d3748; }

/* =========================================
   5. CONTAINERS & CARDS
   ========================================= */
.container { max-width: 1000px; margin: 8rem auto 4rem; padding: 0 5%; }
.card { background: white; padding: 3rem; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); text-align: center; }
.card h1 { color: #1a365d; font-size: 1.8rem; margin-bottom: 1rem; }
.card p { color: #2d3748; font-size: 1.1rem; margin-bottom: 2rem; }

/* =========================================
   6. PAGE PROGRAMME
   ========================================= */
.formation-header { background: #1a365d; color: white; padding: 2.5rem; border-radius: 8px 8px 0 0; text-align: center; }
.formation-header h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.formation-header p { font-size: 1.1rem; color: #edf2f7; }
.formation-content { background: white; padding: 3rem; border-radius: 0 0 8px 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); margin-bottom: 3rem; }
.formation-content h2 { color: #1a365d; margin: 2rem 0 1rem; font-size: 1.5rem; border-bottom: 2px solid #ebf8ff; padding-bottom: 0.5rem; }
.formation-content h2:first-of-type { margin-top: 0; }
.formation-content h3 { color: #2b6cb0; margin: 1.5rem 0 0.5rem; font-size: 1.2rem; }
.formation-content p, .formation-content li { color: #2d3748; margin-bottom: 0.6rem; }
.formation-content ul { list-style-type: disc; margin: 0 0 1rem 1.5rem; }
.price-tag { background: #ebf8ff; border-left: 5px solid #3182ce; padding: 1.5rem; margin: 2rem 0; font-size: 1.3rem; font-weight: bold; color: #2b6cb0; border-radius: 0 8px 8px 0; }

/* =========================================
   7. ALERTES & MESSAGES
   ========================================= */
.alert-success { color: #2f855a; background-color: #f0fff4; border: 1px solid #c6f6d5; padding: 1rem; border-radius: 6px; margin-bottom: 2rem; }
.alert-error { color: #c53030; background-color: #fff5f5; border: 1px solid #fed7d7; padding: 1rem; border-radius: 6px; margin-bottom: 2rem; text-align: left; }

/* =========================================
   8. FORMULAIRES
   ========================================= */
.form-section { background: white; padding: 3rem; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); }
.form-section h2 { color: #1a365d; margin-bottom: 2rem; text-align: center; font-size: 1.8rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.form-group { margin-bottom: 1.5rem; min-width: 0; }
.form-group.full-width { grid-column: span 2; }
label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: #2d3748; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea { width: 100%; padding: 0.9rem; border: 1px solid #cbd5e0; border-radius: 6px; font-size: 1rem; color: #2d3748; background-color: #ffffff; transition: all 0.3s; }
input::placeholder, textarea::placeholder { color: #cbd5e0; opacity: 1; }
input:not(:placeholder-shown), textarea:not(:placeholder-shown) { background-color: #f7fafc; border-color: #a0aec0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #3182ce; background-color: #ffffff; box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1); }
textarea { resize: vertical; min-height: 120px; }
.radio-group { display: flex; gap: 2rem; margin-top: 0.5rem; flex-wrap: wrap; }
.radio-option { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.form-buttons { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.form-actions { text-align: center; margin-top: 25px; }

/* =========================================
   9. BOUTONS
   ========================================= */
.btn { display: inline-block; padding: 0.9rem 2rem; border-radius: 6px; font-size: 1rem; font-weight: bold; text-decoration: none; cursor: pointer; border: none; transition: background 0.3s; }
.btn-primary, .btn-submit { background-color: #3182ce; color: white; }
.btn-primary:hover, .btn-submit:hover { background-color: #2b6cb0; }
.btn-secondary { background-color: transparent; color: white; border: 2px solid white; }
.btn-secondary:hover { background-color: white; color: #1a365d; }
.btn-reset { background-color: #e2e8f0; color: #4a5568; }
.btn-reset:hover { background-color: #cbd5e0; }
.btn-submit-balanced { display: inline-block; min-width: 250px; background-color: #0056b3; color: #ffffff; border: none; padding: 12px 30px; font-size: 1.05em; font-weight: bold; border-radius: 6px; cursor: pointer; transition: background-color 0.2s, box-shadow 0.2s; }
.btn-submit-balanced:hover { background-color: #004085; box-shadow: 0 4px 12px rgba(0, 86, 179, 0.25); }

/* =========================================
   10. PAGES LÉGALES & FOOTER
   ========================================= */
footer { background-color: #1a365d; color: white; text-align: center; padding: 2rem 5%; font-size: 0.9rem; margin-top: 4rem; }
footer p { color: #cbd5e0; }
.legal-container { max-width: 900px; margin: 40px auto; background: #ffffff; padding: 40px 50px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); text-align: left; }
.legal-container h1 { color: #0056b3; margin-bottom: 30px; font-size: 2em; border-bottom: 2px solid #eef2f7; padding-bottom: 15px; }
.legal-container h2 { color: #333333; margin: 30px 0 15px; font-size: 1.3em; }
.legal-container p, .legal-container li { color: #2d3748; line-height: 1.6; font-size: 1.05em; }
.legal-list { list-style-type: disc; padding-left: 20px; margin-bottom: 20px; }
.legal-list li { margin-bottom: 8px; }
.legal-footer-btn { margin-top: 40px; text-align: center; }

/* =========================================
   11. PANNEAU ADMIN
   ========================================= */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.5); }
.modal-content { background-color: #fefefe; margin: 5% auto; padding: 25px; border: 1px solid #888; width: 90%; max-width: 700px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.close { color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer; }
.close:hover, .close:focus { color: black; text-decoration: none; }
.detail-row { margin-bottom: 12px; border-bottom: 1px solid #eee; padding-bottom: 8px; }
.detail-label { font-weight: bold; color: #333; display: inline-block; width: 180px; }
.btn-detail { background-color: #007bff; color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 0.85em; text-decoration: none; }
.btn-detail:hover { background-color: #0056b3; }
.btn-valider { background-color: #28a745; color: white; border: none; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-size: 1em; font-weight: bold; }
.btn-valider:hover { background-color: #218838; }
.btn-rappel { background-color: #ffc107; color: #333; border: none; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-size: 1em; font-weight: bold; }
.btn-rappel:hover { background-color: #e0a800; }
.btn-inscrire { background-color: #17a2b8; color: white; border: none; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-size: 1em; font-weight: bold; }
.btn-inscrire:hover { background-color: #138496; }
.btn-export { background-color: #6c757d; color: white; border: none; padding: 8px 14px; border-radius: 4px; cursor: pointer; font-size: 0.9em; font-weight: bold; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn-export:hover { background-color: #5a6268; color: white; }
.alert-flash { background-color: #d4edda; color: #155724; padding: 12px; border-radius: 4px; margin-bottom: 20px; border: 1px solid #c3e6cb; }
.admin-section { background: #f9f9f9; padding: 20px; border-radius: 6px; margin-bottom: 30px; border: 1px solid #e1e1e1; }
.badge-traite { background-color: #d4edda; color: #155724; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 0.85em; }
.badge-inscrit { background-color: #d1ecf1; color: #0c5460; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 0.85em; }
.admin-tabs { display: flex; gap: 5px; border-bottom: 2px solid #ddd; margin-bottom: 25px; padding-bottom: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.tab-btn { background: #f1f1f1; border: none; padding: 10px 12px; font-size: 0.9em; font-weight: bold; cursor: pointer; border-radius: 6px 6px 0 0; color: #555; transition: background 0.2s, color 0.2s; white-space: nowrap; }
.tab-btn:hover { background: #e2e2e2; }
.tab-btn.active { background: #007bff; color: white; border-bottom: 2px solid #007bff; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-badge { background: rgba(0,0,0,0.15); padding: 2px 6px; border-radius: 10px; font-size: 0.85em; margin-left: 6px; }
.tab-btn.active .tab-badge { background: rgba(255,255,255,0.25); }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin: 25px 0 5px; }
.page-link { display: inline-block; padding: 8px 13px; border-radius: 5px; background-color: #f1f1f1; color: #333; text-decoration: none; font-size: 0.9em; font-weight: bold; border: 1px solid #e1e1e1; transition: background-color 0.2s; }
.page-link:hover { background-color: #e2e2e2; }
.page-link.active { background-color: #007bff; color: white; border-color: #007bff; }
.page-link.disabled { color: #bbb; background-color: #f8f8f8; cursor: not-allowed; }
.page-ellipsis { padding: 0 4px; color: #999; }

/* =========================================
   12. LIENS (traitements.php)
   ========================================= */
.formation-content p a, .formation-content ul li a { color: #1d4ed8; text-decoration: none; font-weight: 500; transition: color 0.2s ease, border-bottom-color 0.2s ease; border-bottom: 1px solid rgba(29, 78, 216, 0.3); }
.formation-content p a:hover, .formation-content ul li a:hover { color: #1e3a8a; border-bottom-color: #1e3a8a; }
.formation-content .price-tag a, .formation-content a.cta-link { display: inline-block; background-color: #f8fafc; color: #1d4ed8; padding: 2px 8px; border-radius: 4px; font-weight: 600; text-decoration: none; border: 1px solid #cbd5e1; transition: all 0.2s ease; }
.formation-content .price-tag a:hover, .formation-content a.cta-link:hover { background-color: #eff6ff; border-color: #3b82f6; color: #1e40af; border-bottom: 1px solid #3b82f6; }
.formation-content a.cta-link { background-color: #0056b3; color: #ffffff !important; padding: 10px 22px; margin-top: 5px; border: none !important; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
.formation-content a.cta-link:hover { background-color: #004085; text-decoration: none; }

/* =========================================
   13. RESPONSIVE DESIGN (MOBILE)
   ========================================= */
@media(max-width: 768px) {
    .menu-toggle { display: flex; }
    nav { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; width: 100%; background-color: #ffffff; box-shadow: 0 4px 6px rgba(0,0,0,0.1); padding: 1.5rem 0; text-align: center; }
    nav.active { display: flex; }
    nav a { margin: 0.8rem 0; }
    nav a.btn-nav { display: inline-block; width: 80%; margin: 0.8rem auto 0; }
    .form-section, .formation-content { padding: 1.5rem; }
    .form-grid { grid-template-columns: 1fr; }
    .form-group.full-width { grid-column: span 1; }
    .hero h1 { font-size: 2rem; }
}