/* Police Inter hébergée avec le site (aucun appel à Google Fonts). Licence SIL Open Font License. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../assets/fonts/inter-latin-300-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../assets/fonts/inter-latin-400-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../assets/fonts/inter-latin-600-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../assets/fonts/inter-latin-800-normal.woff2') format('woff2');
}

:root {
    --bg-color: #000000;
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --accent-color: #2997ff;
    --accent-hover: #0077ed;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    cursor: default;
}

/* Curseur Lumineux (Antigravity style) */
.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 480px;    /* halo réduit de 20 % (600px → 480px) */
    height: 480px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(0, 0, 0, 0) 60%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: screen;
    transition: width 0.3s, height 0.3s;
}

/* Typography */
h1 {
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(180deg, #fff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    text-align: center;
}

p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 30px;
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 120px 0;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 45px 40px 50px 40px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
}

.logo img {
    height: 100px;
    width: auto;
    object-fit: contain;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    margin-left: 30px;
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.nav-links a:hover {
    opacity: 1;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 400;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--text-primary);
    color: var(--bg-color);
}

.btn-primary:hover {
    transform: scale(1.05);
    background-color: #ffffff;
}

.btn-secondary {
    border: 1px solid var(--text-primary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--text-primary);
    color: var(--bg-color);
}

/* Hero Section */
.hero {
    text-align: center;
    padding-top: 180px;
    padding-bottom: 0;   /* la section suivante vient se placer juste sous la photo */
    position: relative;
}

.hero-content {
    position: relative;
    z-index: 2;
}

/* Espace entre le titre et le bouton (auparavant porté par la phrase d'accroche) */
.hero h1 {
    margin-bottom: 40px;
}

/* « broadcast et digital. » : dégradé de gauche à droite, du blanc au bleu ciel du bas des lettres du logo */
/* Dégradé blanc → bleu de l'en-tête, repris sur « IA » / « AI » (rubrique Activité) et sur « Ils nous ont fait confiance » */
.hero-gradient,
.text-gradient {
    background: linear-gradient(90deg, #ffffff 0%, #0c9efb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-image-container {
    margin-top: 60px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.hero-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, var(--bg-color) 0%, transparent 40%);
}

.hero-image-container img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0.8;
    transform: scale(1.05);
    transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero:hover .hero-image-container img {
    transform: scale(1);
}

/* Activity Section */
/* Espace entre la photo du haut de page et « Notre Activité »
   (espace visible d'environ 275px, dont ~210px de bas de photo fondu au noir) */
.activity {
    padding-top: 65px;
    justify-content: flex-start;
}

/* Le conteneur prend toute la largeur (les photos en parallaxe ne lui donnent plus de largeur) */
.activity .container {
    width: 100%;
}

.activity-showcase {
    --showcase-gap: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;   /* texte collé au bord extérieur, l'espace libéré va entre texte et visuel */
    gap: var(--showcase-gap);
    margin-top: 80px;
}

.activity-showcase.reverse {
    flex-direction: row-reverse;
}

.showcase-text {
    flex: 0 0 calc((100% - var(--showcase-gap)) / 2 * 0.75);   /* largeur réduite de 25 % */
    margin-left: calc((100% - var(--showcase-gap)) / 16);       /* rapproche le texte de sa photo (moitié de l'espace libéré) */
}

.activity-showcase.reverse .showcase-text {
    margin-left: 0;
    margin-right: calc((100% - var(--showcase-gap)) / 16);
}

.showcase-text h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.showcase-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0;
    text-align: justify;   /* texte justifié : aligné à gauche et à droite */
}

/* ── Puces des rubriques « Notre Activité » ───────────────────
   Petit rond dégradé blanc → bleu ciel, comme les lettres « BROTHERS » du logo.
   La puce grossit avec un léger rebond quand la souris est dessus, puis se dégonfle quand elle s'en va (déclenché par script.js). */
.showcase-list {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
}

.showcase-list li {
    position: relative;
    padding-left: 26px;
    font-size: 1.1rem;
    line-height: 1.5;
    color: var(--text-secondary);
    text-align: left;
}

