/* ============================================================================
   UCE — Composants d'interface
   Écran de chargement, curseur, bascule de thème « hublot », sélecteur de
   langue, en-tête, menu mobile, bouton de contact flottant, cookies,
   champs de formulaire.
   ========================================================================== */

/* ============================================================================
   Écran de chargement
   Repris de l'ancien projet : compteur à rouleaux en bas à gauche, barre de
   progression en haut, libellé animé. Adapté au bleu UCE, avec la pyramide
   du logo qui se remplit au rythme du pourcentage.
   ========================================================================== */

.loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(22px, 4vw, 48px);
  background:
    radial-gradient(120% 90% at 85% 10%, rgba(42, 99, 214, 0.28), transparent 60%),
    var(--uce-navy);
  color: #DCE6FA;
  font-family: var(--font-body);
  font-feature-settings: "tnum";
  clip-path: inset(0 0 0 0);
  transition: clip-path 900ms var(--ease-in-out), visibility 900ms;
}

/* Sortie en rideau : le voile remonte et découvre la page */
.loader.is-done {
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
}

.loader::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: repeating-conic-gradient(#fff 0% 25%, transparent 0% 50%);
  background-size: 3px 3px;
}

.loader__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.loader__label {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  font-weight: 600;
  opacity: 0.85;
}

.loader__label i {
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-left: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.25;
  animation: loaderDot 1.2s infinite;
}

.loader__label i:nth-child(2) { animation-delay: 0.2s; }
.loader__label i:nth-child(3) { animation-delay: 0.4s; }

@keyframes loaderDot {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

/* Pyramide qui se remplit : --p va de 0 à 1 */
.loader__mark {
  width: clamp(44px, 6vw, 64px);
  height: auto;
  --p: 0;
}

.loader__mark .fill {
  transform-origin: 50% 100%;
  transform: scaleY(var(--p));
  transition: transform 520ms var(--ease);
}

.loader__count {
  display: flex;
  align-items: flex-end;
  --cell: 1.04em;
  line-height: var(--cell);
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.04em;
  font-size: clamp(4.4rem, 17vw, 12rem);
  color: #FFFFFF;
}

.loader__digits { display: flex; }

.loader__digit {
  height: var(--cell);
  overflow: hidden;
}

.loader__digit span {
  display: block;
  transition: transform 220ms cubic-bezier(0.3, 1.1, 0.4, 1);
}

.loader__digit b {
  display: block;
  height: var(--cell);
  line-height: var(--cell);
  text-align: center;
  font-weight: 400;
}

.loader__pct {
  font-size: 0.3em;
  font-family: var(--font-body);
  font-weight: 600;
  padding-bottom: 0.36em;
  margin-left: 0.14em;
  opacity: 0.55;
}

.loader__meta {
  position: absolute;
  right: clamp(22px, 4vw, 48px);
  bottom: clamp(22px, 4vw, 48px);
  font-size: 0.78rem;
  text-align: right;
  line-height: 1.5;
  opacity: 0.55;
}

.loader__bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(207, 224, 255, 0.12);
}

.loader__bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2A63D6, #CFE0FF);
  transition: width 620ms var(--ease);
}

@media (max-width: 520px) {
  .loader__meta { display: none; }
}

/* ============================================================================
   Curseur personnalisé
   Principe conservé de l'ancien projet : disque blanc en mix-blend-mode
   difference, suivi amorti. Ajouts : un mode « libellé » sur les cartes
   (le disque devient bleu plein et affiche une action), et une désactivation
   totale sans pointeur fin.
   ========================================================================== */

.cursor,
.cursor-label {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
}

.cursor {
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: #FFFFFF;
  mix-blend-mode: difference;
  opacity: 0;
  transition: width 320ms var(--ease), height 320ms var(--ease), margin 320ms var(--ease),
    opacity 200ms linear, background-color 240ms linear;
}

.cursor.is-active { opacity: 1; }

