* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2E7D32;
    --secondary: #4CAF50;
    --accent: #FF9800;
    --dark: #212121;
    --light: #FAFAFA;
    --gradient: linear-gradient(135deg, #2E7D32 0%, #4CAF50 100%);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* Header & Navigation */
header {
    background: var(--gradient);
    color: white;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-bottom: 3px solid var(--accent);
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    /* background: rgba(255,255,255,0.1); */
}

.download-doc-btn {
    background: var(--accent);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(255,152,0,0.3);
}

.download-doc-btn:hover {
    transform: translateY(-2px) rotate(2deg);
    box-shadow: 0 5px 20px rgba(255,152,0,0.4);
}

.doc-icon {
    font-size: 1.3rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

.nav-links a.active {
    background: var(--accent);
    font-weight: bold;
    border-bottom: 2px solid white;
}

/* Hero Section */
.hero {
    background: var(--gradient);
    color: white;
    padding: 160px 2rem 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><path d="M0,200 Q300,0 600,200 T1200,200 L1200,600 L0,600 Z" fill="rgba(255,255,255,0.08)"/></svg>') no-repeat;
    background-size: cover;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.2s;
    animation-fill-mode: both;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 1s ease 0.4s;
    animation-fill-mode: both;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
}

.btn-primary {
    background: white;
    color: var(--primary);
    font-weight: bold;
}

.btn-primary:hover {
    transform: translateY(-3px) rotate(1deg);
    box-shadow: 0 10px 30px rgba(46,125,50,0.3);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary);
    transform: rotate(-1deg);
}

.btn-download {
    background: var(--accent);
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.btn-download:hover {
    background: #F57C00;
    transform: translateY(-3px) rotate(2deg);
    box-shadow: 0 10px 30px rgba(255,152,0,0.4);
}

/* Stats Section */
.stats {
    background: var(--dark);
    color: white;
    padding: 3rem 2rem;
}

.stats-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item {
    padding: 1rem;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: var(--accent);
}

.stat-label {
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

/* About Section */
.about {
    padding: 5rem 2rem;
    background: var(--light);
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about h2 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    text-align: center;
}

.about-content p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.about-features {
    list-style: none;
    margin-top: 2rem;
}

.about-features li {
    padding: 0.8rem 0;
    padding-left: 2rem;
    position: relative;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.about-features li::before {
    content: '🚀';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 1.2rem;
}

/* Formations Section */
.formations {
    padding: 5rem 2rem;
    background: white;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 3rem;
}

.formations-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.formation-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
    transition: all 0.3s;
    cursor: pointer;
    display: flex;              
    flex-direction: column;    
    height: 100%;               
}

.formation-content {
    padding: 1.5rem;
    display: flex;            
    flex-direction: column;    
    flex-grow: 1;              
}

.formation-description {
    flex-grow: 1;           
    margin-bottom: 1rem;
}

.formation-details {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.formation-card:hover {
    transform: translateY(-10px) rotate(1deg);
    box-shadow: 0 15px 50px rgba(0,0,0,0.2);
}

.formation-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.formation-content h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.formation-detail {
    text-align: center;
}

.formation-detail-label {
    font-size: 0.9rem;
    color: #666;
}

.formation-detail-value {
    font-weight: bold;
    color: var(--primary);
    font-size: 1.1rem;
}

/* Contact Section */
.contact {
    padding: 5rem 2rem;
    background: var(--light);
}

.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;             
    gap: 4rem;
    align-items: center;        
    justify-content: center;    
}

.contact-info {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
    flex: 0 1 auto;            
}

.contact-form {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
    flex: 0 1 auto;            
}

.contact-info h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 10px;
    background: var(--light);
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-weight: 600;
}

.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Nouveaux styles pour le champ téléphone avec select */
.phone-input-container {
    display: flex;
    gap: 0;
    align-items: stretch;
    width: 100%;
}

#country-select {
    flex: 0 0 120px;  /* Largeur fixe pour le select */
    padding: 0.8rem 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px 0 0 10px;  /* Arrondi à gauche */
    background: white;
    font-size: 1rem;
    cursor: pointer;
    border-right: none;  /* Fusion avec input */
}

#country-select:focus {
    outline: none;
    border-color: var(--primary);
}

