html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #fff;
    color: #222;
    display: flex; /* layout pour footer collant en bas */
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Faire en sorte que le contenu principal pousse le footer en bas */
main {
    flex: 1 0 auto; /* prend l'espace restant */
}

/* Header */
header {
    background: #fff;
    padding: 20px 0 0 0;
}
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    text-decoration: none;
    display: block;
    line-height: 0;
}
.logo img {
    height: 48px;
    transition: opacity .2s;
}
.logo:hover img {
    opacity: 0.8;
}
nav {
    display: flex;
    gap: 30px;
    margin-left: auto;
    margin-right: 30px;
}
nav a {
    text-decoration: none;
    color: #222;
    font-size: 16px;
    font-weight: 500;
}
.btn-header {
    background: #197cc6;
    color: #fff;
    padding: 16px 40px;
    font-size: 1.15rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background .2s;
}
.btn-header:hover {
    background: #17609a;
}

/* Hero */
.hero {
    position: relative;
    height: min(800px, 100vh);
    margin-top: 20px;
    margin-bottom: 0;
}
.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.40);
}
.hero-content {
    position: absolute;
    top: 30%;
    left: 5%;
    right: 5%;
    max-width: 1200px;
    margin: 0 auto;
    color: #fff;
    padding: 0 20px;
}
.hero-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}
.hero-content p {
    font-size: 1.2rem;
    margin: 10px 0 24px 0;
}
.hero-buttons {
    display: flex;
    gap: 18px;
}
.btn-primary, .btn-secondary {
    padding: 12px 28px;
    border-radius: 6px;
    border: none;
    font-weight: 500;
    text-decoration: none;
    font-size: 16px;
    transition: background .2s, color .2s, border .2s;
}
.btn-primary {
    background: #197cc6;
    color: #fff;
}
.btn-primary:hover {
    background: #17609a;
}
.btn-secondary {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}
.btn-secondary:hover {
    background: #fff;
    color: #197cc6;
}

/* Stats */
.stats {
    background: #f9f9f9;
    padding: 30px 0;
    border-radius: 10px;
    margin: 0 0 40px 0;
    margin-top: 0;
    box-shadow: 0 2px 16px rgba(0,0,0,0.03);
}
.stats-container {
    display: flex;
    justify-content: center;
    gap: 80px;
}
.stat {
    text-align: center;
}
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #197cc6;
}
.stat-label {
    font-size: 1rem;
    color: #444;
}

/* Services */
.services {
    margin: 40px 0;
}
.services h2 {
    color: #197cc6;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 32px;
}
.services-list {
    display: flex;
    gap: 40px;
}
.service-card {
    background: #222;
    color: #fff;
    border-radius: 8px;
    overflow: hidden;
    width: 300px;
    position: relative;
    box-shadow: 0 1px 8px rgba(0,0,0,0.10);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: block;
    cursor: pointer;
}
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.20);
}
.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    pointer-events: none;
}
.service-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    opacity: 0.8;
    display: block;
}
.service-title {
    position: absolute;
    bottom: 16px;
    left: 18px;
    font-size: 1.18rem;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.22);
    z-index: 1;
}

/* About */
.about {
    margin: 50px 0 40px 0;
    background: #90b9d8;
    padding: 40px 0;
}
.about-container {
    display: flex;
    align-items: center;
    gap: 40px;
    justify-content: space-between;
}
.about-logo img {
    height: 100px;
}
.about-text {
    color: #222;
    font-size: 1.05rem;
    max-width: 650px;
    line-height: 1.7;
    text-align: right;
}

/* Testimonials */
.testimonials {
    margin: 40px 0;
}
.testimonials h2 {
    color: #197cc6;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 32px;
    text-align: center;
}
.testimonials-list {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}
.testimonial-card {
    background: #f9f9f9;
    padding: 24px;
    border-radius: 8px;
    max-width: 350px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}
