/* Séparations invisibles : les sections grises se fondent dans les sections blanches voisines.
   Le fondu n'est appliqué que du côté où la voisine est blanche (pas entre deux sections grises,
   ni à côté du bandeau dégradé .cta ou du pied de page). */

.service:not(.bg-white),
section[style*="white-2"] {
    --blend: 200px;
    --ft: 0px;
    --fb: 0px;
    background-color: transparent !important;
    background-image: linear-gradient(to bottom,
        #FFFFFF 0,
        var(--white-2) var(--ft),
        var(--white-2) calc(100% - var(--fb)),
        #FFFFFF 100%) !important;
}

/* Voisine du dessus blanche : fondu en haut */
:is(section, div):not(.service:not(.bg-white)):not([style*="white-2"]):not(.footer) + :is(.service:not(.bg-white), section[style*="white-2"]) {
    --ft: var(--blend);
}

/* Voisine du dessous blanche : fondu en bas */
:is(.service:not(.bg-white), section[style*="white-2"]):has(+ :is(section, div):not(.service:not(.bg-white)):not([style*="white-2"]):not(.footer)) {
    --fb: var(--blend);
}

/* Dernière section avant la fin du contenu : fondu en bas */
:is(.service:not(.bg-white), section[style*="white-2"]):last-child {
    --fb: var(--blend);
}


/* Bande de logos : plus de bandeau blanc ni de filets, les logos se posent sur le fond */
#references .row,
#references .row:first-of-type,
#references .row:not(:has(~ .row)) {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

#references .scroll-wrapper img {
    mix-blend-mode: multiply;
}

/* Bandeau bleu « Essayez nos produits » */
.section.cta {
    padding-block: 90px !important;
}

/* Bandeau bleu : grille de points, halos lumineux animés et bouton « Démo » qui brille */
.section.cta {
    position: relative;
    z-index: 0 !important;
    overflow: hidden;
    isolation: isolate;
}

    .section.cta::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1.4px);
        background-size: 22px 22px;
        -webkit-mask-image: radial-gradient(60% 80% at 50% 50%, #000, transparent 75%);
        mask-image: radial-gradient(60% 80% at 50% 50%, #000, transparent 75%);
    }

    .section.cta::after {
        content: "";
        position: absolute;
        inset: -40%;
        z-index: -1;
        background:
            radial-gradient(18% 30% at 18% 40%, rgba(56, 189, 248, 0.45), transparent 70%),
            radial-gradient(16% 28% at 82% 60%, rgba(147, 197, 253, 0.40), transparent 70%);
        filter: blur(20px);
        animation: cta-orbs 14s ease-in-out infinite alternate;
        pointer-events: none;
    }

@keyframes cta-orbs {
    from { transform: translate(-4%, -3%); }
    to { transform: translate(4%, 3%); }
}

.section.cta .btnCss {
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
    animation: cta-pulse 2.6s ease-out infinite;
}

    .section.cta .btnCss::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(110deg, transparent 30%, rgba(47, 91, 234, 0.18) 50%, transparent 70%);
        transform: translateX(-120%);
        animation: cta-shine 3.4s 1s ease-in-out infinite;
    }

@keyframes cta-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45); }
    70%, 100% { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); }
}

