/* ==========================================================================
   HETERACTIS — Formulaire de contact unique (page/contact/015-formulaire.html)
   Préfixe hc- : aucune collision avec Tailwind (compilé/purgé) ni he-v2.css.
   ========================================================================== */
#formulaire { scroll-margin-top: 84px; }

/* Mobile : accueil → formulaire → réassurance. Grand écran : accueil + réassurance à gauche, formulaire à droite. */
.hc-disposition { display: grid; gap: 2rem; grid-template-areas: "intro" "form" "aside"; }
.hc-zone-intro { grid-area: intro; }
.hc-zone-form { grid-area: form; min-width: 0; }
.hc-zone-aside { grid-area: aside; }
@media (max-width: 1023px) { .hc-zone-intro p { font-size: 1.05rem; } .hc-zone-intro h2 { font-size: 2.1rem; } }
@media (min-width: 1024px) {
  .hc-disposition { grid-template-columns: 5fr 7fr; grid-template-rows: auto 1fr; grid-template-areas: "intro form" "aside form"; column-gap: 4rem; row-gap: 0; align-items: start; }
}

.hc-rassurance { margin: 1.75rem 0 0; padding: 0; list-style: none; display: grid; gap: .9rem; }
.hc-rassurance li { position: relative; padding-left: 1.9rem; color: rgba(21,33,63,.72); font-weight: 300; line-height: 1.55; }
.hc-rassurance li::before {
  content: ''; position: absolute; left: 0; top: .2rem; width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: #3d5297 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/70% no-repeat;
}
.hc-rassurance strong { color: #15213f; font-weight: 600; }
.hc-alternative { margin-top: 1.75rem; padding: 1rem 1.15rem; border-radius: 1rem; background: rgba(61,82,151,.06); color: rgba(21,33,63,.75); font-size: .95rem; line-height: 1.55; }

.hc-form { display: grid; gap: 1.35rem; }
.hc-form[hidden], .hc-succes[hidden], .hc-alerte[hidden], .hc-erreur[hidden], .hc-suivi[hidden] { display: none !important; }
.hc-grille { display: grid; gap: 1.35rem; }
@media (min-width: 640px) { .hc-grille { grid-template-columns: 1fr 1fr; } }

.hc-legende { margin: 0; font-size: .85rem; color: rgba(21,33,63,.7); }
.hc-requis { color: #c25a00; font-weight: 700; }
.hc-champ { position: relative; }
.hc-label { display: block; margin-bottom: .45rem; font-size: .92rem; font-weight: 600; color: #15213f; }

.hc-input {
  display: block; width: 100%; box-sizing: border-box; min-height: 3.1rem;
  padding: .8rem 2.6rem .8rem 1.05rem; border: 1.5px solid rgba(21,33,63,.18); border-radius: 1rem;
  background: #fff; color: #15213f; font: inherit; font-size: 1rem; line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
select.hc-input { padding-right: 1.05rem; }
textarea.hc-input { resize: vertical; min-height: 9rem; }
.hc-input::placeholder { color: rgba(21,33,63,.45); }
.hc-input:focus { outline: none; border-color: #3d5297; box-shadow: 0 0 0 4px rgba(61,82,151,.18); }

/* États : valide (coche verte) / invalide (bordure rouge + message) */
.hc-champ.est-valide .hc-input { border-color: #1f8a4c; }
.hc-champ.est-valide > .hc-input:not(select) {
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f8a4c' stroke-width='3'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") right 1rem top 1rem / 1.1rem no-repeat;
}
.hc-input[aria-invalid="true"] { border-color: #c62828; background-color: #fff7f7; }
.hc-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgba(198,40,40,.15); }
.hc-erreur {
  display: flex; gap: .45rem; align-items: flex-start; margin: .5rem 0 0; color: #b3261e; font-size: .9rem; font-weight: 500; line-height: 1.45;
}
.hc-erreur::before { content: '!'; flex: 0 0 1.15rem; height: 1.15rem; border-radius: 50%; background: #c62828; color: #fff; font-size: .75rem; font-weight: 800; text-align: center; line-height: 1.15rem; margin-top: .1rem; }

/* Bloc repliable « Préciser mon projet » */
.hc-details { border: 1.5px dashed rgba(61,82,151,.3); border-radius: 1rem; padding: 0 1.1rem; }
.hc-details[open] { padding-bottom: 1.2rem; }
.hc-details summary { cursor: pointer; padding: .95rem 0; font-weight: 600; color: #3d5297; list-style: none; }
.hc-details summary::-webkit-details-marker { display: none; }
.hc-details summary::before { content: '+'; display: inline-block; width: 1.4rem; font-weight: 800; }
.hc-details[open] summary::before { content: '–'; }
.hc-details summary span { font-weight: 400; color: rgba(21,33,63,.6); }

/* Consentement */
.hc-accord { display: flex; gap: .8rem; align-items: flex-start; padding: .9rem 1rem; border-radius: 1rem; border: 1.5px solid transparent; }
.hc-accord input { flex: 0 0 auto; width: 1.35rem; height: 1.35rem; margin-top: .15rem; accent-color: #3d5297; cursor: pointer; }
.hc-accord label { font-size: .92rem; color: rgba(21,33,63,.78); line-height: 1.55; cursor: pointer; }
.hc-champ-accord.est-invalide .hc-accord { border-color: #c62828; background: #fff7f7; }
.hc-champ-accord.est-valide .hc-accord { border-color: rgba(31,138,76,.35); background: rgba(31,138,76,.05); }

/* Suivi de ce qui reste à remplir */
.hc-suivi { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; font-size: .85rem; }
.hc-suivi li { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; border-radius: 999px; background: rgba(21,33,63,.06); color: rgba(21,33,63,.65); }
.hc-suivi li::before { content: '○'; font-weight: 700; }
.hc-suivi li.fait { background: rgba(31,138,76,.12); color: #17693a; }
.hc-suivi li.fait::before { content: '✓'; }

/* Bouton */
.hc-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.hc-bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .7rem; min-height: 3.4rem; padding: .9rem 2rem;
  border: 0; border-radius: 999px; color: #fff; font: inherit; font-size: 1.05rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 12px 28px -10px rgba(61,82,151,.6); transition: transform .15s ease, opacity .15s ease;
}
@media (max-width: 639px) { .hc-bouton { width: 100%; } }
.hc-bouton:hover { transform: translateY(-2px); }
.hc-bouton:focus-visible { outline: 3px solid #f9962c; outline-offset: 3px; }
.hc-bouton[disabled] { opacity: .75; cursor: wait; transform: none; }
.hc-spinner { display: none; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: hc-tourne .8s linear infinite; }
.hc-bouton[disabled] .hc-spinner { display: inline-block; }
@keyframes hc-tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hc-spinner { animation-duration: 2s; } .hc-bouton:hover { transform: none; } }

/* Alerte (erreurs / échec d'envoi) */
.hc-alerte { padding: 1rem 1.15rem; border-radius: 1rem; border: 1.5px solid #e2a3a0; background: #fff4f3; color: #7f1d1d; line-height: 1.5; }
.hc-alerte:focus { outline: 3px solid rgba(198,40,40,.35); outline-offset: 2px; }
.hc-alerte-titre { margin: 0; font-weight: 700; }
.hc-alerte ul { display: flex; flex-wrap: wrap; gap: .35rem .5rem; margin: .6rem 0 0; padding: 0; list-style: none; }
.hc-alerte li { margin: 0; }
.hc-alerte li a { display: inline-block; padding: .2rem .7rem; border-radius: 999px; background: #fff; border: 1px solid #e2a3a0; text-decoration: none; }
.hc-alerte a { color: #7f1d1d; text-decoration: underline; font-weight: 600; }
.hc-alerte .hc-plan-b { margin: .75rem 0 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.hc-alerte .hc-plan-b a, .hc-alerte .hc-plan-b button {
  display: inline-flex; align-items: center; padding: .55rem 1rem; border-radius: 999px; border: 1.5px solid #3d5297;
  background: #fff; color: #3d5297; font: inherit; font-size: .9rem; font-weight: 600; text-decoration: none; cursor: pointer;
}

/* Réussite */
.hc-succes { text-align: center; padding: 1.5rem .5rem; }
.hc-succes:focus { outline: none; }
.hc-succes-icone { display: inline-flex; align-items: center; justify-content: center; width: 4.5rem; height: 4.5rem; border-radius: 50%; background: #1f8a4c; color: #fff; box-shadow: 0 12px 30px -10px rgba(31,138,76,.7); }
.hc-succes-titre { margin: 1.25rem 0 .6rem; font-size: 1.9rem; font-weight: 800; color: #15213f; letter-spacing: -.02em; }
.hc-succes-texte { margin: 0 auto; max-width: 30rem; font-size: 1.08rem; color: rgba(21,33,63,.8); line-height: 1.6; }
.hc-succes-note { margin: .9rem auto 0; max-width: 30rem; font-size: .9rem; color: rgba(21,33,63,.6); }
.hc-lien-secondaire { display: inline-block; margin-top: 1.4rem; color: #3d5297; font-weight: 600; text-decoration: underline; }

/* Divers */
.hc-piege { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hc-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Carte « Remplir le formulaire » des pages de service (remplace les anciens formulaires) */
.hc-cta-carte { padding: 2rem; border-radius: 2rem; text-align: left; }
.hc-cta-carte h3 { margin: 0 0 .6rem; font-size: 1.5rem; font-weight: 800; color: #15213f; letter-spacing: -.01em; }
.hc-cta-carte p { margin: 0 0 1.4rem; color: rgba(21,33,63,.72); line-height: 1.6; }
.hc-cta-carte .hc-bouton { text-decoration: none; }
.hc-cta-carte .hc-cta-mail { margin: 1.1rem 0 0; font-size: .9rem; }
.hc-alerte .hc-plan-b-adresse { align-self: center; font-weight: 600; user-select: all; }

/* ===== v2 : choix guidés (puces), débuts de message, accusé de réception, référence ===== */
.hc-groupe { border: 0; margin: 0; padding: 0; min-width: 0; }
.hc-groupe legend { padding: 0; }
.hc-facultatif { font-weight: 400; color: rgba(21,33,63,.6); font-size: .85rem; }
.hc-puces { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .2rem; }
.hc-puce { position: relative; cursor: pointer; }
.hc-puce input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hc-puce span {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 2.6rem; padding: .5rem .95rem; border-radius: 999px;
  border: 1.5px solid rgba(21,33,63,.18); background: #fff; color: #15213f; font-size: .92rem; line-height: 1.25;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.hc-puce span::before { content: '+'; font-weight: 800; color: #3d5297; }
.hc-puce input[type="radio"] + span::before { content: '○'; }
.hc-puce:hover span { border-color: #3d5297; }
.hc-puce input:checked + span { background: #3d5297; border-color: #3d5297; color: #fff; }
.hc-puce input:checked + span::before { content: '✓'; color: #fff; }
.hc-puce input:focus-visible + span { outline: 3px solid #f9962c; outline-offset: 2px; }

.hc-amorces { margin: 0 0 .6rem; }
.hc-amorces[hidden] { display: none !important; }
.hc-amorces-titre { display: block; font-size: .85rem; color: rgba(21,33,63,.7); margin-bottom: .4rem; }
.hc-amorces-liste { display: flex; flex-wrap: wrap; gap: .4rem; }
.hc-amorce {
  padding: .4rem .8rem; border-radius: .8rem; border: 1.5px dashed rgba(61,82,151,.45); background: rgba(61,82,151,.05);
  color: #3d5297; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; text-align: left;
}
.hc-amorce:hover { background: rgba(61,82,151,.12); }
.hc-amorce:focus-visible { outline: 3px solid #f9962c; outline-offset: 2px; }

.hc-accuse { display: flex; gap: .7rem; align-items: center; padding: 0 1rem; font-size: .92rem; color: rgba(21,33,63,.78); }
.hc-accuse input { width: 1.25rem; height: 1.25rem; accent-color: #3d5297; cursor: pointer; }
.hc-accuse label { cursor: pointer; }
.hc-succes-ref { margin: .8rem auto 0; font-size: 1rem; color: #15213f; }
.hc-succes-ref[hidden] { display: none; }

/* Mobile : le bouton d'envoi ne passe pas sous la bulle du chatbot (48 px, en bas à droite). */
@media (max-width: 639px) { .hc-actions { padding-right: 58px; } }

/* Liens « politique de confidentialité » : zone cliquable d'au moins 24 px (WCAG 2.5.8), comme les liens du
   pied de page. Padding vertical sur un élément EN LIGNE : la hauteur de ligne ne bouge pas, le rendu non plus. */
.hc-section a[href="politique.html"] { padding: .25rem 0; }