.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
.testimonial-text {
    color: #444;
    font-size: 1rem;
    line-height: 1.6;
    font-style: italic;
    margin: 0 0 20px 0;
}
.testimonial-author {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.author-name {
    font-weight: 600;
    color: #197cc6;
    font-size: 1rem;
}
.author-position {
    font-size: 0.9rem;
    color: #666;
}

/* Clients */
.clients {
    margin: 40px 0;
    text-align: center;
}
.clients h2 {
    color: #197cc6;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 24px;
}
.clients-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    align-items: center;
}
.clients-list img {
    height: 48px;
    object-fit: contain;
    filter: grayscale(0.2);
    transition: filter .2s;
}
.clients-list img:hover {
    filter: none;
}

/* Footer */
footer {
    /* push footer to the bottom of the page when using flex layout on body */
    margin-top: auto;
    background: #f8f9fa;
    padding: 60px 0 0 0;
}

.footer-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-column h4 {
    color: #197cc6;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 20px 0;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.footer-column ul li a {
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.footer-column ul li a:hover {
    color: #197cc6;
}

.footer-logo {
    height: 60px;
    margin-bottom: 20px;
}

.footer-bottom {
    text-align: center;
    padding: 20px 0;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 600px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .footer-logo {
        margin: 0 auto 20px;
        display: block;
    }
}

/* Mobile menu styles */
.mobile-menu-toggle {
    display: none; /* visible on small screens */
    background: transparent; /* transparent by default */
    border: none;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    color: #000;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .18s ease; /* sync with bars */
}
.mobile-menu-toggle .hamburger {
    display: block;
    width: 22px;
    height: 2px;
    background: #000; /* black bars by default */
    position: relative;
    transition: background .18s ease, transform .18s ease;
}
.mobile-menu-toggle .hamburger::before,
.mobile-menu-toggle .hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    background: #000; /* black */
    transition: background .18s ease, transform .18s ease;
}
.mobile-menu-toggle .hamburger::before { top: -7px; }
.mobile-menu-toggle .hamburger::after { top: 7px; }

.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 2000;
    overflow-y: auto;
}
.mobile-menu-inner { padding: 22px 0 40px; }
.mobile-menu-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mobile-logo img { height: 48px; }
.mobile-menu-close { background: transparent; border: none; font-size: 26px; cursor: pointer; }
.mobile-menu-list { list-style: none; padding: 20px 8px; margin: 0; }
.mobile-menu-list .mobile-item { margin-bottom: 18px; }
.mobile-menu-list a, .mobile-menu-list .submenu-toggle { color: #0b3a3a; text-decoration: none; font-size: 18px; font-weight: 600; display: block; padding: 10px 6px; }
.mobile-cta { padding: 18px 8px; }
.submenu { display: none; list-style: none; margin: 8px 0 0 12px; padding: 0; }
.submenu li { margin-bottom: 10px; }
.chev { float: right; color: #666; }

/* Responsive toggles */
@media (max-width: 900px) {
    nav.desktop-nav { display: none; }
    .mobile-menu-toggle { display: inline-flex; }
    /* hide the header's inline contact button but keep the one inside the mobile menu */
    .header-container > .btn-header { display: none; }
}

/* when body has this class, show the menu */
body.mobile-open { overflow: hidden; }
body.mobile-open #mobileMenu { display: block; }

/* when submenu parent has .open, show submenu */
.has-submenu.open > .submenu { display: block; }

/* Legal Pages */
.legal-content {
    padding: 60px 0 80px 0;
    min-height: 60vh;
}
.legal-content h1 {
    font-size: 2.5rem;
    color: #197cc6;
    margin-bottom: 40px;
    text-align: center;
}
.legal-section {
    margin-bottom: 40px;
}
.legal-section h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 15px;
    margin-top: 30px;
}
.legal-section p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}
.legal-section ul {
    line-height: 1.8;
    color: #555;
    margin-left: 20px;
}
.legal-section li {
    margin-bottom: 8px;
}
.legal-section a {
    color: #197cc6;
    text-decoration: none;
}
.legal-section a:hover {
    text-decoration: underline;
}

