/********** Template CSS **********/
:root {
    --primary: #263487;
    --light: #F0FBFC;
    --dark: #181d38;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.fw-medium {
    font-weight: 600 !important;
}

.fw-semi-bold {
    font-weight: 700 !important;
}

.back-to-top {
    position: fixed;
    display: none;
    right: 45px;
    bottom: 109px;
    z-index: 99;
}

@media (max-width: 575.98px) {
    .back-to-top {
        right: 20px;
        bottom: 84px;
    }
}


/*** Spinner ***/
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease-out, visibility 0s linear .5s;
    z-index: 99999;
}

#spinner.show {
    transition: opacity .5s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}


/*** Button ***/
.btn {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    transition-property: transform, background-color, border-color, color, box-shadow;
    transition-duration: .2s;
    transition-timing-function: ease-out;
}

.btn:active {
    transform: scale(.98);
}

.btn.btn-primary,
.btn.btn-secondary {
    color: #FFFFFF;
}

.btn-square {
    width: 38px;
    height: 38px;
}

.btn-sm-square {
    width: 32px;
    height: 32px;
}

.btn-lg-square {
    width: 48px;
    height: 48px;
}

.btn-square,
.btn-sm-square,
.btn-lg-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
    border-radius: 0px;
}


/*** Navbar ***/
.navbar .dropdown-toggle::after {
    border: none;
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    vertical-align: middle;
    margin-left: 8px;
}

