/* Réinitialisation et polices de base */
:root {
    --bg-color: #ffffff; /* Fond blanc */
    --primary-accent: #5e1522; /* Couleur 1 */
    --text-dark: #333333; /* Gris foncé - Couleur 2 */
    --text-light: #555555;
    --card-bg: #f8f9fa; /* Gris très clair pour les cartes */
    --border-color: #dee2e6;
    --section-bg-light: #f8f9fa;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.6;
    /* Fond granuleux appliqué à tout le site pour un effet cohérent */
    background-color: var(--bg-color);
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.7" numOctaves="10" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23n)" opacity="0.07"/></svg>');
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Lien d'évitement pour l'accessibilité */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-accent);
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}


/* Header */
.header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

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

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo img {
    height: 70px; /* Vous pouvez ajuster cette valeur */
    width: auto;
}

/* Nouveau style pour le conteneur du menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    background-color: rgba(255, 255, 255, 0.6); /* Fond blanc semi-transparent */
    backdrop-filter: blur(12px); /* Effet de flou */
    -webkit-backdrop-filter: blur(12px); /* Pour Safari */
    padding: 0.5rem 0.5rem 0.5rem 2rem; /* Padding ajusté */
    border-radius: 50px; /* Bords très arrondis */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Bordure subtile */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); /* Ombre légère */
}

/* Ajustements pour les éléments existants */
.nav-center ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header ul li {
    margin-left: 2rem;
}

.header ul li:first-child {
    margin-left: 0; /* Pas de marge pour le premier élément */
}

.header a {
    color: var(--text-dark);
    text-decoration: none;
    padding: 0.75rem 1rem; /* Padding pour créer de l'espace */
    border-radius: 25px;
    position: relative;
    z-index: 1; /* Pour le contexte d'empilement */
    transition: color 0.4s ease;
    overflow: hidden; /* Cache le pseudo-élément qui dépasse */
}

/* Pseudo-élément pour l'animation du fond */
.header a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--primary-accent);
    border-radius: 25px;
    transform: scale(0); /* Commence à une taille nulle */
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1); /* Animation fluide */
    z-index: -1; /* Se place derrière le texte */
}

.header a:hover {
    color: var(--primary-accent);
}

/* Quand le lien est actif, le texte devient blanc et on anime le fond */
.header a.active {
    color: var(--bg-color) !important;
    pointer-events: none; /* Empêche de cliquer sur le lien de la page actuelle */
}

.header a.active::before {
    transform: scale(1); /* Le fond prend toute la place */
}

.nav-cta-button {
    background-color: var(--primary-accent);
    color: var(--bg-color) !important; /* Important pour surcharger la règle .header a */
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap; /* Empêche le texte de passer à la ligne */
}

.nav-cta-button:hover {
    background-color: #4a101b; /* Une version un peu plus foncée du bordeaux */
    color: var(--bg-color) !important;
    transform: translateY(-2px);
}

/* Bouton Hamburger (caché par défaut sur desktop) */
/* On cible plus spécifiquement pour s'assurer qu'il est bien caché par défaut */
.hamburger-menu {
    display: none;
}

/* Menu mobile (caché par défaut sur tous les écrans) */
.mobile-nav {
    display: none;
}

/* Sections générales */
section {
    padding: 6rem 0;
}