/* Page Hero (reusable) */
.page-hero, .team-hero {
    background: #f5f9fd;
    border-top: 2px solid #e2eaf2;
    border-bottom: 2px solid #e2eaf2;
    padding: 40px 0;
    margin-top: 20px; /* espace sous le header */
}

/* Scoped gradient only for the Prestations page hero */
.page-prestations .page-hero {
    /* softer gradient and slightly more vertical space */
    background: linear-gradient(to bottom, rgba(245,249,253,1) 0%, rgba(232,237,243,0.9) 40%, rgba(232,237,243,0.95) 70%);
    border-top: 2px solid #e2eaf2;
    border-bottom: none;
    padding: 50px 0 80px;
    position: relative;
}

.page-prestations .page-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to bottom, rgba(232,237,243,0.95) 0%, rgba(232, 237, 243, 0) 100%);
}
/* ensure hero content sits above any overlays */
.page-prestations .page-hero .container {
    position: relative;
    z-index: 2;
}

/* Ligne bleue entre le bloc 'Nos prestations' (hero) et la première section */
.page-prestations .page-hero {
    border-bottom: 4px solid #217ab7; /* ligne bleue visible sous le hero */
}

/* Ajoute de l'espace entre la bordure et le contenu de la première section */
.page-prestations .prestation-section:first-of-type .container {
    padding-top: 28px;
}

.page-prestations .page-hero h1,
.page-prestations .page-hero p {
    text-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.page-hero h1 {
    margin: 0 0 8px 0;
    color: #197cc6;
    font-size: 2.2rem;
}
.page-hero p {
    margin: 0;
    color: #4a4a4a;
}
/* Reduce spacing right after a page hero */
.page-hero + .legal-content {
    padding-top: 24px; /* default was 60px */
}
.team-section {
    padding: 36px 0 10px 0;
}
.team-title {
    color: #197cc6;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 18px 0;
    position: relative;
}
.team-title::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: #197cc6;
    margin-top: 8px;
}
.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}
.member-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.10);
    transition: transform .2s, box-shadow .2s;
}
.member-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.16);
}
.member-card::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 40%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.45) 50%, rgba(0,0,0,0) 100%);
    pointer-events: none;
    z-index: 1; /* overlay under text */
}
.member-photo {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 0;
}

.member-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px 16px 18px 16px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    z-index: 2; /* above gradient */
}
.member-name {
    margin: 0 0 6px 0;
    font-size: 1.05rem;
    color: #fff;
}
.member-role {
    margin: 0 0 10px 0;
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
}
.member-link {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}
.member-link:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 900px) {
        .stats-container, .services-list, .about-container, .testimonials-list, .clients-list {
        flex-direction: column;
        gap: 32px;
        align-items: center;
    }
    .service-card {
        width: 90vw;
        max-width: 350px;
    }
    .about-logo img {
        height: 80px;
    }
    .testimonial-card {
        max-width: 90vw;
    }
}

@media (max-width: 1100px) {
    .team-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 780px) {
    .team-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .team-grid { grid-template-columns: 1fr; }
}

/* Prestations Page */
.prestation-section {
    padding: 60px 0;
    background: #fff;
}

/* Fond image pour la section électronique */
.electronique-bg {
    background: url('./images/services/service-elec.jpg') center center/cover no-repeat;
    position: relative;
    color: #fff;
}
/* Overlay avec dégradé progressif */
.electronique-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* start lighter (soft white), then gentle mid-tone, then darker at bottom */
    background: linear-gradient(to bottom,
        rgba(255,255,255,0.65) 0%,
        rgba(255,255,255,0.45) 15%,
        rgba(0,0,0,0.08) 45%,
        rgba(0,0,0,0.35) 75%
    );
    z-index: 0;
}
.electronique-bg > .container, .electronique-bg *,
.robotique-bg > .container, .robotique-bg *,
.informatique-bg > .container, .informatique-bg *,
.data-bg > .container, .data-bg * {
    position: relative;
    z-index: 1;
}