.showcase-list li + li {
    margin-top: 6px;
}

.showcase-text h3 + .showcase-list {
    margin-top: 0;
}

.showcase-list li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: calc(0.75em - 3.5px);   /* centré sur la première ligne */
    width: 7px;                  /* 30 % plus petite que la taille d'origine (10 px) */
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffffff 0%, #adeffc 40%, #18a5fb 100%);
    box-shadow: 0 0 6px rgba(53, 208, 255, 0.55);
    transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);   /* la souris s'en va : la puce se dégonfle en douceur */
}

/* Souris sur la puce : elle grossit avec un léger rebond et reste grosse tant que la souris est dessus.
   Des transitions (et non une animation) : si la souris repart en plein mouvement, la puce repart de sa taille du moment. */
.showcase-list li.is-bumped::before {
    transform: scale(1.4);
    transition: transform 0.5s cubic-bezier(0.3, 2.2, 0.5, 1);   /* navigateurs anciens : un seul rebond */
    transition: transform 0.5s linear(0, 0.62 5%, 1 10%, 1.19 15%, 1.29 20%, 1.34 25%, 1.37 30%, 1.38 35%, 1.33 40%, 1.19 45%, 1.01 50%, 0.87 55%, 0.83 60%, 0.86 65%, 0.95 70%, 1.04 75%, 1.07 80%, 1.07 85%, 1.04 90%, 1.01 95%, 1);
}


.showcase-image {
    flex: 0 0 calc((100% - var(--showcase-gap)) / 2);   /* largeur du visuel inchangée */
}

.rounded-img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    transition: transform 0.5s ease;
}