/* Sur les flèches et puces des carrousels, le disque en « différence » inverserait les
   couleurs du bouton (bleu devenu jaune, flèche noire). On l'efface : le pointeur
   natif reste visible. */
.cursor.is-quiet { opacity: 0 !important; }

.cursor.is-hovering {
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
}

.cursor.is-pressed {
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
}

.cursor.is-label {
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  mix-blend-mode: normal;
  background: var(--brand-hi);
}

.cursor.is-text {
  width: 3px;
  height: 26px;
  margin: -13px 0 0 -1.5px;
  border-radius: 2px;
}

.cursor-label {
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  display: grid;
  place-items: center;
  color: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  opacity: 0;
  transform-origin: center;
  transition: opacity 200ms linear;
}

[data-theme="dark"] .cursor-label { color: var(--uce-navy); }

.cursor-label.is-visible { opacity: 1; }

@media (hover: none), (pointer: coarse) {
  .cursor,
  .cursor-label { display: none; }
}

/* ============================================================================
   Bascule de thème « hublot » (reprise de l'ancien projet)
   ========================================================================== */

.shade-veil {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  background: #060F24;
}

.shade-veil.is-settling { transition: opacity 340ms var(--ease); }

.shade {
  position: relative;
  width: 62px;
  height: 32px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  flex-shrink: 0;
  touch-action: none;
}

/* Rails décoratifs : les hachures du logo, en miniature */
.shade::before {
  content: "";
  position: absolute;
  inset: 9px 12px;
  border-radius: 4px;
  background: repeating-linear-gradient(0deg, var(--hatch) 0 1px, transparent 1px 4px);
  opacity: 0.9;
}

.shade__handle {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  box-shadow: 0 3px 10px rgba(7, 22, 52, 0.3);
  transform: translateX(var(--shade-x, 0px));
}

.shade__handle.is-settling { transition: transform 340ms var(--ease); }
.shade__handle:active { cursor: grabbing; }
.shade__handle svg { width: 14px; height: 14px; }
.shade__handle .icon-sun { display: none; }
[data-theme="dark"] .shade__handle .icon-moon { display: none; }
[data-theme="dark"] .shade__handle .icon-sun { display: block; }

/* ============================================================================
   Sélecteur de langue : deux options, une glissière
   ========================================================================== */

.lang-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  height: 32px;
  padding: 3px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  flex-shrink: 0;
}

.lang-switch__thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / 3);
  border-radius: var(--r-pill);
  background: var(--brand);
  transition: transform 420ms var(--ease);
}

html[lang="en"] .lang-switch__thumb { transform: translateX(100%); }
html[lang="es"] .lang-switch__thumb { transform: translateX(200%); }

.lang-switch button {
  position: relative;
  z-index: 1;
  min-width: 30px;
  padding: 0 0.45rem;
  border-radius: var(--r-pill);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  transition: color 300ms var(--ease);
}

.lang-switch button[aria-pressed="true"] { color: var(--brand-ink); }

/* ============================================================================
   En-tête
   En haut de page : posé sur le hero, transparent. Au défilement : il se
   resserre en barre flottante vitrée. Il se retire quand on descend et
   revient dès qu'on remonte.
   ========================================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 900;
  padding-top: 0;
  transition: transform 520ms var(--ease), padding 520ms var(--ease);
}

.site-header.is-hidden { transform: translateY(-120%); }

.site-header__bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--header-h);
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
  border: 1px solid transparent;
  border-radius: 0;
  transition: max-width 520ms var(--ease), height 520ms var(--ease), background-color 400ms var(--ease),
    border-color 400ms var(--ease), border-radius 520ms var(--ease), box-shadow 400ms var(--ease);
}

.site-header.is-scrolled { padding-top: 10px; }

.site-header.is-scrolled .site-header__bar {
  max-width: calc(var(--container) + 24px);
  height: 64px;
  padding-inline: clamp(14px, 2vw, 22px);
  background: var(--glass);
  border-color: var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-2);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
}

@media (max-width: 1320px) {
  .site-header.is-scrolled .site-header__bar {
    max-width: calc(100% - 20px);
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  min-width: 0;
}

.brand__mark {
  width: 40px;
  height: 36px;
  flex-shrink: 0;
  color: var(--brand);
  transition: transform 600ms var(--ease);
}

.brand:hover .brand__mark { transform: translateY(-2px); }

/* Marque animée : les hachures se tracent au chargement, et de nouveau au survol.
   C'est l'effet de construction qui était porté par la grande pyramide. */