.navbar-light .navbar-nav .nav-link {
    margin-right: 30px;
    padding: 25px 0;
    color: #FFFFFF;
    font-size: 15px;
    text-transform: uppercase;
    outline: none;
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link.active {
    color: var(--primary);
}

/* Menu replié (bouton burger) sous 1200px : 9 entrées ne tiennent pas sur une ligne. */
@media (max-width: 1199.98px) {
    .navbar-light .navbar-nav .nav-link  {
        margin-right: 0;
        padding: 10px 0;
    }

    .navbar-light .navbar-nav {
        border-top: 1px solid #EEEEEE;
    }
}

/* Entre 1200 et 1359px : espacement réduit, bouton email masqué faute de place. */
@media (min-width: 1200px) and (max-width: 1359.98px) {
    .navbar-light .navbar-nav .nav-link {
        margin-right: 20px;
    }

    .navbar-light .navbar-brand {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}

.navbar-email {
    display: none !important;
}

@media (min-width: 1360px) {
    .navbar-email {
        display: flex !important;
        align-items: center;
    }
}

.navbar-light .navbar-brand,
.navbar-light a.btn {
    height: 75px;
}

.navbar-light .navbar-nav .nav-link {
    color: var(--dark);
    font-weight: 500;
}

.navbar-light.sticky-top {
    top: -100px;
    transition-property: top;
    transition-duration: .3s;
    transition-timing-function: ease-out;
}

@media (min-width: 1200px) {
    .navbar .nav-item .dropdown-menu {
        display: block;
        margin-top: 0;
        opacity: 0;
        visibility: hidden;
        transition: .5s;
    }

    .navbar .dropdown-menu.fade-down {
        top: 100%;
        transform: rotateX(-75deg);
        transform-origin: 0% 0%;
    }

    .navbar .nav-item:hover .dropdown-menu {
        top: 100%;
        transform: rotateX(0deg);
        visibility: visible;
        transition: .5s;
        opacity: 1;
    }
}


/*** Header carousel ***/
@media (max-width: 768px) {
    .header-carousel .owl-carousel-item {
        position: relative;
        min-height: 500px;
    }
    
    .header-carousel .owl-carousel-item img {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.header-carousel .owl-nav {
    position: absolute;
    top: 50%;
    right: 8%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
}

.header-carousel .owl-nav .owl-prev,
.header-carousel .owl-nav .owl-next {
    margin: 7px 0;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    background: transparent;
    border: 1px solid #FFFFFF;
    font-size: 22px;
    transition: .5s;
}

.header-carousel .owl-nav .owl-prev:hover,
.header-carousel .owl-nav .owl-next:hover {
    background: var(--primary);
    border-color: var(--primary);
}

@media (max-width: 767.98px) {
    .header-carousel .owl-nav {
        top: auto;
        right: 16px;
        bottom: 16px;
        transform: none;
        flex-direction: row;
    }

    .header-carousel .owl-nav .owl-prev,
    .header-carousel .owl-nav .owl-next {
        margin: 0 0 0 8px;
        width: 40px;
        height: 40px;
    }
}

.page-header {
    background-color: rgba(24, 29, 56, .7);
}

.page-header-inner {
    background: rgba(15, 23, 43, .7);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--light);
}


/*** Section Title ***/
.section-title {
    position: relative;
    display: inline-block;
    text-transform: uppercase;
}

.section-title::before {
    position: absolute;
    content: "";
    width: calc(100% + 80px);
    height: 2px;
    top: 4px;
    left: -40px;
    background: var(--primary);
    z-index: -1;
}

.section-title::after {
    position: absolute;
    content: "";
    width: calc(100% + 120px);
    height: 2px;
    bottom: 5px;
    left: -60px;
    background: var(--primary);
    z-index: -1;
}

.section-title.text-start::before {
    width: calc(100% + 40px);
    left: 0;
}

.section-title.text-start::after {
    width: calc(100% + 60px);
    left: 0;
}


/*** Service ***/
.service-item {
    background: var(--light);
    transition: .5s;
}

.service-item:hover {
    margin-top: -10px;
    background: var(--primary);
}

.service-item * {
    transition: .5s;
}

.service-item:hover * {
    color: var(--light) !important;
}


/*** Categories & Courses ***/
.category img,
.course-item img {
    transition: .5s;
}

.category a:hover img,
.course-item:hover img {
    transform: scale(1.1);
}


/*** Team ***/
.team-item img {
    transition: .5s;
}

.team-item:hover img {
    transform: scale(1.1);
}


/*** Testimonial ***/
.testimonial-carousel::before {
    position: absolute;
    content: "";
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 1;
}

.testimonial-carousel::after {
    position: absolute;
    content: "";
    top: 0;
    right: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(to left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 1;
}

@media (min-width: 768px) {
    .testimonial-carousel::before,
    .testimonial-carousel::after {
        width: 200px;
    }
}

@media (min-width: 992px) {
    .testimonial-carousel::before,
    .testimonial-carousel::after {
        width: 300px;
    }
}

.testimonial-carousel .owl-item .testimonial-text,
.testimonial-carousel .owl-item.center .testimonial-text * {
    transition: .5s;
}

.testimonial-carousel .owl-item.center .testimonial-text {
    background: var(--primary) !important;
}

.testimonial-carousel .owl-item.center .testimonial-text * {
    color: #FFFFFF !important;
}

.testimonial-carousel .owl-dots {
    margin-top: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.testimonial-carousel .owl-dot {
    position: relative;
    display: inline-block;
    margin: 0 5px;
    width: 15px;
    height: 15px;
    border: 1px solid #CCCCCC;
    transition: .5s;
}

.testimonial-carousel .owl-dot.active {
    background: var(--primary);
    border-color: var(--primary);
}


/*** Footer ***/
.footer .btn.btn-social {
    margin-right: 5px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light);
    font-weight: normal;
    border: 1px solid #FFFFFF;
    border-radius: 35px;
    transition: .3s;
}

.footer .btn.btn-social:hover {
    color: var(--primary);
}

.footer .btn.btn-link {
    display: block;
    margin-bottom: 5px;
    padding: 0;
    text-align: left;
    color: #FFFFFF;
    font-size: 15px;
    font-weight: normal;
    text-transform: capitalize;
    transition: .3s;
}

.footer .btn.btn-link::before {
    position: relative;
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 10px;
}

.footer .btn.btn-link:hover {
    letter-spacing: 1px;
    box-shadow: none;
}

.footer .copyright {
    padding: 25px 0;
    font-size: 15px;
    border-top: 1px solid rgba(256, 256, 256, .1);
}

.footer .copyright a {
    color: var(--light);
}

.footer .footer-menu a {
    margin-right: 15px;
    padding-right: 15px;
    border-right: 1px solid rgba(255, 255, 255, .1);
}

.footer .footer-menu a:last-child {
    margin-right: 0;
    padding-right: 0;
    border-right: none;
}


/*** Retour en haut : anneau de progression du défilement ***/
.back-to-top {
    overflow: visible;
}

.back-to-top-progress {
    position: absolute;
    top: -6px;
    left: -6px;
    width: calc(100% + 12px);
    height: calc(100% + 12px);
    transform: rotate(-90deg);
    pointer-events: none;
}

.back-to-top-ring {
    fill: none;
    stroke: var(--light);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset .2s ease-out;
}


/*** Apparition au défilement (activée seulement si JavaScript tourne) ***/
html.js .wow {
    opacity: 0;
    transform: translateY(12px);
    transition-property: opacity, transform;
    transition-duration: .6s;
    transition-timing-function: cubic-bezier(.16, 1, .3, 1);
}

html.js .wow.is-visible {
    opacity: 1;
    transform: none;
}

html.js .wow .section-title::before,
html.js .wow .section-title::after {
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .8s cubic-bezier(.16, 1, .3, 1) .25s;
}

html.js .wow.is-visible .section-title::before,
html.js .wow.is-visible .section-title::after {
    transform: scaleX(1);
}

/*** Survol des cartes (services, secteurs...) ***/
.card > img,
.course-item img {
    outline: 1px solid rgba(0, 0, 0, .08);
    outline-offset: -1px;
}

.hover-lift {
    transition: transform .35s cubic-bezier(.22, 1, .36, 1), box-shadow .35s ease;
}

.hover-lift:hover,
.hover-lift:focus-within {
    transform: translateY(-8px);
    box-shadow: 0 1rem 2rem rgba(9, 30, 62, .1);
}

.hover-slide {
    transition: transform .35s cubic-bezier(.22, 1, .36, 1), box-shadow .35s ease;
}

.hover-slide:hover,
.hover-slide:focus-within {
    transform: translateX(8px);
    box-shadow: 0 .6rem 1.2rem rgba(9, 30, 62, .08);
}


/*** Chiffres-clés animés ***/
.counter-item {
    text-align: center;
}

.counter-value {
    display: inline-block;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 2.75rem;
    color: var(--primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.counter-suffix {
    font-weight: 800;
    font-size: 2.75rem;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.counter-label {
    margin-top: .5rem;
    color: var(--dark);
    font-size: .95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}


/*** Titres héros ***/
.hero-title {
    font-weight: 800 !important;
    letter-spacing: -.02em;
}


/*** Sélecteur de langue ***/
.selecteur-langue .dropdown-menu {
    min-width: 10rem;
}

/* Dernier élément du menu : le déroulant s'ouvre vers la gauche pour ne
   pas dépasser du bord droit (il reste dans la page même masqué). */
@media (min-width: 1200px) {
    .navbar .selecteur-langue .dropdown-menu {
        left: auto;
        right: 0;
    }
}

@media (min-width: 1360px) {
    .navbar .selecteur-langue .nav-link {
        margin-right: 20px;
    }
}

/*** Galerie (vignettes cliquables) ***/
.galerie-vignette {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}

.galerie-vignette img {
    transition: transform .4s ease-out;
}

.galerie-vignette:hover img,
.galerie-vignette:focus-visible img {
    transform: scale(1.04);
}

.galerie-vignette:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/*** Pages légales ***/
.page-legale {
    max-width: 860px;
}

.page-legale section {
    margin-bottom: 2rem;
}

.page-legale h2 {
    color: var(--dark);
    margin-bottom: .75rem;
}


/*** Assistant ADR (FAQ par mots-clés) ***/
.chatbot {
    position: fixed;
    right: 41px;
    bottom: 41px;
    z-index: 1040;
}

.chatbot-ouvrir {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 1.35rem;
    box-shadow: 0 .5rem 1.25rem rgba(9, 30, 62, .22);
    cursor: pointer;
    transition-property: transform, background-color;
    transition-duration: .2s;
    transition-timing-function: ease-out;
}

.chatbot-ouvrir:hover {
    background: #1d2970;
}

.chatbot-ouvrir:active {
    transform: scale(.96);
}

.chatbot-ouvrir:focus-visible,
.chatbot-langue:focus-visible,
.chatbot-envoyer:focus-visible,
.chatbot-champ:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: 360px;
    height: min(540px, calc(100vh - 160px));
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #dfe3ee;
    box-shadow: 0 1.25rem 3rem rgba(9, 30, 62, .18);
    overflow: hidden;
}

.chatbot-panel:not([hidden]) {
    animation: chatbot-entree .2s cubic-bezier(.16, 1, .3, 1);
}

@keyframes chatbot-entree {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--dark);
    color: #fff;
}

.chatbot-titre {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.chatbot-sous-titre {
    margin: 2px 0 0;
    font-size: .78rem;
    color: #aab4cf;
}

.chatbot-fermer {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.05rem;
    cursor: pointer;
}

.chatbot-fermer:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

.chatbot-langues {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    border-bottom: 1px solid #eceef5;
}

.chatbot-langue {
    min-width: 42px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #d5dae8;
    background: #fff;
    color: var(--dark);
    font-family: 'Nunito', sans-serif;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    cursor: pointer;
    transition-property: background-color, border-color, color;
    transition-duration: .15s;
}

.chatbot-langue:hover {
    border-color: var(--primary);
}

.chatbot-langue.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.chatbot-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    overflow-y: auto;
    background: #fafbfd;
}

.chatbot-message {
    max-width: 86%;
    padding: 9px 12px;
    font-size: .9rem;
    line-height: 1.5;
    text-wrap: pretty;
    overflow-wrap: anywhere;
}

.chatbot-message--bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e3e7f0;
    color: #2b2f3a;
}

.chatbot-message--user {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
}

.chatbot-message--attente {
    color: #8a93a8;
    animation: chatbot-attente 1s ease-in-out infinite alternate;
}

@keyframes chatbot-attente {
    from { opacity: .4; }
    to   { opacity: 1; }
}

.chatbot-formulaire {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #eceef5;
}

.chatbot-champ {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d5dae8;
    font-size: .9rem;
    color: #2b2f3a;
}

.chatbot-envoyer {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    transition: background-color .15s ease-out;
}

.chatbot-envoyer:hover {
    background: #1d2970;
}

/* Écrans tactiles : 16px minimum, sinon Safari iOS zoome sur le champ au toucher. */
@media (hover: none) {
    .chatbot-champ {
        font-size: 16px;
    }
}

/* Téléphones, en portrait comme en paysage : assistant en plein écran, comme une
   messagerie. 100dvh suit la hauteur réellement visible (clavier ouvert compris). */
@media (max-width: 575.98px), (max-height: 500px) and (max-width: 991.98px) {
    .chatbot {
        right: 16px;
        bottom: 16px;
    }

    .chatbot-panel {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        border: 0;
        box-shadow: none;
        z-index: 1060;
    }

    .chatbot-panel:not([hidden]) {
        animation-name: chatbot-plein-ecran;
    }

    .chatbot-header {
        padding: max(12px, env(safe-area-inset-top)) 12px 12px 16px;
    }

    .chatbot-fermer {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .chatbot-langue {
        min-width: 52px;
        height: 40px;
    }

    .chatbot-message {
        max-width: 90%;
    }

    .chatbot-formulaire {
        padding: 10px 12px max(10px, env(safe-area-inset-bottom));
    }

    .chatbot-champ {
        height: 44px;
        font-size: 16px;
    }

    .chatbot-envoyer {
        width: 44px;
        height: 44px;
    }

    /* Page figée derrière l'assistant ouvert ; boutons flottants masqués */
    html.chatbot-ouvert,
    html.chatbot-ouvert body {
        overflow: hidden;
    }

    html.chatbot-ouvert .chatbot-ouvrir,
    html.chatbot-ouvert .back-to-top {
        visibility: hidden;
    }
}

/* Téléphone en paysage : peu de hauteur, l'en-tête se fait compact */
@media (max-height: 500px) and (max-width: 991.98px) {
    .chatbot-header {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .chatbot-sous-titre {
        display: none;
    }

    .chatbot-langues {
        padding: 6px 16px;
    }
}

@keyframes chatbot-plein-ecran {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}



/*** Mobile : zones tactiles d'au moins 44px, titres qui tiennent dans l'écran ***/
@media (max-width: 991.98px) {
    .footer .btn.btn-link {
        margin-bottom: 0;
        padding: 9px 0;
    }

    .footer .copyright a {
        display: inline-block;
        padding: 10px 0;
    }

    .footer .footer-menu a {
        display: block;
        margin-right: 0;
        padding: 10px 0;
        border-right: none;
    }

    .footer .btn.btn-social,
    .btn-square {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 575.98px) {
    .page-header h1 {
        font-size: clamp(1.75rem, 9vw, 2.5rem);
        overflow-wrap: anywhere;
        hyphens: auto;
    }
}

/* Surtitres de section : leurs filets décoratifs dépassent de 40 à 60px de chaque
   côté. Sur téléphone, un surtitre long (lingala, swahili) les poussait hors de
   l'écran et créait un défilement horizontal : on réduit le dépassement et on
   réserve sa place. */
@media (max-width: 575.98px) {
    .section-title {
        max-width: calc(100% - 48px);
    }

    .section-title::before,
    .section-title::after {
        width: calc(100% + 40px);
        left: -20px;
    }

    .section-title.text-start {
        max-width: calc(100% - 24px);
    }

    .section-title.text-start::before,
    .section-title.text-start::after {
        width: calc(100% + 20px);
        left: 0;
    }
}
