/* /esquisse : en-tête, splash « ce qui vous attend », messagerie et formulaire final. Les champs restent dans style.css. */
@font-face {
  font-family: "Space Grotesk";
  src: url(/fonts/SpaceGrotesk-Regular.woff2) format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url(/fonts/SpaceGrotesk-Bold.woff2) format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

[hidden] { display: none !important; }


/* En-tête (B-REL-03b-b) : le logo et le titre seuls, resserrés ; l'avatar n'apparaît que dans le fil.
   À 375 × 667, la 1re bulle et ses boutons sont visibles sans défiler. */
.entete-esquisse { text-align: center; }
.entete-esquisse h1 { margin: 0 0 16px; text-align: center; }
.en-messagerie main { padding-top: 16px; }
.en-messagerie .logo { margin-bottom: 12px; }
/* B-REL-03q : « Réalisations » en haut à droite, discret ; l'en-tête resserré ne s'élargit pas. */
.en-messagerie main { position: relative; }
.esquisse-realisations {
  position: absolute;
  top: 22px;
  right: 20px;
  min-height: 44px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  background: transparent;
  cursor: pointer;
}
.esquisse-realisations:hover { background: rgba(255, 255, 255, 0.12); }
.esquisse-realisations:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 2px; }
.fil-bulle, .entete-esquisse h1, .splash-envoi p { text-wrap: balance; }
@media (max-width: 479px) {
  .entete-esquisse h1 { font-size: 24px; }
}

/* Avatar des écrans de passage (B-REL-03b-c, D2) : la pièce complète, entière, dans un carré beige de 260 px,
   coins arrondis à 20 % du côté, marge intérieure 8 %, bordure terre cuite de 4 px. Plus aucun recadrage du visage.
   Composant réutilisable (reprise, calendrier) ; jamais dans le fil. Classe « hublot-passage » gardée pour les ids et le JS. */
.hublot-passage {
  display: block;
  flex: none;
  box-sizing: border-box;
  width: 260px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  padding: 20.8px;
  border: 4px solid #C86D39;
  border-radius: 20%;
  background: #F5EFE6;
}
.hublot-passage img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.hublot-passage.presente img { display: block; }

/* Après la clôture : le retour à l'accueil, rien d'autre. */
.retour-accueil {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin: 24px 0 0 var(--fil-marge-avatar);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 19px;
  font-weight: 700;
  color: #FFFFFF;
  background: #C86D39;
  text-decoration: none;
}
.retour-accueil:hover { background: #A8552A; }
.retour-accueil:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 2px; }