.brand__mark--animated .m-line {
  stroke-dasharray: 52;
  stroke-dashoffset: 52;
  transition: stroke-dashoffset 800ms var(--ease);
  transition-delay: calc(500ms + var(--li, 0) * 55ms);
}

.is-ready .brand__mark--animated .m-line { stroke-dashoffset: 0; }

.brand:hover .brand__mark--animated .m-line {
  animation: markDraw 900ms var(--ease) both;
  animation-delay: calc(var(--li, 0) * 45ms);
}

@keyframes markDraw {
  0% { stroke-dashoffset: 52; }
  60%, 100% { stroke-dashoffset: 0; }
}

.brand__mark--animated .m-solid {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: scaleY(0);
  transition: transform 900ms var(--ease) 450ms;
}

.is-ready .brand__mark--animated .m-solid { transform: none; }

.brand__mark--animated .m-text {
  opacity: 0;
  transition: opacity 600ms var(--ease) 1100ms;
}

.is-ready .brand__mark--animated .m-text { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .brand__mark--animated .m-line { stroke-dashoffset: 0; }
  .brand__mark--animated .m-solid { transform: none; }
  .brand__mark--animated .m-text { opacity: 1; }
  .brand:hover .brand__mark--animated .m-line { animation: none; }
}

.brand__text {
  display: grid;
  line-height: 1.05;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.brand__sub {
  font-size: 0.68rem;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.site-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-inline: auto;
}

.site-nav a {
  position: relative;
  padding: 0.5rem 0.8rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: var(--r-pill);
  white-space: nowrap;
  transition: color 250ms var(--ease);
}

.site-nav a:hover,
.site-nav a.is-active { color: var(--ink); }

/* Indicateur qui glisse sous le lien actif */
/* ---------- Menu déroulant de la navigation ---------- */

.nav-drop { position: relative; }

.nav-drop__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.8rem;
  border-radius: var(--r-pill);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color 250ms var(--ease);
}

.nav-drop__toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 350ms var(--ease);
}

.nav-drop__toggle:hover,
.nav-drop__toggle.is-active,
.nav-drop.is-open .nav-drop__toggle { color: var(--ink); }
.nav-drop.is-open .nav-drop__toggle svg { transform: rotate(180deg); }

.nav-drop__menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 10;
  display: grid;
  gap: 4px;
  width: 310px;
  padding: 8px;
  border-radius: var(--r-m);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  transform: translate(-50%, -8px);
  transform-origin: top center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms var(--ease), transform 340ms var(--ease), visibility 0s linear 340ms;
}

.nav-drop.is-open .nav-drop__menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 240ms var(--ease), transform 340ms var(--ease), visibility 0s;
}

.nav-drop__menu a {
  display: grid;
  gap: 0.15rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--r-s);
  white-space: normal;
  transition: background-color 250ms var(--ease);
}

.nav-drop__menu a:hover { background: var(--brand-soft); }
.nav-drop__label { font-size: 0.78rem; color: var(--brand); font-weight: 600; }
.nav-drop__title { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.25; color: var(--ink); }

