/* « Contactez-nous » : le bouton en bas à droite des pages publiques et
   son panneau (09/11/2026). Porté de la maquette validée par Joël
   (maquettes/contact/) ; le serveur : contact.py ; le script : contact.js.
   Tout est préfixé « ctc- » ; les couleurs sont celles de vitrine.css.
   Sobre (conception §1) : encre sur blanc, le seul rouge est « Envoyer ». */
.ctc {
  --ctc-encre: var(--encre, #3f4e55);
  --ctc-encre-2: var(--encre-2, #566972);
  --ctc-encre-3: var(--encre-3, #6c757d);
  --ctc-filet: var(--filet, rgba(0, 0, 0, .125));
  --ctc-bord-champ: var(--case-b, #c6c6c6);
  --ctc-action: var(--action, #a52524);
  --ctc-action-survol: var(--action-survol, rgba(165, 37, 36, .85));
  --ctc-fond: var(--fond, #feffff);
  --ctc-fond-alt: var(--fond-alt, #f3f5f3);
  --ctc-rayon: var(--rayon, 5px);
  --ctc-rayon-bloc: var(--rayon-bloc, 7px);
  --ctc-bas: 20px;          /* distance au bas de l'écran (le script la relève au-dessus du pied) */
  font: 400 16px/1.5 var(--police-corps, 'Lato', 'Segoe UI', sans-serif);
  color: var(--ctc-encre);
}
.ctc *, .ctc *::before, .ctc *::after { box-sizing: border-box; }
.ctc [hidden] { display: none !important; }

/* ── Le bouton ─────────────────────────────────────────────────────── */
.ctc-bouton {
  position: fixed; right: 20px; bottom: var(--ctc-bas); z-index: 90;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px 11px 15px;
  border: .8px solid var(--ctc-filet); border-radius: 999px;
  background: var(--ctc-fond); color: var(--ctc-encre);
  font: 400 .95rem/1 var(--police-corps, 'Lato', 'Segoe UI', sans-serif); letter-spacing: .01em;
  box-shadow: 0 4px 18px rgba(29, 36, 39, .12);
  cursor: pointer;
  transition: box-shadow .15s ease, border-color .15s ease, opacity .2s ease, transform .2s ease, bottom .2s ease;
}
.ctc-bouton:hover { border-color: var(--ctc-encre-3); box-shadow: 0 6px 22px rgba(29, 36, 39, .18); }
.ctc-bouton:focus-visible { outline: 2px solid var(--ctc-encre); outline-offset: 3px; }
.ctc-bouton svg { width: 19px; height: 19px; flex: none; }
.ctc-bouton[aria-expanded="true"] { border-color: var(--ctc-encre); }
/* Il s'efface quand il couvrirait un bouton de la page (conception §1),
   et sur la démo à l'étape du créneau, sur téléphone. */
.ctc-bouton.ctc-efface { opacity: 0; transform: translateY(8px); pointer-events: none; visibility: hidden; transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s; }

/* ── Le panneau ────────────────────────────────────────────────────── */
.ctc-voile { display: none; }
.ctc-panneau {
  position: fixed; right: 20px; bottom: calc(var(--ctc-bas) + 58px); z-index: 110;
  /* Jamais sur la barre du haut des pages (68 px) : son bouton « Demander
     une démo » reste visible ; au-delà, le panneau défile. */
  width: 392px; max-height: calc(100vh - var(--ctc-bas) - 58px - 80px); overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 24px 16px;
  background: var(--ctc-fond); border: .8px solid var(--ctc-filet); border-radius: var(--ctc-rayon-bloc);
  box-shadow: 0 14px 44px rgba(29, 36, 39, .2);
  opacity: 0; transform: translateY(10px); visibility: hidden;
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.ctc.ctc-ouvert .ctc-panneau { opacity: 1; transform: none; visibility: visible; transition: opacity .18s ease, transform .18s ease; }

.ctc-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ctc-titre { margin: 0; font: 700 1.35rem/1.15 var(--police-titre, 'Titillium Web', 'Segoe UI', sans-serif); color: var(--ctc-encre); }
.ctc-titre:focus { outline: none; }
.ctc-fermer {
  /* À droite, même quand le titre est caché (« Message reçu »). */
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; margin: -6px -10px 0 auto;
  border: 0; border-radius: 50%; background: transparent; color: var(--ctc-encre-2); cursor: pointer;
}
.ctc-fermer:hover { background: var(--ctc-fond-alt); color: var(--ctc-encre); }
.ctc-fermer:focus-visible { outline: 2px solid var(--ctc-encre); outline-offset: 1px; }
.ctc-fermer svg { width: 16px; height: 16px; }

/* Les deux raccourcis : peut-être la réponse est déjà là. */
.ctc-raccourcis { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.ctc-raccourcis a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border-radius: var(--ctc-rayon); background: var(--ctc-fond-alt);
  color: var(--ctc-encre); text-decoration: none; font-size: .95rem;
}
.ctc-raccourcis a:hover { background: #eceeec; }
.ctc-raccourcis a:focus-visible { outline: 2px solid var(--ctc-encre); outline-offset: 2px; }
.ctc-raccourcis svg { width: 14px; height: 14px; flex: none; color: var(--ctc-encre-3); }

.ctc-sep {
  display: flex; align-items: center; gap: 12px; margin: 18px 0 12px;
  font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ctc-encre-3);
}
.ctc-sep::before, .ctc-sep::after { content: ""; flex: 1; border-top: .8px solid var(--ctc-filet); }

/* ── Le formulaire (les champs des maquettes de la démo et de la connexion) ── */
.ctc-form { display: grid; gap: 12px; }
.ctc-champ { display: flex; flex-direction: column; gap: 5px; }
.ctc-champ label { font-size: .86rem; font-weight: 600; color: var(--ctc-encre-2); }
.ctc-facultatif { font-weight: 400; color: var(--ctc-encre-3); }
.ctc-champ input, .ctc-champ select, .ctc-champ textarea {
  width: 100%; padding: 10px 12px; margin: 0;
  border: .8px solid var(--ctc-bord-champ); border-radius: var(--ctc-rayon);
  background: var(--ctc-fond); color: var(--ctc-encre); font: 400 .97rem/1.35 var(--police-corps, 'Lato', 'Segoe UI', sans-serif);
  transition: border-color .15s ease;
}
.ctc-champ textarea { resize: vertical; min-height: 92px; }
.ctc-champ select {
  appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ctc-encre-2) 50%), linear-gradient(135deg, var(--ctc-encre-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
/* Au clic, seul le bord fonce : pas de halo (Joël, 04/11). */
.ctc-champ input:focus, .ctc-champ select:focus, .ctc-champ textarea:focus { outline: none; border-color: var(--ctc-encre); box-shadow: none; }
/* Un champ à corriger reste rouge, même cliqué. */
.ctc-champ [aria-invalid="true"], .ctc-champ [aria-invalid="true"]:focus { border-color: var(--ctc-action); }
.ctc-sous-champ { display: flex; justify-content: space-between; gap: 10px; }
.ctc-erreur { font-size: .84rem; font-weight: 600; color: var(--ctc-action); }
.ctc-erreur:empty { display: none; }
.ctc-compteur { margin-left: auto; font-size: .8rem; color: var(--ctc-encre-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ctc-compteur.ctc-trop { color: var(--ctc-action); font-weight: 600; }
/* Le champ piège : invisible pour une personne, rempli par les robots. */
.ctc-piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.ctc-envoyer {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
  padding: 10px 20px; border: 1px solid transparent; border-radius: var(--ctc-rayon);
  background: var(--ctc-action); color: #fff;
  font: 400 .92rem/1.2 var(--police-corps, 'Lato', 'Segoe UI', sans-serif); letter-spacing: .04em; text-transform: uppercase;
  cursor: pointer; transition: background-color .15s ease-in-out;
}
.ctc-envoyer:hover, .ctc-envoyer:focus-visible { background: var(--ctc-action-survol); }
.ctc-envoyer:focus-visible { outline: 2px solid var(--ctc-encre); outline-offset: 3px; }
.ctc-envoyer[disabled] { cursor: progress; background: var(--ctc-action-survol); }
.ctc-info { margin: 0; font-size: .84rem; color: var(--ctc-encre-3); }
.ctc-info a { color: var(--ctc-encre-2); text-underline-offset: 3px; }

/* Le message qui n'est pas parti, ou la limite du jour : dit, jamais en silence. */
.ctc-bandeau {
  display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--ctc-rayon);
  background: rgba(165, 37, 36, .06); border-left: 3px solid var(--ctc-action);
  font-size: .9rem; color: var(--ctc-encre);
}
.ctc-bandeau button {
  justify-self: start; padding: 0; border: 0; background: none; cursor: pointer;
  font: 600 .9rem/1.3 var(--police-corps, 'Lato', 'Segoe UI', sans-serif); color: var(--ctc-action);
  text-decoration: underline; text-underline-offset: 3px;
}

/* Pour qui préfère sa messagerie. */
.ctc-adresse {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: 16px 0 0; padding-top: 14px;
  border-top: .8px solid var(--ctc-filet); font-size: .9rem; color: var(--ctc-encre-2);
}
.ctc-adresse a { color: var(--ctc-encre); font-weight: 600; text-underline-offset: 3px; }
.ctc-copier {
  padding: 3px 9px; border: .8px solid var(--ctc-filet); border-radius: 999px; background: var(--ctc-fond);
  font: 400 .8rem/1.3 var(--police-corps, 'Lato', 'Segoe UI', sans-serif); color: var(--ctc-encre-2); cursor: pointer;
}
.ctc-copier:hover { border-color: var(--ctc-encre-3); color: var(--ctc-encre); }

/* ── Message reçu ──────────────────────────────────────────────────── */
.ctc-recu { display: grid; gap: 12px; padding: 6px 0 4px; }
.ctc-recu-marque {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--ctc-fond-alt); color: var(--ctc-encre);
}
.ctc-recu-marque svg { width: 22px; height: 22px; }
.ctc-recu p { margin: 0; color: var(--ctc-encre-2); }
.ctc-recu .ctc-recu-titre { margin: 0; font: 700 1.25rem/1.2 var(--police-titre, 'Titillium Web', 'Segoe UI', sans-serif); color: var(--ctc-encre); }
.ctc-recu .ctc-recu-titre:focus { outline: none; }
.ctc-second {
  justify-self: start; padding: 9px 16px; border: .8px solid var(--ctc-encre-3); border-radius: var(--ctc-rayon);
  background: var(--ctc-fond); color: var(--ctc-encre); cursor: pointer;
  font: 400 .9rem/1.2 var(--police-corps, 'Lato', 'Segoe UI', sans-serif); letter-spacing: .04em; text-transform: uppercase;
}
.ctc-second:hover { border-color: var(--ctc-encre); }

/* ── Téléphone : un rond, et le panneau monte du bas sur toute la largeur ── */
@media (max-width: 599px) {
  .ctc { --ctc-bas: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .ctc-bouton { right: 16px; width: 52px; height: 52px; padding: 0; justify-content: center; }
  .ctc-bouton .ctc-bouton-texte { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ctc-bouton svg { width: 22px; height: 22px; }
  .ctc-voile {
    display: block; position: fixed; inset: 0; z-index: 105; background: rgba(29, 36, 39, .32);
    opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s linear .2s;
  }
  .ctc.ctc-ouvert .ctc-voile { opacity: 1; visibility: visible; transition: opacity .2s ease; }
  .ctc-panneau {
    left: 0; right: 0; bottom: 0; width: auto; max-height: 90vh; max-height: 90dvh;
    padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: 14px 14px 0 0; border-bottom: 0;
    transform: translateY(100%); transition: transform .24s ease, opacity .24s ease, visibility 0s linear .24s;
  }
  .ctc.ctc-ouvert .ctc-panneau { transition: transform .24s ease, opacity .24s ease; }
  /* Sur téléphone, 16 px au moins dans les champs : sinon l'iPhone zoome. */
  .ctc-champ input, .ctc-champ select, .ctc-champ textarea { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .ctc-bouton, .ctc-panneau, .ctc-voile { transition: none !important; }
}