h1, h2 {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

h1 {
    font-size: 3rem;
    font-weight: normal; /* Le texte normal du h1 ne sera pas en gras */
}
h2 { font-size: 2.5rem; text-align: center; margin-bottom: 3rem; }

/* Classe utilitaire pour le texte accentué */
.text-accent {
    color: var(--primary-accent);
}

/* Cible spécifiquement les spans dans le h1 pour ne pas les mettre en gras */
h1 .text-accent {
    font-weight: bold; /* Le texte accentué sera en gras */
}

/* --- Animation du titre H1 --- */
@keyframes fall-down {
    from {
        transform: translateY(-40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.h1-animated span {
    display: inline-block; /* Nécessaire pour appliquer la transformation */
    opacity: 0; /* Initialement invisible */
    animation-fill-mode: forwards; /* Garde l'état final de l'animation */
}

/* Classe pour décaler l'animation de certains mots du H1 */
.h1-animated .delayed-word {
    /* Le script JS calcule le délai de base, on ajoute 0.5s ici */
    animation-delay: calc(var(--animation-order) * 0.15s + 0.5s) !important;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes highlight {
    to {
        background-size: 100% 100%;
    }
}

/* Cible pour le soulignement */
.underline-target {
    position: relative; /* Rend ce mot positionnable */
    /* --- Effet Surligneur --- */
    background-image: linear-gradient(to top, #ffd54f 40%, transparent 40%);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 100%; /* Initialement, le fond est de largeur 0 */
    /* Animation du surlignage */
    animation: highlight 1s cubic-bezier(0.19, 1, 0.22, 1) 1.8s forwards;
    /* --- Fin Effet Surligneur --- */
}

/* Section Héros */
.hero {
    min-height: 100vh; /* La section prend AU MINIMUM 100% de la hauteur de la fenêtre */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; /* Centre le contenu verticalement */
    box-sizing: border-box; /* S'assure que le padding ne fait pas déborder la section */
}

.hero-text {
    text-align: center;
    max-width: 800px;
    padding: 2rem;
    margin-top: 90px;
}

.hero h1 {
    font-size: clamp(2.2rem, 4.5vw, 4rem); /* Responsive font size */
    margin-top: 2rem; /* Ajoute de l'espace au-dessus du titre */
}

.hero p {
    font-size: 1.3rem;
    color: var(--text-light);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
}

.hero-cta-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    /* Animation d'apparition */
    opacity: 0; /* État initial invisible */
    animation: fade-in-up 0.6s ease-out 2.2s forwards;
}

.hero-partners {
    margin-top: 4rem; /* Espace entre les boutons CTA et les logos */
    padding-top: 2rem; /* Un peu de padding au-dessus des logos */
    border-top: 1px solid rgba(0, 0, 0, 0.1); /* Une ligne de séparation subtile */
    width: 100%; /* S'assure que le conteneur prend toute la largeur disponible */
}

.hero-partners .partners-grid {
    width: 80%; /* Le groupe de logos occupe 80% de l'espace */
    margin: 0 auto; /* Centre le groupe de logos */
    justify-content: space-between; /* Répartit les logos sur toute la largeur du groupe */
}

.cta-button {
    background-color: var(--primary-accent);
    color: var(--bg-color);
    border: 1px solid var(--primary-accent);
    padding: 1rem 2rem;
    border-radius: 25px; /* Bords plus arrondis */
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background-color: transparent;
    color: var(--primary-accent);
}

/* Services */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.service-card {
    background-color: var(--bg-color); /* Fond blanc propre */
    border-radius: 8px; /* Bords légèrement plus arrondis */
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden; /* S'assure que l'image ne dépasse pas les bords arrondis */
    display: flex;
    flex-direction: column;
}

.service-card img {
    width: 100%;
    height: 220px;
    object-fit: cover; /* Assure que l'image remplit l'espace sans se déformer */
}

.service-card h3, .service-card p {
    padding: 0 1.5rem; /* Ajoute un padding horizontal au texte */
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.08);
}

.service-card h3 {
    color: var(--primary-accent);
    margin-top: 1.5rem; /* Espace au-dessus du titre */
    padding: 0 1.5rem;
}

.service-card p {
    padding: 0 1.5rem 1.5rem 1.5rem; /* Padding pour le paragraphe */
    margin-bottom: auto; /* Pousse le footer en bas */
}

.card-footer {
    padding: 0 1.5rem 1.5rem;
    margin-top: 1rem;
}

.btn-see-more {
    display: inline-block;
    background-color: transparent;
    color: var(--primary-accent);
    border: 1px solid var(--primary-accent);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-see-more:hover {
    background-color: var(--primary-accent);
    color: var(--bg-color);
}

/* Subtitle style */
.subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 700px;
    margin: -2rem auto 3rem auto;
}

/* Key Figures */
.key-figures {
    background-color: var(--section-bg-light);
}
.key-figures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    text-align: center;
}
.key-figure-item p {
    font-size: 1rem;
    color: var(--text-light);
    max-width: 300px;
    margin: 0.5rem auto 0 auto;
}
.key-figure-number {
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--primary-accent);
    line-height: 1;
}
.key-figure-suffix {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-accent);
}

/* Section Technologies */
.tech-section {
    background-color: var(--bg-color);
}

.tech-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-top: 4rem;
}