.site-nav__indicator {
  position: absolute;
  bottom: 2px;
  left: 0;
  height: 2px;
  width: 0;
  border-radius: 2px;
  background: var(--brand);
  opacity: 0;
  transition: transform 500ms var(--ease), width 500ms var(--ease), opacity 300ms linear;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

/* Seulement quand la navigation est affichée : sinon les commandes doivent
   rester collées au bord droit (le bouton du menu, notamment). */
@media (min-width: 1121px) {
  .site-nav + .site-header__actions { margin-left: 0; }
}

.menu-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  flex-shrink: 0;
}

.menu-toggle span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 1.6px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 420ms var(--ease), opacity 200ms linear, top 420ms var(--ease);
}

.menu-toggle span:nth-child(1) { top: 16px; }
.menu-toggle span:nth-child(2) { top: 21px; }
.menu-toggle span:nth-child(3) { top: 26px; }

.menu-open .menu-toggle span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
.menu-open .menu-toggle span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

@media (max-width: 1120px) {
  .site-nav { display: none; }
  .menu-toggle { display: inline-block; }
  .site-header__actions { margin-left: auto; }
}

@media (max-width: 760px) {
  .header-cta { display: none; }
}

@media (max-width: 560px) {
  :root { --header-h: 68px; }
  .site-header__actions .lang-switch { display: none; }
  .brand__sub { display: none; }
  .brand__name { font-size: 1.02rem; }
}

@media (max-width: 430px) {
  .brand__name { font-size: 0.92rem; white-space: normal; line-height: 1.1; max-width: 8.5em; }
  .brand__mark { width: 34px; height: 32px; }
  .site-header__bar { gap: 0.5rem; }
}

/* ---------- Menu mobile ---------- */

/* Sous l'en-tête (900) pour que le bouton de fermeture reste accessible ;
   la bannière cookies, elle, est masquée tant que le menu est ouvert. */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 880;
  display: flex;
  flex-direction: column;
  padding: calc(var(--header-h) + 24px) var(--gutter) max(24px, env(safe-area-inset-bottom));
  background: var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
  clip-path: circle(0% at calc(100% - 44px) 38px);
  visibility: hidden;
  transition: clip-path 700ms var(--ease-in-out), visibility 0s linear 700ms;
}

.mobile-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--zellige);
  background-size: 120px 120px;
  opacity: 0.6;
  -webkit-mask-image: linear-gradient(180deg, transparent 30%, #000);
  mask-image: linear-gradient(180deg, transparent 30%, #000);
}

.menu-open .mobile-menu {
  clip-path: circle(150% at calc(100% - 44px) 38px);
  visibility: visible;
  transition: clip-path 800ms var(--ease-in-out), visibility 0s;
}

.mobile-menu__nav {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 2rem;
}

.mobile-menu__nav a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 3.6vw, 1.22rem);
  line-height: 1.15;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 500ms var(--ease), transform 600ms var(--ease), color 250ms;
}

.mobile-menu__nav a.mobile-menu__sub {
  justify-content: flex-start;
  align-items: center;
  padding-left: 1.25rem;
  font-size: clamp(0.92rem, 3.1vw, 1.05rem);
  color: var(--ink-2);
}

.mobile-menu__nav a.mobile-menu__sub::before {
  content: "";
  width: 9px;
  height: 8px;
  margin-right: 0.7rem;
  flex-shrink: 0;
  align-self: center;
  background: var(--brand);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.mobile-menu__nav a small {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--ink-3);
}

.mobile-menu__nav a:active { color: var(--brand); }

.menu-open .mobile-menu__nav a {
  opacity: 1;
  transform: none;
  transition-delay: calc(180ms + var(--i, 0) * 55ms);
}

.mobile-menu__footer {
  display: grid;
  gap: 1.25rem;
  margin-top: auto;
  opacity: 0;
  transition: opacity 500ms var(--ease);
}

.menu-open .mobile-menu__footer {
  opacity: 1;
  transition-delay: 520ms;
}

.mobile-menu__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--ink-2);
  font-size: 0.9rem;
}