#telephone {
    flex: 1;  /* Prend le reste */
    border-left: none;  /* Fusion */
    border-radius: 0 10px 10px 0;
    padding: 0.8rem;
}

#telephone:focus {
    border-color: var(--primary);
}

/* États valid/error pour le container */
.phone-input-container.valid {
    border-color: var(--accent) !important;
}

.phone-input-container.error {
    border-color: #ff0000 !important;
}

.phone-error {
    color: #ff0000;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.submit-btn {
    background: var(--gradient);
    color: white;
    padding: 1rem 3rem;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.submit-btn:hover {
    transform: translateY(-3px) rotate(1deg);
    box-shadow: 0 10px 30px rgba(46,125,50,0.4);
}

/* Map Section */
.map-section {
    padding: 5rem 2rem;
    background: white;
}

.map-container {
    max-width: 1200px;
    margin: 0 auto;
}

.map-frame {
    width: 100%;
    height: 450px;
    border: none;
    border-radius: 20px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
}

/* Documents Section */
.documents {
    padding: 5rem 2rem;
    background: var(--light);
}

.info-list-pro {
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

.info-list-pro li {
    padding: 0.5rem 0;
    border-bottom: 1px dashed #eee;
    font-size: 1rem;
}

.info-list-pro li:last-child {
    border-bottom: none;
}

.info-list-pro strong {
    color: var(--dark);
    display: inline-block;
    min-width: 150px; 
    margin-right: 10px;
}

.info-contact-pro {
    background: #E8F5E8; 
    padding: 1rem;
    border-radius: 10px;
    border-left: 5px solid var(--secondary);
    margin-top: auto;
}

.info-contact-pro p {
    margin: 0.5rem 0;
}

.info-note-pro {
    background: #FFF3E0; 
    padding: 1rem;
    border-radius: 10px;
    border-left: 5px solid var(--accent);
    margin-top: 1rem;
    font-style: italic;
    font-size: 0.95rem;
}

.etablissements-list-pro {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-top: 1rem;
}

.etablissement-item {
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.etablissement-item:hover {
    transform: scale(1.02);
}

.etablissement-item h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.etablissement-item p {
    margin: 0.5rem 0;
    font-size: 1rem;
    color: #555;
}

.etablissement-item.active {
    background: #E8F5E8; 
    border-left: 5px solid var(--secondary);
}

.etablissement-item.closed {
    background: #FBE9E7;
    border-left: 5px solid #FF7043;
}

.documents-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 2rem;
    padding: 1rem;
}

.document-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
    text-align: left;
    transition: all 0.3s;
    flex: 1 1 45%;
    min-height: 400px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.document-card:hover {
    transform: translateY(-5px) rotate(0.5deg);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.full-width {
    flex: 1 1 100%;
    max-width: 100%;
    min-height: auto;
}

/* Footer */
footer {
    background: var(--dark);
    color: white;
    padding: 3rem 2rem 1rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--accent);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #444;
    color: #999;
}

#map {
    width: 100%;
    height: 450px;
    border-radius: 20px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
}

/* Styles pour la validation téléphone (adaptés) */
.iti {
    width: 100%;
    display: flex; 
}

.iti input[type=tel] {
    flex-grow: 1; 
    border-radius: 0 10px 10px 0;
    border-left: none;
}

.iti__country-list {
    /* z-index: 1000 !important;  */
    display: none;
}

.iti.iti--show-dropdown .iti__country-list {
    position: absolute; 
    cursor: default;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
}

.iti__flag-container {
    display: flex;
    align-items: center;
    border-radius: 10px 0 0 10px; 
    border-right: 2px solid #e0e0e0; 
    border: 2px solid #e0e0e0;
    padding: 0 0.8rem;
    cursor: pointer;
    height: 100%; 
    z-index: 2;
}

.iti__selected-flag {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.iti.allow-dropdown.separate-dial-code:hover .iti__selected-flag,
.iti.allow-dropdown.separate-dial-code.open-flag-container .iti__selected-flag {
    background: none;
}

.iti.iti--allow-dropdown.iti--separate-dial-code.iti--show-dropdown .iti__selected-flag,
.iti.iti--allow-dropdown.iti--separate-dial-code.iti--show-dropdown input[type=tel] {
    border-color: var(--primary);
}

.error {
    border-color: #ff0000 !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 0, 0, 0.25);
}

.valid {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25);
}

.iti__error-message {
    color: #ff0000;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.iti__valid {
    color: var(--accent);
}

#menu-toggle {
    display: none; 
}