.splash-envoi {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 32px 24px;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: #FFFFFF;
  background: linear-gradient(180deg, #334155, #1E293B);
  cursor: pointer;
  animation: apparait 300ms ease-out;
}
.splash-envoi:focus { outline: none; }
.splash-envoi { cursor: default; }
.splash-envoi p { max-width: 420px; margin: 0; font-size: 20px; line-height: 1.4; text-align: center; } /* B-REL-20c : textes courts, colonne étroite */
/* B-REL-03b-d : après « On avance », le texte en grand ; le bouton attend l'esquisse, l'indicateur habituel en dessous du texte. */
#splash-esquisse p { font-size: 24px; font-weight: 700; line-height: 1.35; }
.splash-indicateur { align-self: center; margin: 0; }
.splash-indicateur[hidden] { display: none; }
#splash-esquisse .bouton-ocre:disabled { opacity: 0.5; cursor: progress; }
@media (max-width: 479px) {
  #splash-esquisse p { font-size: 22px; }
}
/* Confirmation : même écran de passage, le bouton mène à l'accueil. */
#confirmation .bouton-ocre { display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-weight: 700; color: #FFFFFF; text-decoration: none; }
/* B-REL-03o : avec le calendrier, « Revenir à l'accueil » passe en secondaire (contour). */
.confirmation-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
#confirmation .bouton-ocre[hidden] { display: none; }
.confirmation-esquisse { display: flex; justify-content: center; } /* B-REL-03w : au-dessus des autres boutons */
/* B-REL-03x : avec nos démos dessous, l'écran défile sur téléphone au lieu de couper le haut. */
#confirmation { overflow-y: auto; justify-content: safe center; }
#confirmation .bouton-secondaire { border: 2px solid #FFFFFF; background: transparent; }
#confirmation .bouton-secondaire:hover { color: #1E293B; background: #FFFFFF; }

@keyframes apparait {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Après l'envoi, la page devient la messagerie, sur le fond de l'ouverture. */
html.en-messagerie { min-height: 100%; background: #1E293B; }
.en-messagerie body {
  min-height: 100vh;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: #FFFFFF;
  background: linear-gradient(180deg, #334155, #1E293B);
}
.en-messagerie .logo { padding: 8px 14px; border-radius: 14px; background: #FFFFFF; }
.en-messagerie footer, .en-messagerie footer a { color: #E2E8F0; }

.fil-saisie { display: grid; gap: 10px; margin-top: 16px; }
.fil-saisie textarea { color: #1f2933; }
.fil-saisie-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fil-saisie button { min-height: 44px; font-size: 16px; }
.fil-saisie button[type="submit"] { padding: 10px 24px; background: #A8552A; }
.fil-saisie button[type="submit"]:hover { background: #8F4722; }
.fil-saisie .fil-passer {
  padding: 8px 0;
  font-weight: 400;
  color: #E2E8F0;
  background: none;
  text-decoration: underline;
}
.fil-saisie .fil-passer:hover { background: none; }
.fil-saisie :focus-visible { outline: 3px solid #FFFFFF; outline-offset: 2px; }
.saisie-erreur { margin: 0; font-weight: 700; color: #FFFFFF; }

@media (prefers-reduced-motion: reduce) {
  .splash-envoi { animation: none; }
}

/* Bouton ocre : « C'est parti ». */
.bouton-ocre { min-height: 52px; padding: 12px 24px; font-size: 19px; background: #C86D39; }
.bouton-ocre:hover { background: #A8552A; }
.bouton-ocre:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 2px; }

/* Le formulaire final : une carte claire sous la bulle d'invitation, dans le fil. */
.formulaire-fin {
  margin: 16px 0 0 var(--fil-marge-avatar);
  padding: 20px;
  border-radius: 16px;
  color: #1f2933;
  background: #FFFFFF;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.3);
}
/* Libellé et astérisque sur la même ligne, le champ dessous (la grille de style.css les séparait). */
.formulaire-fin label:not(.case) { display: block; }
.formulaire-fin label:not(.case) > input { display: block; margin-top: 6px; }
.formulaire-fin .aide { display: block; margin-top: 4px; font-size: 14px; font-weight: 400; color: #52606d; }
.formulaire-fin .pied a { color: #A8552A; }
.urgence { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.urgence legend { margin-bottom: 8px; padding: 0; font-weight: 600; }
.sans-script { padding: 16px; border-radius: 12px; color: #1f2933; background: #FFFFFF; }
@media (max-width: 479px) {
  .formulaire-fin { margin-left: 0; padding: 16px; }
}

/* B-REL-03b — le plan de l'esquisse : une carte beige « table », les briques empilées de bas en haut. */
.fil-plan { list-style: none; margin: 12px 0 0 var(--fil-marge-avatar); }
.plan-table {
  padding: 16px;
  border-radius: 16px;
  color: #334155;
  background: #F5EFE6;
}
.plan-titre { margin: 0 0 12px; font-size: 18px; font-weight: 700; line-height: 1.3; text-align: left; }
.plan-briques {
  display: flex;
  flex-direction: column-reverse; /* la première brique en bas, les suivantes posées dessus */
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.plan-brique {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border: 2px solid #C86D39;
  border-radius: 10px;
  background: #FFFFFF;
  opacity: 0;
  transform: translateY(-16px);
  transition: opacity 300ms ease-out, transform 300ms ease-out;
}
.plan-brique.posee { opacity: 1; transform: none; }
.plan-brique { text-align: left; }
.plan-brique strong { font-size: 17px; line-height: 1.3; }
/* B-REL-03q : justifié, sans coupure de mots (règle LTC) ; sous 400 px, les espaces se creusaient : aligné à gauche. */
.plan-pourquoi { text-align: justify; text-wrap: pretty; }
@media (max-width: 399px) {
  .plan-pourquoi { text-align: left; }
}
.plan-pourquoi { font-size: 15px; line-height: 1.4; color: #475569; }
.plan-brique.a-confirmer { border-style: dashed; }
.plan-mention { font-size: 13px; font-style: italic; color: #8F4722; }

/* Retirer une brique (B-REL-03b-b) : elle reste dans le plan, grisée, nom barré, « retirée » ; le bouton devient « Remettre ». */
.plan-pied { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: -8px -8px -8px 0; }
.plan-etat { font-size: 13px; font-style: italic; color: #475569; }
.plan-retirer {
  min-width: 44px;
  min-height: 44px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #8F4722;
  background: none;
  text-decoration: underline;
  cursor: pointer;
}
.plan-retirer:hover { background: #F5EFE6; }
.plan-retirer:focus-visible { outline: 3px solid #8F4722; outline-offset: 1px; }
.plan-retirer:disabled { color: #94A3B8; text-decoration: none; cursor: default; }
.plan-retirer:disabled:hover { background: none; }
.plan-brique.posee { transition: opacity 200ms ease-out, transform 300ms ease-out; }
.plan-brique.posee.retiree { opacity: 0.5; }
.plan-brique.retiree strong { text-decoration: line-through; }
.plan-aide { margin: 10px 0 0; font-size: 15px; color: #E2E8F0; text-align: left; }

/* Le plan qui se remplit (B-REL-03b-b) : 5 petites briques sous le champ, colorées au fil des points ; aucun chiffre. */
.plan-progres { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; color: #CBD5E1; text-align: left; }
.progres-briques { display: inline-flex; gap: 4px; }
.progres-briques span { width: 14px; height: 9px; border: 1.5px solid #C86D39; border-radius: 3px; transition: background-color 300ms ease-out; }
.progres-briques span.pleine { background: #C86D39; }

@media (max-width: 479px) {
  /* Deux gestes longs (« J’ajoute une précision », « Il manque quelque chose ») : toute la largeur, à la ligne si besoin. */
  #messagerie .fil-attente { margin-right: 0; max-width: 100%; }
  #messagerie .fil-attente-boutons { flex-wrap: wrap; }
  .fil-plan { margin-left: 0; }
  .plan-table { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .plan-brique, .plan-brique.posee { transition: none; }
  .progres-briques span { transition: none; }
}