.tech-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px -15px rgba(0,0,0,0.1);
}

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

.tech-list li {
    padding-left: 35px;
    position: relative;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.tech-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--bg-color);
    background-color: var(--primary-accent);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: 700;
}

/* Logos Technologies */
.tech-logos {
    margin-top: 4rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 3rem;
}

.tech-logos p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.logo-grid,
.partners-grid {
    display: flex;
    justify-content: space-around; /* Répartit l'espace autour des logos */
    align-items: center;
    gap: 2rem; /* Espacement de base entre les logos */
    flex-wrap: wrap;
}

.logo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
}

.logo-item svg {
    width: 32px;
    height: 32px;
    opacity: 0.6;
}

/* Calculator */
.calculator {
    background-color: var(--section-bg-light);
}
.calculator-wrapper {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px -15px rgba(0,0,0,0.1);
}
.slider-group {
    margin-bottom: 2rem;
}
.slider-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
}
.slider-group input[type="range"] {
    width: 100%;
    accent-color: var(--primary-accent);
}
.slider-group span {
    display: block;
    text-align: right;
    font-weight: 700;
    color: var(--primary-accent);
}
.result-group {
    text-align: center;
    margin-top: 2rem;
}
.result-group p {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}
.result-group #savings-result {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-accent);
}

/* CTA Section */
.cta-section {
    background-color: var(--primary-accent);
    color: var(--bg-color);
    text-align: center;
    padding: 4rem 0;
}
.cta-section h2 {
    color: var(--bg-color);
    margin-bottom: 2rem;
}
.cta-section .cta-button {
    background-color: var(--bg-color);
    color: var(--primary-accent);
    border-color: var(--bg-color);
}
.cta-section .cta-button:hover {
    background-color: transparent;
    color: var(--bg-color);
}

/* Method */
.method-steps-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6rem; /* Espace entre chaque étape */
}

.method-step-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.step-text {
    position: relative; /* Pour le positionnement du numéro */
}

.step-number {
    width: 30px;
    height: 30px;
    background: var(--primary-accent);
    color: var(--bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 1rem;
}

.step-text h3 { margin-top: 0; }

.step-icon {
    font-size: 6rem; /* Taille de l'émoji */
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--section-bg-light);
    border-radius: 50%;
    width: 180px;
    height: 180px;
    margin: 0 auto; /* Centre l'icône dans sa colonne de grille */
}

/* FAQ */
.faq details {
    /* Effet Liquid Glass */
    background-color: rgba(255, 255, 255, 0.5); /* Fond un peu plus transparent pour mieux voir le flou */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3); /* Bordure plus visible pour un effet "plaque de verre" */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    
    border-radius: 12px; /* Bords plus arrondis */
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: background-color 0.3s ease;
}
.faq details:hover { background-color: rgba(255, 255, 255, 0.7); }
.faq summary { font-weight: 700; cursor: pointer; }

.partner-logo img {
    max-height: 75px; /* Logos agrandis pour plus de lisibilité */
    width: auto;
    /* Les logos sont maintenant en couleur par défaut */
    transition: transform 0.3s ease; /* Ajoute une petite animation au survol */
}
.partner-logo img:hover {
    transform: scale(1.05); /* Agrandit légèrement l'image au survol */
}

/* Page Contact */
.contact-section {
    padding: 6rem 0;
    background-color: var(--section-bg-light);
}

.contact-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.contact-text h1 {
    font-size: 3rem;
    color: var(--primary-accent);
}

.contact-form {
    background: var(--bg-color);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px -15px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    box-sizing: border-box; /* Important pour que le padding ne casse pas la largeur */
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 2px rgba(94, 21, 34, 0.2);
}