.mobile-menu__controls > div {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ---------- Menu mobile : branche repliable « Nous solliciter » ---------- */

.mobile-menu__branch-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 3.6vw, 1.22rem);
  font-weight: 450;
  line-height: 1.2;
  text-align: left;
  color: inherit;
}

.mobile-menu__branch-toggle svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--brand);
  transition: transform 400ms var(--ease);
}

.mobile-menu__branch.is-open .mobile-menu__branch-toggle svg { transform: rotate(180deg); }

/* Replié par défaut : la hauteur s'anime de 0fr à 1fr, sans hauteur fixe. */
.mobile-menu__sublist {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 450ms var(--ease);
}

.mobile-menu__sublist > div { overflow: hidden; min-height: 0; }

.mobile-menu__branch.is-open .mobile-menu__sublist { grid-template-rows: 1fr; }

.mobile-menu__nav a.mobile-menu__sub {
  justify-content: flex-start;
  align-items: center;
  padding-left: 1.1rem;
  font-size: clamp(0.92rem, 3.1vw, 1.05rem);
  color: var(--ink-2);
}

.mobile-menu__nav a.mobile-menu__sub::before {
  content: "";
  width: 9px;
  height: 8px;
  margin-right: 0.7rem;
  flex-shrink: 0;
  background: var(--brand);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.mobile-menu__contact {
  display: grid;
  gap: 0.25rem;
  color: var(--ink-2);
  font-size: 0.95rem;
}

.mobile-menu__contact a { color: var(--ink); font-weight: 600; }

.mobile-menu .btn { width: 100%; }

@media (min-width: 1121px) {
  .mobile-menu { display: none; }
}

/* Menu ouvert : la bannière cookies s'efface pour qu'aucun texte ne se
   superpose. Le défilement reste possible, et il referme le menu (nav.js). */
body.menu-open .cookie-banner { opacity: 0; pointer-events: none; visibility: hidden; }

/* ============================================================================
   Contact flottant : « Nous contacter » → WhatsApp ou appel
   ========================================================================== */

.contact-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  pointer-events: none;
  transition: opacity 500ms var(--ease), transform 600ms var(--ease);
}

.contact-fab.is-shown {
  opacity: 1;
  transform: none;
  /* Le conteneur mesure ~300 × 330 px (il loge le panneau), mais seul le rond de 54 px est
     visible : s'il captait les clics, il bloquerait tout un coin de la page. On ne rend
     cliquables que le bouton et, une fois ouvert, le panneau. */
  pointer-events: none;
}

.contact-fab.is-shown .contact-fab__trigger,
.contact-fab.is-open .contact-fab__panel { pointer-events: auto; }

.contact-fab__trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  height: 54px;
  padding: 0 1.25rem 0 0.5rem;
  border-radius: var(--r-pill);
  background: var(--uce-navy);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 16px 40px -14px rgba(7, 22, 52, 0.65);
  transition: transform 400ms var(--ease), background-color 300ms var(--ease);
}

[data-theme="dark"] .contact-fab__trigger {
  background: var(--brand);
  color: var(--brand-ink);
}

.contact-fab__trigger:hover { transform: translateY(-2px); }

/* Sans libellé : une pastille ronde, discrète */
.contact-fab__trigger--icon {
  width: 58px;
  height: 58px;
  padding: 0;
  justify-content: center;
}

.contact-fab__trigger--icon .contact-fab__icon {
  width: 58px;
  height: 58px;
  background: none;
}

.contact-fab__trigger--icon .contact-fab__icon svg { width: 24px; height: 24px; }

