/* Variables pour les couleurs */
:root {
    --primary-dark: #011746; /* Votre bleu foncé/primaire */
    --accent-orange: #e76f23; /* Votre orange/couleur d'accent */
    --light-gray: #f4f4f4;
    --text-color: #555;
    --white: #fff;
    /* Ajoutez des variables RGB si vous les utilisez dans rgba() */
    --primary-dark-rgb: 1, 23, 70;
    --accent-orange-rgb: 231, 111, 35;
}

/* Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
}

.container {
    width: 80%;
    max-width: 1200px;
    margin: auto;
    overflow: hidden;
    padding: 0 15px;
}

a {
    color: var(--accent-orange);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

h1, h2, h3 {
    color: var(--primary-dark);
    margin-bottom: 15px;
}

/* Boutons */
.btn-primary {
    display: inline-block;
    background: var(--accent-orange);
    color: var(--white);
    padding: 12px 25px;
    border-radius: 5px;
    text-align: center;
    transition: background 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    text-decoration: none;
}

.btn-primary:hover {
    background: #c55d1c;
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    background: #a94f15;
}

.btn-secondary {
    display: inline-block;
    background: var(--primary-dark);
    color: var(--white);
    padding: 12px 25px;
    border-radius: 5px;
    text-align: center;
    transition: background 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    text-decoration: none;
}

.btn-secondary:hover {
    background: #000c24;
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
    background: #000713;
}

.btn-contact {
    display: inline-block;
    background: transparent;
    color: var(--primary-dark);
    padding: 10px 20px;
    border: 2px solid var(--accent-orange);
    border-radius: 5px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: bold;
}

.btn-contact:hover {
    background: var(--accent-orange);
    color: var(--white);
}

