/*
 * Tempeos ⇄ Sitavista — la fenêtre qui suit le formulaire (M54, 1.7.0) et le bouton
 * pendant l'envoi. Un seul fichier pour les 38 sites : la police est celle du site,
 * les couleurs sont des nuances de noir sur blanc (contraste AA ou mieux), déclarées
 * une fois en variables. Lisible et utilisable sur téléphone (375 px) : champ en
 * 16 px (pas de zoom sur iPhone), cibles de 44 px.
 *
 * M55 (1.7.1) — aux couleurs du site : la couleur d'accent réglée dans le thème (Divi, lue
 * côté serveur et posée après ce fichier en `--ts-fu-accent`) colore le champ actif et le
 * choix d'une entreprise ; ses polices (`--ts-fu-font`, `--ts-fu-heading-font`) le texte et
 * le titre. Sans réglage, ces variables n'existent pas : l'encre et la police de la page.
 *
 * M60 (1.9.0) — pré-remplie : « C'est bien … ? », « Oui, c'est nous » (l'action principale, encre
 * pleine, lisible sur toute couleur de site) et « Non, chercher ». Ce qui est caché le reste, même
 * quand le thème du site donne un affichage à ses étiquettes.
 */

/* Un navigateur ancien, sans color-mix() : noir sur blanc, sans voile — lisible, jamais invisible. */
.ts-fu-overlay {
  --ts-fu-ink: #000;
  --ts-fu-muted: #000;
  --ts-fu-line: #000;
  --ts-fu-hover: #fff;
  --ts-fu-surface: #fff;
  --ts-fu-veil: transparent;
  --ts-fu-shadow: transparent;

  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--ts-fu-veil);
  font-family: var(--ts-fu-font, inherit);
  line-height: 1.5;
}

@supports (color: color-mix(in srgb, #000 50%, #fff)) {
  .ts-fu-overlay {
    --ts-fu-ink: color-mix(in srgb, #000 88%, #fff);
    --ts-fu-muted: color-mix(in srgb, #000 68%, #fff);
    --ts-fu-line: color-mix(in srgb, #000 24%, #fff);
    --ts-fu-hover: color-mix(in srgb, #000 6%, #fff);
    --ts-fu-veil: color-mix(in srgb, #000 70%, transparent);
    --ts-fu-shadow: color-mix(in srgb, #000 30%, transparent);
  }
}

html.ts-fu-open,
html.ts-fu-open body {
  overflow: hidden;
}

.ts-fu-box {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 28px 24px 24px;
  border: 1px solid var(--ts-fu-line);
  border-radius: 14px;
  background: var(--ts-fu-surface);
  color: var(--ts-fu-ink);
  box-shadow: 0 24px 60px var(--ts-fu-shadow);
  text-align: left;
}

.ts-fu-box *,
.ts-fu-box *::before,
.ts-fu-box *::after {
  box-sizing: border-box;
}

.ts-fu-box [hidden] {
  display: none !important;
}

.ts-fu-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ts-fu-muted);
  cursor: pointer;
}

.ts-fu-close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.ts-fu-title {
  margin: 0 48px 8px 0;
  font-family: var(--ts-fu-heading-font, inherit);
  font-size: 1.4em;
  line-height: 1.3;
  color: var(--ts-fu-ink);
}

.ts-fu-email,
.ts-fu-question,
.ts-fu-next {
  margin: 0 0 12px;
  font-size: 1em;
  color: var(--ts-fu-ink);
}

.ts-fu-email {
  overflow-wrap: anywhere;
}

.ts-fu-next {
  margin: 16px 0 0;
  color: var(--ts-fu-muted);
}

.ts-fu-label {
  display: block;
  margin: 8px 0 6px;
  font-weight: 700;
  font-size: 1em;
  color: var(--ts-fu-ink);
}

.ts-fu-input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--ts-fu-line);
  border-radius: 8px;
  background: var(--ts-fu-surface);
  color: var(--ts-fu-ink);
  font: inherit;
  font-size: 16px;
}

.ts-fu-close:focus-visible,
.ts-fu-way:focus-visible {
  outline: 3px solid var(--ts-fu-ink);
  outline-offset: 2px;
}

/* Le champ actif : la couleur d'accent du site, sinon l'encre. */
.ts-fu-input:focus {
  border-color: var(--ts-fu-accent, var(--ts-fu-ink));
  outline: 3px solid var(--ts-fu-accent, var(--ts-fu-ink));
  outline-offset: 2px;
}

.ts-fu-status {
  min-height: 1.5em;
  margin: 8px 0;
  font-size: 0.95em;
  color: var(--ts-fu-muted);
}

.ts-fu-results {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 45vh;
  overflow-y: auto;
}

.ts-fu-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 44px;
  margin: 0 0 6px;
  padding: 10px 12px;
  border: 1px solid var(--ts-fu-line);
  border-radius: 8px;
  cursor: pointer;
}

/* Le choix d'une entreprise, l'action principale de la fenêtre : la couleur d'accent du site, sinon l'encre. */
.ts-fu-option[aria-selected="true"],
.ts-fu-option:hover {
  border-color: var(--ts-fu-accent, var(--ts-fu-ink));
  background: var(--ts-fu-hover);
  box-shadow: inset 4px 0 0 var(--ts-fu-accent, var(--ts-fu-ink));
}

.ts-fu-name {
  font-weight: 700;
  font-size: 1em;
  color: var(--ts-fu-ink);
  overflow-wrap: anywhere;
}

.ts-fu-meta {
  font-size: 0.9em;
  color: var(--ts-fu-muted);
}

.ts-fu-ways {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.ts-fu-way {
  flex: 1 1 220px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--ts-fu-line);
  border-radius: 8px;
  background: var(--ts-fu-surface);
  color: var(--ts-fu-ink);
  font: inherit;
  font-size: 0.95em;
  text-align: center;
  cursor: pointer;
}

.ts-fu-way:hover {
  border-color: var(--ts-fu-ink);
  background: var(--ts-fu-hover);
}

.ts-fu-match-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ts-fu-match-activity {
  margin: -6px 0 12px;
}

.ts-fu-confirm {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 0;
}

.ts-fu-yes,
.ts-fu-yes:hover {
  border-color: var(--ts-fu-ink);
  background: var(--ts-fu-ink);
  color: var(--ts-fu-surface);
  font-weight: 700;
}

.ts-fu-yes:hover {
  box-shadow: inset 0 0 0 2px var(--ts-fu-accent, var(--ts-fu-surface));
}

@media (max-width: 480px) {
  .ts-fu-overlay {
    align-items: flex-end;
    padding: 8px;
  }

  .ts-fu-box {
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    padding: 24px 16px 16px;
  }

  .ts-fu-title {
    font-size: 1.25em;
  }
}

/* Le bouton d'un formulaire couvert, pendant l'envoi : grisé, un second clic ne part pas. */
.wpcf7-form .ts-sending,
.wpcf7-form .ts-sending:hover {
  opacity: 0.6;
  cursor: progress;
  pointer-events: none;
}