.contact-fab__icon {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .contact-fab__icon { background: rgba(6, 18, 43, 0.12); }

.contact-fab__icon svg {
  position: absolute;
  width: 20px;
  height: 20px;
  transition: transform 450ms var(--ease), opacity 250ms linear;
}

.contact-fab__icon .icon-close { opacity: 0; transform: rotate(-90deg) scale(0.6); }
.contact-fab.is-open .icon-chat { opacity: 0; transform: rotate(90deg) scale(0.6); }
.contact-fab.is-open .icon-close { opacity: 1; transform: none; }

/* Onde discrète, une seule fois à l'apparition */
.contact-fab.is-shown .contact-fab__trigger::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid var(--brand-hi);
  animation: fabPing 1.6s var(--ease) 600ms 2 both;
  pointer-events: none;
}

@keyframes fabPing {
  0% { opacity: 0.7; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.18); }
}

.contact-fab__panel {
  display: grid;
  gap: 8px;
  width: min(300px, calc(100vw - 32px));
  padding: 10px;
  border-radius: var(--r-m);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  transform-origin: bottom right;
  opacity: 0;
  transform: translateY(12px) scale(0.94);
  visibility: hidden;
  transition: opacity 280ms var(--ease), transform 420ms var(--ease), visibility 0s linear 420ms;
}

.contact-fab.is-open .contact-fab__panel {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition: opacity 280ms var(--ease), transform 420ms var(--ease), visibility 0s;
}

.contact-fab__title {
  padding: 6px 8px 4px;
  font-size: 0.82rem;
  color: var(--ink-3);
}

.contact-option {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 60px;
  padding: 10px 12px;
  border-radius: var(--r-s);
  transition: background-color 250ms var(--ease), transform 350ms var(--ease);
  opacity: 0;
  transform: translateY(8px);
}

.contact-fab.is-open .contact-option {
  opacity: 1;
  transform: none;
  transition: background-color 250ms var(--ease), transform 450ms var(--ease) calc(80ms + var(--i, 0) * 60ms),
    opacity 300ms var(--ease) calc(80ms + var(--i, 0) * 60ms);
}

.contact-option:hover { background: var(--brand-soft); }

.contact-option__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #FFFFFF;
}

.contact-option__icon svg { width: 22px; height: 22px; }
.contact-option--wa .contact-option__icon { background: #1FA855; }
.contact-option--tel .contact-option__icon { background: var(--uce-blue); }
.contact-option--mail .contact-option__icon { background: var(--uce-navy); }

.contact-option__text { display: grid; line-height: 1.3; min-width: 0; }
.contact-option__text strong { font-size: 0.98rem; }
.contact-option__text span { font-size: 0.84rem; color: var(--ink-3); font-feature-settings: "tnum"; }

body.has-cookie-banner .contact-fab { opacity: 0; pointer-events: none; }

@media (max-width: 560px) {
  .contact-fab__trigger { padding-right: 1rem; height: 52px; }
  .contact-fab__trigger--icon { width: 54px; height: 54px; padding: 0; }
  .contact-fab__trigger--icon .contact-fab__icon { width: 54px; height: 54px; }
}

/* Masqué pendant l'ouverture du menu mobile */
body.menu-open .contact-fab { opacity: 0; pointer-events: none; }

/* ============================================================================
   Consentement cookies
   ========================================================================== */

.cookie-banner {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 950;
  width: min(440px, calc(100vw - 32px));
  padding: 1.35rem 1.35rem 1.15rem;
  border-radius: var(--r-m);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  opacity: 0;
  transform: translateY(20px);
  visibility: hidden;
  transition: opacity 450ms var(--ease), transform 600ms var(--ease), visibility 0s linear 600ms;
}

.cookie-banner.is-visible {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition: opacity 450ms var(--ease), transform 600ms var(--ease), visibility 0s;
}

.cookie-banner h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.cookie-banner h2 svg { width: 20px; height: 20px; color: var(--brand); flex-shrink: 0; }

.cookie-banner p {
  font-size: 0.9rem;
  color: var(--ink-2);
  line-height: 1.55;
}

.cookie-banner p a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

.cookie-banner__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
}

.cookie-banner__actions .btn { min-height: 44px; padding-inline: 0.8rem; font-size: 0.9rem; }