/* Fond image pour la section robotique */
.robotique-bg {
    background: url('./images/services/service-proto.jpg') center center/cover no-repeat;
    position: relative;
    color: #fff;
}
/* Overlay plus sombre pour transition progressive */
.robotique-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* slightly darker overall than electronique but still smooth */
    background: linear-gradient(to bottom,
       rgba(0,0,0,0.15) 75%,
        rgba(0,0,0,0.45) 85%,
        rgba(0,0,0,0.6) 100%
    );
    z-index: 0;
}

/* Fond image pour la section informatique */
.informatique-bg {
    background: url('./images/services/service-web.jpg') center center/cover no-repeat;
    position: relative;
    color: #fff;
}

/* Fond image pour la section data */
.data-bg {
    background: url('./images/services/service-data.jpg') center center/cover no-repeat;
    position: relative;
    color: #fff;
}

/* Overlay sombre pour toutes les sections avec fond */

.informatique-bg::before,
.data-bg::before {
    /* deepest section: keep dark but start softer */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:  rgba(0,0,0,0.6) 100%;
    z-index: 0;
}

.prestation-section.alt {
    background: #f8f9fa;
}

/* Ligne bleue entre chaque section de prestations */
.prestation-section + .prestation-section {
    border-top: 4px solid #217ab7; /* ligne bleu conforme au thème */
}

/* Ajuster l'espacement pour que le contenu ne soit pas collé à la bordure */
.prestation-section + .prestation-section .container {
    padding-top: 28px; /* ajoute de l'espace entre la bordure et le contenu */
}

.prestation-header {
    margin-bottom: 30px;
}

.prestation-header h2 {
    color:  #f4f4f4;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 18px 0;
    position: relative;
}

.prestation-header h2::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: #197cc6;
    margin-top: 8px;
}

.prestation-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.prestation-list li {
    background: rgba(0,0,0,0.6) 100%;
    padding: 16px 20px;
    border-left: 4px solid #28b0ca;
    border-radius: 4px;
    box-shadow: 0 2px 4px #197cc6;
    font-size: 1rem;
    color: #ffffff; /* texte par défaut */
    /* animate background-color and color so it fades and text changes color */
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s, color 0.2s;
}

.prestation-list li:hover {
    /* on hover, fade background to white */
    background-color: #ffffff;
    /* make text blue on hover */
    color: #197cc6;
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Ensure links inside list items inherit text color and transition */
.prestation-list li a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

/* If a link has its own hover styles, prefer inheriting color from li on hover */
.prestation-list li:hover a {
    color: inherit;
}

.prestation-section.alt .prestation-list li {
    background: #ffffff;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #197cc6 0%, #17609a 100%);
    color: #fff;
    padding: 80px 0;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.2rem;
    margin: 0 0 16px 0;
    font-weight: 600;
}

.cta-section p {
    font-size: 1.2rem;
    margin: 0 0 32px 0;
    opacity: 0.95;
}

.btn-cta {
    display: inline-block;
    background: #fff;
    color: #197cc6;
    padding: 16px 48px;
    font-size: 1.15rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

/* Contact Section */
.contact-section {
    padding: 60px 0;
}

.contact-form-wrapper {
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.contact-form-wrapper iframe {
    width: 100%;
    height: 500px;
    border: none;
    display: block;
}

@media (max-width: 768px) {
    .prestation-list {
        grid-template-columns: 1fr;
    }
    
    .prestation-header h2 {
        font-size: 1.6rem;
    }
    
    .cta-section h2 {
        font-size: 1.8rem;
    }
    
    .contact-form-wrapper {
        border-radius: 0;
        box-shadow: none;
    }
    /* Mobile: reduce hero height so it fits smaller screens better */
    .hero { height: 360px; }
    
}