@keyframes cta-shine {
    0% { transform: translateX(-120%); }
    45%, 100% { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
    .section.cta::after,
    .section.cta .btnCss,
    .section.cta .btnCss::after {
        animation: none;
    }
}

/* Séparateur fondu plus visible : gris un peu plus marqué + fin trait dégradé à la jonction */
.service:not(.bg-white),
section[style*="white-2"] {
    position: relative;
}


/* Bandeau bleu : réseau de neurones animé (js/cta-network.js) à la place de la grille de points */
.section.cta::before {
    display: none;
}

.section.cta .cta-net {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Bloc unique Contacts & Localisations avec carte réelle */
.xc-office {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 0;
    margin-top: 40px;
    overflow: hidden;
    border: 1px solid #E3EAF7;
    border-radius: 24px;
    background: #FFFFFF;
    box-shadow: 0 24px 50px -30px rgba(30, 64, 175, 0.35);
    text-align: start;
}

.xc-office__info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 32px;
}

.xc-office__head { display: flex; align-items: center; gap: 14px; }

.xc-office__ic {
    flex: none;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #EEF3FF;
    color: #2F5BEA;
    font-size: 24px;
}

.xc-office__title { margin: 0; font-size: 1.9rem; font-weight: 700; color: #07080C; }

.xc-office__mail { font-size: 1.5rem; color: #5B616E; text-decoration: none; }
.xc-office__mail:hover { color: #2F5BEA; }

.xc-office__tabs {
    display: flex;
    gap: 6px;
    padding: 5px;
    border-radius: 999px;
    background: #F1F4FA;
}

.xc-office__tab {
    flex: 1;
    padding: 10px 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #5B616E;
    font-size: 1.45rem;
    font-weight: 600 !important;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

    .xc-office__tab:hover { color: #1E40AF; }

    .xc-office__tab.is-on {
        background: linear-gradient(90deg, #1E40AF, #2F5BEA);
        color: #FFFFFF;
        box-shadow: 0 8px 18px -10px rgba(47, 91, 234, 0.7);
    }

.xc-office__addr {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 1.55rem;
    line-height: 1.5;
    color: #07080C;
    text-decoration: none;
}

    .xc-office__addr ion-icon { flex: none; margin-top: 3px; color: #2F5BEA; font-size: 18px; }
    .xc-office__addr:hover span { color: #2F5BEA; }

.xc-office__phones {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .xc-office__phones li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 12px; background: #F7F9FD; font-size: 1.45rem; }
    .xc-office__lbl { color: #5B616E; }

    .xc-office__phones a { display: inline-flex; align-items: center; gap: 8px; margin-inline-start: auto; color: #07080C; font-weight: 600; text-decoration: none; }
    .xc-office__phones a ion-icon { color: #2F5BEA; font-size: 15px; }
    .xc-office__phones a:hover { color: #2F5BEA; }

.xc-office__map { position: relative; min-height: 420px; background: #EEF3FF; }

    .xc-office__map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

@media (max-width: 860px) {
    .xc-office { grid-template-columns: 1fr; }
    .xc-office__info { padding: 22px; }
    .xc-office__map { min-height: 300px; }
}

/* Carte dessinée du Maghreb (bloc Contacts & Localisations) */
.xc-office__map { min-height: 420px; background: #EEF3FF; }

.xc-map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.xc-map__land { fill: url(#xcLand); stroke: #B9CDF2; stroke-width: 1.5; stroke-linejoin: round; }
.xc-map__border path { fill: none; stroke: #9DB8EE; stroke-width: 1.2; stroke-dasharray: 5 5; }
.xc-map__country { font-size: 15px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; fill: #9AAFD8; }
.xc-map__sea { font-size: 12px; font-style: italic; font-weight: 500; letter-spacing: .08em; fill: #8FA6D6; }
.xc-map__route { fill: none; stroke: #2F5BEA; stroke-width: 1.6; stroke-dasharray: 4 6; opacity: .45; animation: xc-route 18s linear infinite; }

.xc-map__pin { cursor: default; }
.xc-map__pin .xc-map__dot { fill: #FFFFFF; stroke: #2F5BEA; stroke-width: 3; transition: r .25s ease, fill .25s ease; }
.xc-map__pin .xc-map__pulse { fill: rgba(47, 91, 234, .25); opacity: 0; }
.xc-map__pin text { font-size: 13px; font-weight: 700; fill: #1E2A5A; paint-order: stroke; stroke: #FFFFFF; stroke-width: 4px; stroke-linejoin: round; }

.xc-map__pin.is-on .xc-map__dot { fill: #2F5BEA; stroke: #FFFFFF; r: 9; }
.xc-map__pin.is-on .xc-map__pulse { opacity: 1; animation: xc-pulse 2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.xc-map__pin.is-on text { fill: #1E40AF; font-size: 14px; }

@keyframes xc-pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes xc-route { to { stroke-dashoffset: -200; } }

@media (prefers-reduced-motion: reduce) {
    .xc-map__route, .xc-map__pin.is-on .xc-map__pulse { animation: none; }
}

/* Carte dessinée : proportions naturelles sur tablette et téléphone (les 3 pays visibles) */
@media (max-width: 860px) {
    .xc-office__map { min-height: 0; aspect-ratio: 660 / 408; }
}

/* Pins de la carte cliquables */
.xc-map__pin { cursor: pointer; outline: none; }
.xc-map__pin:hover .xc-map__dot,
.xc-map__pin:focus-visible .xc-map__dot { r: 9; stroke-width: 4; }
.xc-map__pin:hover text,
.xc-map__pin:focus-visible text { fill: #2F5BEA; }

/* Carte réelle Google Maps dans le bloc Contacts & Localisations */
.xc-office__map { min-height: 420px; }
.xc-office__map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

@media (max-width: 860px) {
    .xc-office__map { aspect-ratio: auto; min-height: 300px; }
}

/* Contacts : une ligne = libellé à gauche, 1 ou 2 numéros à droite */
.xc-office__nums { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 16px; margin-inline-start: auto; }
.xc-office__nums a { margin-inline-start: 0 !important; white-space: nowrap; }
.xc-office__phones li { align-items: flex-start; }
.xc-office__lbl { padding-top: 1px; min-width: 96px; }

/* Carte Google : on masque la fiche d'infos ouverte en haut à gauche (l'iframe est remontée et rognée) */
.xc-office__map { overflow: hidden; }
.xc-office__map iframe { inset: auto 0 0 0 !important; top: -165px !important; height: calc(100% + 165px) !important; }


/* Contacts & Localisations : pleine largeur, même bordure/ombre que le formulaire */
.xc-office {
    max-width: none !important;
    width: 100%;
    margin-inline: 0 !important;
    border: 1px solid var(--x26-line, #E3EAF7) !important;
    box-shadow: var(--x26-shadow, 0 24px 50px -30px rgba(30, 64, 175, 0.35)) !important;
    border-radius: 24px;
}

/* Icône de localisation : bleue au survol */
.xc-office__ic { transition: background .2s ease, color .2s ease, box-shadow .25s ease; cursor: default; }
.xc-office__ic:hover,
.xc-office__head:hover .xc-office__ic {
    background: linear-gradient(135deg, #1E40AF, #2F5BEA) !important;
    color: #FFFFFF !important;
    box-shadow: 0 8px 18px -8px rgba(47, 91, 234, 0.8);
}
.xc-office__ic:hover ion-icon,
.xc-office__head:hover .xc-office__ic ion-icon { color: #FFFFFF !important; }

/* La carte est cliquable : un clic ouvre Google Maps */
.xc-office__maplink { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
.xc-office__maplink:focus-visible { outline: 3px solid #2F5BEA; outline-offset: -3px; }

/* Carte pas encore chargée : fond bleu clair avec un repère, l'iframe vide reste invisible */
.xc-office__map iframe:not([src]) { visibility: hidden; }
.xc-office__map::before {
    content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232F5BEA'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.2 7 13 7 13s7-7.8 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center / contain no-repeat;
    opacity: .55;
}