.cookie-banner__manage {
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 0.15rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-banner__manage:hover { color: var(--brand); }

@media (max-width: 560px) {
  .cookie-banner {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    border-radius: var(--r-m) var(--r-m) 0 0;
    padding-bottom: max(1.15rem, env(safe-area-inset-bottom));
  }
}

/* Préférences : boîte de dialogue native */
.cookie-dialog {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-3);
}

.cookie-dialog::backdrop {
  background: rgba(4, 11, 30, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.cookie-dialog[open] { animation: dialogIn 480ms var(--ease); }

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.cookie-dialog__inner { padding: clamp(1.25rem, 4vw, 2rem); }

.cookie-dialog h2 { font-size: var(--step-2); margin-bottom: 0.5rem; }

.cookie-dialog__intro { color: var(--ink-2); font-size: 0.95rem; margin-bottom: 1.25rem; }

.cookie-pref {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  align-items: center;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.cookie-pref h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0;
}

.cookie-pref p {
  grid-column: 1 / -1;
  font-size: 0.88rem;
  color: var(--ink-2);
}

.cookie-pref__always {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--success);
}

/* Interrupteur */
.switch {
  position: relative;
  display: inline-flex;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: var(--r-pill);
  background: var(--line-strong);
  transition: background-color 250ms var(--ease);
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform 350ms var(--ease);
}

.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 3px; }

.cookie-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

@media (max-width: 480px) {
  .cookie-dialog__actions .btn { flex: 1 1 100%; }
}

/* ============================================================================
   Champs de formulaire
   ========================================================================== */

.field {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.field label,
.field .field__label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.field label .req { color: var(--brand); margin-left: 2px; }
.field label .opt { color: var(--ink-3); font-weight: 500; }

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 0.75rem 0.95rem;
  border-radius: var(--r-s);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 220ms var(--ease), box-shadow 220ms var(--ease), background-color 220ms var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.field textarea {
  min-height: 150px;
  resize: vertical;
}

.field select {
  padding-right: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%236B7690' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--ink-3); opacity: 0.85; }

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--brand); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea,
.field.is-invalid .dropzone { border-color: var(--danger); }

.field__error {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--danger);
}

.field__error:empty { display: none; }

.field__hint { font-size: 0.8rem; color: var(--ink-3); }

/* Zone de dépôt de fichier */
.dropzone {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 64px;
  padding: 0.8rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-s);
  background: var(--surface-2);
  transition: border-color 220ms var(--ease), background-color 220ms var(--ease);
}

.dropzone:hover,
.dropzone.is-dragover { border-color: var(--brand); background: var(--brand-soft); }

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  min-height: 0;
  padding: 0;
}

.dropzone:focus-within { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); border-color: var(--brand); }

.dropzone__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  flex-shrink: 0;
}

.dropzone__icon svg { width: 20px; height: 20px; }

.dropzone__text { display: grid; font-size: 0.9rem; line-height: 1.35; min-width: 0; }
.dropzone__text strong { font-weight: 600; overflow-wrap: anywhere; }
.dropzone__text span { color: var(--ink-3); font-size: 0.8rem; }

.dropzone__clear {
  position: relative;
  z-index: 2;
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  flex-shrink: 0;
}

.dropzone__clear:hover { background: var(--surface); color: var(--danger); }
.dropzone__clear svg { width: 16px; height: 16px; }

/* Case de consentement */
.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  font-size: 0.88rem;
  color: var(--ink-2);
  line-height: 1.5;
}

.field .check input {
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  border-radius: 4px;
  -webkit-appearance: auto;
  appearance: auto;
  background: none;
  box-shadow: none;
  margin: 1px 0 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.check a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

/* Anti-spam : champ piège invisible pour les humains */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 700ms linear infinite;
}

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

.site-header__bar { min-width: 0; }
.brand__text { min-width: 0; overflow: hidden; }