/* Footer */
.footer {
    background-color: var(--primary-accent);
    color: rgba(255, 255, 255, 0.8);
    padding: 2.5rem 0;
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
}

.footer-nav a {
    color: var(--bg-color);
    text-decoration: none;
    transition: opacity 0.3s ease;
}
.footer-nav a:hover { opacity: 0.8; text-decoration: underline; }

/* --- Animations au défilement --- */
.animated-element {
    opacity: 0;
    transform: translateY(30px);
    /* Indique au navigateur de se préparer à animer ces propriétés pour une meilleure fluidité */
    will-change: transform, opacity;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animated-element.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Styles pour la modale --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
}

.modal-content {
    background-color: var(--bg-color);
    padding: 2rem;
    border-radius: 8px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-light);
    cursor: pointer;
}

#modal-body img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

#modal-body h2 {
    text-align: left;
}
/* --- Fin des animations --- */

/* --- Responsive Design --- */
@media (max-width: 1180px) {
    .nav-menu {
        display: none; /* Cache le menu desktop */
    }

    .hamburger-menu {
        display: flex; /* Affiche le bouton hamburger */
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 24px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 20; /* Au-dessus de tout */
        position: relative; /* Pour le positionnement des barres */
    }

    .hamburger-menu span {
        width: 30px;
        height: 3px;
        background: var(--text-dark);
        border-radius: 10px;
        transition: all 0.3s linear;
        position: relative;
        transform-origin: 1px;
    }

    /* Styles pour l'état ouvert (croix) */
    .hamburger-menu.open span:nth-child(1) {
        transform: rotate(45deg);
    }

    .hamburger-menu.open span:nth-child(2) {
        opacity: 0;
        transform: translateX(20px);
    }

    .hamburger-menu.open span:nth-child(3) {
        transform: rotate(-45deg);
    }

    /* Styles du panneau de navigation mobile */
    .mobile-nav {
        display: flex; /* Rétablit l'affichage sur mobile pour que le JS puisse le manipuler */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: var(--bg-color);
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
        z-index: 15;
        padding: 2rem;
        box-sizing: border-box;
    }

    .mobile-nav.open {
        transform: translateX(0);
    }

    .mobile-nav .logo {
        position: absolute;
        top: 1.5rem;
        left: 2rem;
    }

    .mobile-nav nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
        text-align: center;
    }

    .mobile-nav nav li {
        margin-bottom: 2rem;
    }

    .mobile-nav nav a {
        font-size: 1.8rem;
        font-weight: 700;
        color: var(--text-dark);
        text-decoration: none;
        padding: 0.5rem 1rem;
    }

    .mobile-nav nav a.nav-cta-button {
        font-size: 1.5rem;
        padding: 1rem 2rem;
    }

    /* Ajustements généraux pour mobile */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    .hero p { font-size: 1.1rem; }

    .tech-content-wrapper, .contact-wrapper, .method-step-item {
        grid-template-columns: 1fr;
    }

    /* Inverse l'ordre pour que l'image soit après le texte sur mobile */
    .method-step-item:nth-child(even) .step-icon {
        order: -1;
    }

    /* Centre le contenu des étapes de la méthode sur mobile */
    .step-text {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 970px) {
    /* Aligne les chiffres clés verticalement sur les tablettes */
    .key-figures-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* --- Optimisations de performance pour mobile --- */
    /* Désactive le fond granuleux coûteux en performance */
    body {
        background-image: none;
    }

    /* Désactive le flou sur le header et la FAQ pour économiser les ressources */
    .header, .faq details {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background-color: rgba(255, 255, 255, 0.98); /* Fond plus opaque pour la lisibilité */
    }
}

@media (max-width: 790px) {
    /* Affiche les pôles de service en une seule colonne sur mobile */
    .service-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Responsive Design pour écrans très petits --- */
@media (max-width: 750px) {
    /* Cache les logos partenaires dans la section hero pour alléger la vue mobile */
    .hero-partners {
        display: none;
    }
}