/* Header */
.main-header {
    background: var(--white);
    padding: 20px 0;
    border-bottom: 1px solid var(--light-gray);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content .logo img {
    height: 100px;
}

.main-nav {
    display: block;
}

.main-nav ul {
    display: flex;
}

.main-nav ul li {
    margin-left: 30px;
}

.main-nav ul li a {
    color: var(--primary-dark);
    font-weight: bold;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.main-nav ul li a:hover {
    color: var(--accent-orange);
    text-decoration: none;
}

/* Menu Toggle (Hamburger) */
.menu-toggle {
    display: none; /* Hidden by default on larger screens */
    background: transparent;
    border: none;
    font-size: 2em;
    color: var(--primary-dark);
    cursor: pointer;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    height: 100%;
    width: 0; /* Initially hidden */
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    background-color: rgba(0,0,0,0.9);
    overflow-x: hidden;
    transition: 0.5s;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.mobile-menu-overlay .close-btn {
    position: absolute;
    top: 20px;
    right: 45px;
    font-size: 60px;
    color: var(--white);
    text-decoration: none;
    transition: 0.3s;
}

.mobile-menu-overlay .close-btn:hover {
    color: var(--accent-orange);
}

.mobile-menu-content {
    text-align: center;
    padding: 20px;
}

.mobile-menu-content ul li {
    margin: 20px 0;
}

.mobile-menu-content ul li a {
    padding: 8px 16px;
    text-decoration: none;
    font-size: 25px;
    color: var(--white);
    display: block;
    transition: 0.3s;
    text-transform: uppercase;
}

.mobile-menu-content ul li a:hover {
    color: var(--accent-orange);
    background-color: rgba(255,255,255,0.1);
    border-radius: 5px;
}

/* Hero Section */
.hero-section {
    background-image: url('img/bg.jpg');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 120px 0;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    width: 100%;
}

.hero-text {
    padding: 0 20px;
}

.hero-text h1 {
    font-size: 4em;
    margin-bottom: 25px;
    color: var(--white);
}

.hero-text p {
    font-size: 1.4em;
    margin-bottom: 40px;
    line-height: 1.7;
    color: var(--white);
}

/* About Section (Présentation) */
.about-section {
    padding: 80px 0;
    background: var(--light-gray);
    text-align: center;
}

.about-section h2 {
    font-size: 2.8em;
    margin-bottom: 25px;
}

.about-section > p {
    font-size: 1.2em;
    max-width: 800px;
    margin: 0 auto 50px auto;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.about-item {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.about-item:hover {
    transform: translateY(-8px);
}

.about-item h3 {
    color: var(--accent-orange);
    font-size: 1.6em;
    margin-bottom: 10px;
}

.about-item p {
    font-size: 1.1em;
}

/* Services Overview */
.services-overview {
    padding: 80px 0;
    background: var(--white);
    text-align: center;
}

.services-overview h2 {
    font-size: 2.8em;
    margin-bottom: 50px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.service-item {
    padding: 30px;
    border: 1px solid var(--light-gray);
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: var(--white);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.service-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.service-item .icon {
    font-size: 3.5em;
    color: var(--accent-orange);
    margin-bottom: 20px;
    display: block;
}

.service-item h3 {
    font-size: 1.8em;
    color: var(--primary-dark);
    margin-bottom: 15px;
}

.service-item p {
    font-size: 1.1em;
    line-height: 1.7;
}

/* CTA Section (Pourquoi nous choisir) */
.cta-section {
    background: var(--primary-dark);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

.cta-section h2 {
    color: var(--white);
    font-size: 3em;
    margin-bottom: 40px;
}

.why-choose-us {
    list-style: none;
    padding: 0;
    margin: 0 auto 50px auto;
    max-width: 800px;
    text-align: left;
}

.why-choose-us li {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: var(--white);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
}

.why-choose-us li .fas {
    color: var(--accent-orange);
    margin-right: 15px;
    font-size: 1.5em;
    margin-top: 2px;
}

/* Footer */
.main-footer {
    background: var(--primary-dark);
    color: var(--white);
    padding: 60px 0 30px;
    font-size: 0.95em;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.footer-logo img {
    height: 100px;
    /* This filter makes the logo white. Adjust if your logo is already white or needs a different treatment. */
    filter: brightness(0) invert(1);
    margin-bottom: 20px;
}

.footer-links, .footer-contact, .footer-social {
    flex: 1;
    min-width: 250px;
    margin-bottom: 30px;
    padding: 0 15px;
}

.footer-links h3, .footer-contact h3, .footer-social h3 {
    color: var(--white);
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding-bottom: 10px;
    font-size: 1.4em;
}

.footer-links ul li {
    margin-bottom: 12px;
}

.footer-links ul li a {
    color: var(--white);
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.footer-links ul li a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-contact p {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
}

.footer-contact p .fas {
    margin-right: 10px;
    margin-top: 3px;
    color: var(--accent-orange);
}

.footer-social a {
    color: var(--white);
    font-size: 1.8em;
    margin-right: 15px;
    transition: color 0.3s ease;
}

.footer-social a:hover {
    color: var(--accent-orange);
}

/* Edit Mode Authentication and Controls in Footer */
.footer-social .edit-mode-auth,
.footer-social .edit-mode-controls {
    display: flex;
    flex-wrap: wrap; /* Allows items to wrap for responsiveness */
    gap: 10px; /* Space between input and buttons */
    margin-top: 20px; /* Add some space above */
    justify-content: center; /* Center items for better aesthetic in footer */
    align-items: center; /* Vertically align items */
}

.footer-social .form-type {
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-size: 1em;
    width: 100%; /* Take full width on smaller screens */
    max-width: 250px; /* Limit max width on larger screens */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.footer-social .form-type::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Ensure buttons in edit mode adapt correctly */
.edit-mode-auth .btn-primary,
.edit-mode-controls .btn-primary,
.edit-mode-controls .btn-secondary {
    padding: 10px 20px;
    font-size: 0.9em;
    width: auto; /* Buttons adjust to content */
    flex-grow: 1; /* Allow buttons to grow and fill space, especially on smaller screens */
    min-width: 120px; /* Ensure buttons don't become too small */
}

/* Footer bottom */
.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 25px;
    margin-top: 25px;
    opacity: 0.7;
}

/* Responsive design */
@media (max-width: 992px) {
    .main-nav {
        display: none; /* Hide main navigation on tablets/smaller desktops */
    }

    .menu-toggle {
        display: block; /* Show hamburger icon */
    }

    .header-content {
        /* Keep existing styles, they work well for centering on smaller screens if flex-wrap occurs */
        flex-wrap: wrap;
        justify-content: center;
    }

    .logo {
        width: 100%;
        text-align: center;
        margin-bottom: 15px;
    }

    /* Adjust button contact in header for smaller screens */
    .header-content .btn-contact {
        margin-top: 15px;
        width: 100%; /* Make it full width below logo and menu toggle */
        order: 3; /* Push it to the bottom if wrapped */
    }

    .hero-text h1 {
        font-size: 3em; /* Slightly smaller font for hero title */
    }

    .hero-text p {
        font-size: 1.2em; /* Slightly smaller font for hero description */
    }

    .cta-section .btn-primary {
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        width: 90%; /* Wider container on smaller screens */
    }

    .about-grid, .services-grid {
        grid-template-columns: 1fr; /* Single column layout for grids */
    }

    .footer-content {
        flex-direction: column; /* Stack footer columns vertically */
        text-align: center; /* Center align text in footer columns */
    }
    
    .footer-links, .footer-contact, .footer-social {
        padding: 0; /* Remove horizontal padding for footer columns */
        min-width: unset; /* Remove min-width constraint */
        width: 100%; /* Ensure they take full width */
        margin-bottom: 20px; /* Adjust spacing between stacked footer sections */
    }

    /* Refined styles for edit mode elements within the footer */
    .footer-social .edit-mode-auth,
    .footer-social .edit-mode-controls {
        flex-direction: column; /* Stack input and buttons vertically */
        align-items: center; /* Center items for column layout */
    }

    .footer-social .form-type {
        max-width: 100%; /* Ensure input takes full width */
        margin-bottom: 10px; /* Add space below input when stacked */
    }

    .edit-mode-auth .btn-primary,
    .edit-mode-controls .btn-primary,
    .edit-mode-controls .btn-secondary {
        width: 100%; /* Buttons take full width */
        max-width: 250px; /* Apply max-width to buttons for better readability */
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 2.5em; /* Even smaller font for hero title on very small screens */
    }

    .hero-text p {
        font-size: 1.1em; /* Even smaller font for hero description */
    }

    .mobile-menu-overlay .close-btn {
        font-size: 45px; /* Smaller close button on very small screens */
        right: 20px;
    }

    .mobile-menu-content ul li a {
        font-size: 20px; /* Smaller font for mobile menu links */
    }

    .about-section h2,
    .services-overview h2,
    .cta-section h2 {
        font-size: 2em; /* Smaller section titles on mobile */
    }
}