/* Cache l'icône par défaut (sur les grands écrans) */
.menu-icon {
    display: none; 
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
    color: white;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .document-card {
        flex: 1 1 100%;
        min-height: auto;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .nav-links {
        display: none;
    }

    .logo {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .download-doc-btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .contact-container {
        flex-direction: column;
        gap: 2rem;
        align-items: stretch;
    }

    .about-container,
    .contact-container {
        grid-template-columns: 1fr;
    }

    .formations-grid {
        grid-template-columns: 1fr;
    }

    #country-select {
        flex: 0 0 100px;  /* Réduire sur mobile */
    }

    /* AFFICHAGE DE L'ICÔNE HAMBURGER */
    .menu-icon {
        display: block;
    }

    /* CACHE LE MENU PAR DÉFAUT EN MOBILE */
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px; /* Aligné sous le header */
        left: 0;
        width: 100%;
        background: var(--gradient);
        color: white;
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
        padding: 1rem 0;
        z-index: 999;
    }

    .nav-links li {
        text-align: center;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        display: block;
        padding: 0.5rem 0;
        border-radius: 0;
    }
    
    /* RÈGLE CLÉ : AFFICHE LE MENU QUAND LE TOGGLE EST COCHÉ */
    #menu-toggle:checked ~ .nav-links {
        display: flex;
    }
}

/* --- NOUVELLE MISE EN PAGE HERO SECTION POUR PLUS DE PROFESSIONNALISME --- */

.hero {
    min-height: 80vh; /* Augmenter la hauteur pour donner de l'espace */
    padding: 10rem 2rem 5rem 2rem; /* padding ajusté pour header fixe */
    background: var(--light); 
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex; /* Active la grille */
    align-items: center;
    gap: 40px; /* Espace entre les colonnes */
}

.hero-content {
    flex: 2; /* Prend plus de place pour le texte (env. 60%) */
    padding-right: 30px;
    animation: fadeInUp 1s ease-out;
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    color: var(--dark); 
    margin-bottom: 1.5rem;
}

.hero-content p {
    font-size: 1.25rem;
    color: #555;
    margin-bottom: 2rem;
}

.tagline {
    display: inline-block;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.cta-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap; 
}

.btn-lg {
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.certif-link {
    display: block;
    margin-top: 1.5rem;
    color: var(--secondary);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s;
}

.certif-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.hero-image-placeholder {
    flex: 1; /* Prend le reste de l'espace (env. 40%) */
    min-height: 400px;
    background: #f0f0f0; 
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    /* Ajoutez ici le style pour votre image de fond ou une balise <img> dans le HTML */
    background-size: cover;
    background-position: center;
    /* Remplacer ceci par l'image */
    background-image: url('https://via.placeholder.com/400x500?text=Visuel+Engin+TP+ou+Camion');
}

/* --- AMÉLIORATION DE LA SECTION STATS (Barre de confiance) --- */

.stats {
    background: var(--primary); /* Fond couleur primaire pour le contraste */
    color: var(--light);
    padding: 30px 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    margin-bottom: 40px; /* Espace avec la section suivante */
}

.stats-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    flex: 1;
    min-width: 150px;
    animation: fadeInUp 1.2s ease-out;
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--accent); /* Couleur d'accentuation pour les icônes */
    margin-bottom: 5px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .hero-container {
        flex-direction: column; /* Colonnes empilées */
        text-align: center;
    }
    
    .hero-content {
        padding-right: 0;
        margin-bottom: 40px;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-image-placeholder {
        width: 100%;
        min-height: 300px;
    }

    .cta-buttons {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .stats-container {
        flex-direction: column; /* Les stats s'empilent sur très petit écran */
        align-items: center;
    }

    .stat-item {
        min-width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    .stat-item:last-child {
        border-bottom: none;
    }
}