/* Emplacement de photo en attente (à remplacer par une vraie photo) */
.photo-placeholder {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.rounded-img:hover {
    transform: scale(1.03);
}

/* Photos de « Notre Activité » au format 16:9 (format télé), recadrées si besoin */
.showcase-image .rounded-img {
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Parallaxe des photos de « Notre Activité » (classe .parallax ajoutée par script.js) :
   le cadre garde sa place, la photo, 20 % plus haute que lui, glisse à l'intérieur */
.showcase-image.parallax {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.showcase-image.parallax img {
    position: absolute;
    left: 0;
    top: -10%;
    width: 100%;
    height: 120%;
    object-fit: cover;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    translate: 0 var(--parallax-y, 0px);
    transition: scale 0.5s ease;
    will-change: translate;
}

.showcase-image.parallax:hover img {
    transform: none;
    scale: 1.03;   /* léger zoom au survol, comme avant */
}

/* Diaporama (rubrique « Divertissement et Jeux TV ») : les photos glissent de la droite vers la gauche.
   Les photos attendent à droite du cadre, la photo affichée est au centre, celle qui s'en va part à gauche. */
.showcase-image.showcase-slider {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.showcase-image.showcase-slider img.slide {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: translateX(100%);
    transition: transform var(--slide-speed, 0.8s) cubic-bezier(0.65, 0, 0.35, 1), scale 0.5s ease;
}

/* photos en parallaxe : 20 % plus hautes que le cadre (voir plus haut) */
.showcase-image.showcase-slider.parallax img.slide:not([data-parallax="off"]) {
    top: -10%;
    height: 120%;
}

.showcase-image.showcase-slider img.slide.is-active  { transform: translateX(0); }
.showcase-image.showcase-slider img.slide.is-leaving { transform: translateX(-100%); }
.showcase-image.showcase-slider img.slide.no-anim    { transition: none; }

@media (prefers-reduced-motion: reduce) {
    .showcase-image.showcase-slider img.slide { transition: none; }
}

/* Agrandissement des photos de « Notre Activité » au clic (géré par script.js) */
.showcase-image img {
    cursor: zoom-in;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 20000;   /* au-dessus du bandeau et du chatbot */
    background: rgba(0, 0, 0, 0);
    transition: background 0.4s ease;
}

.lightbox.is-open {
    background: rgba(0, 0, 0, 0.88);
}

.lightbox-img {
    position: fixed;
    display: block;
    max-width: none;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    cursor: default;
    transition: left 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
                width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lightbox-close {
    position: fixed;
    width: 44px;
    height: 44px;
    padding: 11px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.25s ease, background 0.2s ease;
}

.lightbox.is-open .lightbox-close {
    opacity: 1;
    transition-delay: 0.3s, 0s;   /* la croix apparaît quand la photo est en place */
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
    background: rgba(255, 255, 255, 0.25);
    outline: none;
}

.lightbox-close svg {
    display: block;
    width: 100%;
    height: 100%;
}

@media (prefers-reduced-motion: reduce) {
    .lightbox,
    .lightbox-img,
    .lightbox-close { transition: none !important; }
}

/* References Section */
.references {
    text-align: center;
    /* Espaces avant et après les logos réduits d'un tiers (334px → 224px sur un écran 1440x900),
       sans hauteur minimale pour que l'espace ne dépende plus de la hauteur de l'écran */
    min-height: auto;
    padding: 104px 0;
}

/* Espace entre le titre et la grille (auparavant porté par le sous-titre) */
.references h2 {
    margin-bottom: 50px;
}

/* Titre « L'IA au cœur de notre activité » : même taille que le titre du site (h1), à chaque largeur d'écran */
.activity-title {
    font-size: 5rem;
    line-height: 1.1;
    padding-bottom: calc(1.1rem * 1.5);   /* une ligne vide (hauteur d'une ligne de texte des rubriques) avant « Divertissement » */
}

@media (max-width: 1024px) {
    .activity-title { font-size: 4rem; }
}

@media (max-width: 768px) {
    .activity-title { font-size: 2.6rem; }
}

@media (max-width: 400px) {
    .activity-title { font-size: 2rem; }
}

/* Le conteneur prend toute la largeur (sinon il se rétrécit à son contenu dans la section en flex) */
.references .container {
    width: 100%;
}

/* Grille de logos : 3 par ligne, une ligne incomplète est centrée */
.references-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 960px;
    margin: 0 auto;
}

.ref-item {
    flex: 0 0 calc((100% - 40px) / 3);
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;   /* marges latérales réduites : laisse les logos larges grandir */
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    /* Effet 3D (piloté par script.js) : la carte s'incline selon la position de la souris */
    position: relative;
    transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--tilt-scale, 1));
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Logo masqué (attribut hidden dans le HTML) : la règle display: flex ci-dessus l'emporterait sinon */
.ref-item[hidden] {
    display: none;
}

.ref-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Pendant le survol : la carte suit la souris de près, s'agrandit un peu et projette une ombre */
.ref-item.is-tilting {
    --tilt-scale: 1.05;
    transition: transform 0.12s ease-out, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

.ref-item img {
    display: block;
    height: var(--logo-h, 64px);
    width: auto;
    max-width: 100%;
    object-fit: contain;
    /* Le logo flotte 45px au-dessus de la carte : il se décale plus qu'elle quand elle s'incline
       (scale 0.944 = compense l'agrandissement dû à la perspective, taille identique au repos) */
    transform: translateZ(45px) scale(0.944);
}

/* Reflet lumineux qui suit la souris */
.ref-glare {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.18), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ref-item.is-tilting .ref-glare {
    opacity: 1;
}

/* Téléphone : les cartes suivent le gyroscope (variables posées sur la grille par script.js) */
.references-grid.gyro-on .ref-item {
    transition: transform 0.1s linear, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.references-grid.gyro-on .ref-glare {
    opacity: 1;
}

/* Contact Section */
.contact {
    text-align: center;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.02));
}

/* Footer */
footer {
    text-align: center;
    padding: 40px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Pas d'espace vide entre « © 2026 Digital Brothers… » et les liens légaux */
footer p:not(.footer-links) {
    margin-bottom: 0;
}

footer .footer-links {
    margin-top: 8px;
    font-size: 0.85rem;
}

footer .footer-links a,
.form-privacy a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

footer .footer-links a:hover,
.form-privacy a:hover {
    color: var(--text-primary);
}

/* Information RGPD sous le formulaire */
.form-privacy {
    margin: 18px auto 0;
    max-width: 640px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
    text-align: center;
}

/* Pages « Mentions légales » / « Legal notice » */
.legal {
    padding: 220px 0 80px;
    min-height: 0;
    display: block;
}

.legal-container {
    max-width: 820px;
}

.legal h1 {
    font-size: 2.6rem;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.legal h1.legal-h1-next {
    margin-top: 80px;
    scroll-margin-top: 200px;   /* le titre n'est pas caché sous le bandeau quand on arrive par le lien */
}

.legal h2 {
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    text-align: left;
    margin: 36px 0 10px;
}

.legal p,
.legal li {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

.legal p + p {
    margin-top: 12px;
}

.legal ul {
    padding-left: 22px;
}

.legal li + li {
    margin-top: 6px;
}

.legal strong {
    color: var(--text-primary);
    font-weight: 600;
}

.legal a {
    color: var(--accent-color);
    text-decoration: none;
    word-break: break-word;
}

.legal a:hover {
    text-decoration: underline;
}

.legal-back {
    margin-bottom: 28px;
    font-size: 0.95rem;
}

.legal-updated {
    margin-top: 48px;
    font-size: 0.85rem !important;
}

@media (max-width: 768px) {
    .legal { padding: 150px 0 60px; }
    .legal h1 { font-size: 2rem; }
    .legal h1.legal-h1-next { margin-top: 60px; scroll-margin-top: 130px; }
    .legal h2 { font-size: 1.1rem; margin-top: 28px; }
    .legal p, .legal li { font-size: 0.95rem; }
}

/* Animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2rem;
    }

    .navbar {
        flex-direction: column;
        justify-content: center;
        padding: 15px;
    }

    .logo {
        position: relative;
        left: auto;
        transform: none;
        margin-bottom: 10px;
    }

    .nav-links {
        margin-top: 5px;
        text-align: center;
    }

    .nav-links a {
        margin: 5px 10px;
        display: inline-block;
    }

    .hero {
        padding-top: 140px;
    }

    .activity-showcase,
    .activity-showcase.reverse {
        flex-direction: column;
        gap: 30px;
    }
}

/* Chatbot */
.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
}

.chat-toggle {
    background-color: var(--text-primary);
    color: var(--bg-color);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}

.chat-toggle:hover {
    transform: scale(1.1);
}

.chat-toggle svg {
    width: 30px;
    height: 30px;
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    transform-origin: bottom right;
    animation: chatOpen 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.chat-window.active {
    display: flex;
}

@keyframes chatOpen {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
}

.chat-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.chat-close:hover {
    color: var(--text-primary);
}

.chat-body {
    height: 300px;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
}

.chat-message.bot {
    background: rgba(255, 255, 255, 0.1);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-message.user {
    background: var(--text-primary);
    color: var(--bg-color);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message p {
    margin: 0;
    font-size: inherit;
    color: inherit;
}

.chat-footer {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.chat-footer input {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 10px 15px;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
}

.chat-footer input:focus {
    border-color: rgba(255, 255, 255, 0.3);
}

.chat-footer button {
    background: var(--text-primary);
    color: var(--bg-color);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.chat-footer button:hover {
    background: #ffffff;
}
/* ===========================
   FORMULAIRE DE CONTACT
   =========================== */

.contact-form-wrapper {
    max-width: 720px;
    margin: 50px auto 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 48px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    min-width: 0;
}

/* Téléphone : drapeau du pays affiché dans le champ dès que l'indicatif est tapé (script.js) */
.phone-field {
    position: relative;
}

.phone-field input {
    transition: border-color 0.25s ease, box-shadow 0.25s ease, padding-left 0.2s ease;
}

.phone-flag {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 22px;
    height: 16px;
    transform: translateY(-50%) scale(0.6);
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.phone-field.has-flag .phone-flag {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.phone-field.has-flag input {
    padding-left: 50px;   /* place pour le drapeau */
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.required {
    color: var(--accent-color);
    margin-left: 2px;
}

.form-group input,
.form-group textarea {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    resize: none;
    width: 100%; /* sans largeur minimale imposée : pas de débordement sur les petits écrans */
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.form-group input.invalid,
.form-group textarea.invalid {
    border-color: #ff453a;
}

.field-error {
    font-size: 0.78rem;
    color: #ff453a;
    margin-top: 5px;
    min-height: 16px;
    display: block;
}

.form-submit-row {
    margin-top: 10px;
    text-align: center;
}

.btn-form-submit {
    background: var(--text-primary);
    color: var(--bg-color);
    border: none;
    padding: 14px 36px;
    border-radius: 30px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-form-submit:hover:not(:disabled) {
    transform: scale(1.04);
    background: #ffffff;
}

.btn-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    width: 18px;
    height: 18px;
    animation: spin 0.9s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.form-feedback {
    margin-top: 24px;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    text-align: center;
    font-weight: 500;
}

.form-feedback.success {
    background: rgba(48, 209, 88, 0.12);
    border: 1px solid rgba(48, 209, 88, 0.3);
    color: #30d158;
}

.form-feedback.error {
    background: rgba(255, 69, 58, 0.12);
    border: 1px solid rgba(255, 69, 58, 0.3);
    color: #ff453a;
}

.contact-direct {
    text-align: center;
    margin-top: 32px;
}

.contact-direct p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}

.contact-email-link {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    transition: border-color 0.3s;
}

.contact-email-link:hover {
    border-color: var(--text-primary);
}

/* Responsive formulaire */
@media (max-width: 768px) {
    .contact-form-wrapper {
        padding: 28px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* ===========================
   FIXES RESPONSIVE & CROSS-BROWSER
   =========================== */

/* --- Firefox : backdrop-filter fallback --- */
@supports not (backdrop-filter: blur(12px)) {
    .navbar {
        background: rgba(0, 0, 0, 0.92);
    }
    .chat-window {
        background: rgba(20, 20, 20, 0.97);
    }
    .contact-form-wrapper {
        background: rgba(20, 20, 20, 0.95);
    }
}

/* --- Désactiver cursor-glow sur tactile --- */
@media (hover: none) and (pointer: coarse) {
    .cursor-glow { display: none; }
}

/* --- Tablette (max 1024px) --- */
@media (max-width: 1024px) {
    h1 { font-size: 4rem; }

    .activity-showcase { --showcase-gap: 30px; }

    .contact-form-wrapper { padding: 36px 32px; }
}

/* --- Mobile (max 768px) --- */
@media (max-width: 768px) {
    h1 { font-size: 2.6rem; letter-spacing: -0.03em; }
    h2 { font-size: 1.75rem; }
    p  { font-size: 1.05rem; }

    /* Navbar mobile : hamburger à gauche, logo centré */
    .navbar {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        padding: 16px 20px; /* 16px : le logo de 72px tient dans le bandeau */
    }

    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin-bottom: 0;
    }

    .logo img { height: 72px; }

    /* Sur mobile, l'alignement JS est ignoré — hamburger collé à gauche */
    .hamburger-menu { margin-left: 0 !important; }

    /* Hero */
    .hero { padding-top: 110px; padding-bottom: 0; }

    .activity { padding-top: 88px; }   /* espace visible d'environ 155px */

    .hero-content { padding: 0 16px; }

    .hero-image-container {
        margin-top: 36px;
        border-radius: 14px;
    }

    /* Sections */
    section { padding: 80px 0; min-height: auto; }

    .container { padding: 0 16px; }

    /* Activité */
    .activity-showcase,
    .activity-showcase.reverse {
        flex-direction: column;
        align-items: stretch;   /* texte et visuel sur toute la largeur de l'écran */
        gap: 24px;
        margin-top: 40px;
    }

    .showcase-text,
    .showcase-image { flex: 1; }   /* sur mobile, texte et visuel gardent toute la largeur */
    .activity-showcase .showcase-text,
    .activity-showcase.reverse .showcase-text { margin: 0; }

    .showcase-text h3 { font-size: 1.5rem; }

    /* Références */
    .references { padding: 27px 0; }   /* espaces réduits d'un tiers : 160px → 107px */

    .references-grid { gap: 14px; }

    .ref-item { flex-basis: calc((100% - 28px) / 3); height: 120px; padding: 14px; }

    .ref-item img { height: calc(var(--logo-h, 64px) * 0.65); }

    /* Formulaire */
    .contact-form-wrapper {
        padding: 24px 18px;
        border-radius: 18px;
        margin-top: 32px;
    }

    .form-row { grid-template-columns: 1fr; gap: 0; }

    /* 16px minimum : en dessous, l'iPhone zoome automatiquement sur le champ touché */
    .form-group input,
    .form-group textarea { font-size: 16px; }

    /* Chatbot : coller au bord sans déborder */
    .chatbot-container { bottom: 16px; right: 16px; }

    .chat-window {
        width: calc(100vw - 32px);
        max-width: 340px;
        right: 0;
        bottom: 72px;
    }

    .chat-toggle { width: 52px; height: 52px; }
    .chat-toggle svg { width: 24px; height: 24px; }
}

/* --- Très petits écrans (max 400px — iPhone SE, Galaxy A) --- */
@media (max-width: 400px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }

    .navbar { padding: 10px 14px; }

    .nav-links a { font-size: 0.75rem; }

    .logo img { height: 60px; }

    .hero { padding-top: 100px; }

    .btn-primary, .btn-secondary {
        padding: 11px 20px;
        font-size: 0.9rem;
    }

    .references-grid { gap: 10px; }

    .ref-item { flex-basis: calc((100% - 20px) / 3); height: 92px; padding: 10px 6px; border-radius: 12px; }

    .ref-item img { height: calc(var(--logo-h, 64px) * 0.5); }

    .chat-window { width: calc(100vw - 24px); }
}

/* ===========================
   HAMBURGER MENU (3 barres)
   =========================== */

/* Cacher l'ancienne nav-links si elle existe encore */
.nav-links { display: none !important; }

/* Conteneur relatif pour positionner le dropdown */
.hamburger-menu {
    position: relative;
    /* L'alignement précis avec l'image hero est géré par JS (alignHamburger) */
}

/* Bouton 3 barres */
.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 6px;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.hamburger-btn:hover,
.hamburger-btn:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

/* Croix quand ouvert */
.hamburger-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Dropdown */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    /* Fond opaque : le flou ne peut pas agir sous un élément du bandeau (qui a déjà son propre flou),
       le texte de la page transparaissait derrière les liens */
    background: #0e0e0e;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    min-width: 180px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);

    /* État fermé */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top left;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    z-index: 2000;
}

/* Firefox fallback */
@supports not (backdrop-filter: blur(20px)) {
    .nav-dropdown { background: rgba(15, 15, 15, 0.98); }
}

/* État ouvert */
.nav-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.nav-dropdown-link {
    display: block;
    padding: 14px 22px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    opacity: 0.85;
    transition: background 0.2s ease, opacity 0.2s ease, padding-left 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.nav-dropdown-link:last-child {
    border-bottom: none;
}

.nav-dropdown-link:hover {
    background: rgba(255, 255, 255, 0.07);
    opacity: 1;
    padding-left: 28px;
}

/* ===========================
   CHOIX DE LA LANGUE (FR | ENG)
   =========================== */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.06em;
}

.lang-switch a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 4px;
    transition: color 0.2s ease;
}

.lang-switch a:hover,
.lang-switch a:focus-visible {
    color: var(--text-primary);
}

.lang-switch a.active {
    color: var(--text-primary);
}

.lang-switch span {
    color: rgba(255, 255, 255, 0.25);
}

@media (max-width: 768px) {
    /* Sur mobile, l'alignement sur la photo est ignoré : sélecteur collé au bord droit */
    .lang-switch { margin-right: 0 !important; margin-left: auto; font-size: 0.8rem; }
}

@media (max-width: 480px) {
    /* Téléphones : FR et ENG empilés pour laisser la place au logo */
    .lang-switch { flex-direction: column; gap: 0; font-size: 0.75rem; line-height: 1; }
    .lang-switch a { padding: 4px 2px; }
    .lang-switch span { display: none; }
}
