/* =====================================================================
   BatiPlanif — formulaires du site (candidature, contact).

   Une seule page, trois étapes numérotées et pas de pagination : à ce
   volume, le formulaire en une page convertit mieux et coûte moins cher
   à maintenir. La numérotation ne fait que rythmer la lecture — huit
   champs à choix se remplissent en une minute ; les deux champs libres
   sont facultatifs, courts et côte à côte, parce que ce sont eux qui font
   abandonner — et ceux qui les remplissent sont précisément le signal
   qu'on cherche.

   Les erreurs s'affichent SOUS le champ concerné, jamais seulement en
   haut : un message global oblige à chercher.
   ===================================================================== */

.apply{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(0,1fr);
  gap:clamp(26px,3.5vw,52px);align-items:start}

/* =============================== CARTE ================================ */
/* Même ombre à plusieurs plans que les aperçus de l'application : la
   carte se détache du fond au lieu d'y être collée. */
.form-card{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r-xl);
  padding:clamp(24px,3vw,40px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.8),
    0 1px 2px rgba(10,22,40,.04),
    0 10px 24px rgba(10,22,40,.07),
    0 30px 60px -14px rgba(10,22,40,.16);
}

/* --- Sections classiques (formulaire de contact) --- */
.fieldset{border:none;margin:0;padding:0}
.fieldset + .fieldset{margin-top:clamp(26px,3vw,38px);padding-top:clamp(24px,2.6vw,32px);
  border-top:1px solid var(--line-2)}

/* Un <legend> se pose SUR le filet du dessus (rendu natif) : décalé, il
   donnait aux deux derniers intertitres un trait et un écart que le
   premier n'avait pas. Sorti du flux du cadre, il se place comme un
   intertitre ordinaire, identique pour les trois. */
.fieldset legend{
  float:left;width:100%;
  padding:0;margin-bottom:14px;font-size:.76rem;font-weight:700;letter-spacing:.1em;
  text-transform:uppercase;color:var(--blue-600);
}
.fieldset > :not(legend){clear:both}
.fieldset > .hint{margin-bottom:20px;font-size:.9rem;color:var(--muted);line-height:1.55}

/* --- Étapes numérotées (candidature) ---
   Le <legend> reste pour les synthèses vocales (.sr-only) ; le titre
   visible est un bloc ordinaire, parce qu'un legend se laisse mal mettre
   en page. Le numéro reprend la pastille des « étapes suivantes » de la
   colonne : un seul repère visuel pour « une étape ». */
.fstep{border:none;margin:0;padding:0;min-width:0}
.fstep + .fstep{margin-top:clamp(24px,3vw,34px);padding-top:clamp(22px,2.6vw,28px);
  border-top:1px solid var(--line-2)}
.fstep-h{display:flex;align-items:center;gap:12px;margin-bottom:16px}
/* Le numéro reprend l'insigne teinté des icônes du site (.ico-badge) :
   une couleur par étape, un carré arrondi, le chiffre bien centré. */
.fstep-n{width:32px;height:32px;border-radius:10px;font-size:.92rem;font-weight:800;line-height:1}
.fstep-h b{display:block;font-size:1.06rem;font-weight:700;color:var(--navy-900);line-height:1.3;letter-spacing:-.01em}
.fstep > .hint{margin-top:8px;font-size:.82rem;color:var(--muted);line-height:1.45}

/* =============================== CHAMPS =============================== */
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.fld + .fld,.grid-2 + .fld,.grid-3 + .fld,.fld + .grid-2,.fld + .grid-3,
.grid-2 + .grid-2,.grid-2 + .grid-3,.grid-3 + .grid-2{margin-top:16px}

/* À l'intérieur d'une grille, c'est `gap` qui espace : sans cette remise
   à zéro, les champs 2 et 3 d'une ligne descendent de 16 px et leurs
   libellés ne s'alignent plus avec le premier. */
.grid-2 > .fld,.grid-3 > .fld{margin-top:0}

.fld{display:flex;flex-direction:column;min-width:0}
/* `display:flex` l'emporterait sur le `display:none` que le navigateur
   donne à l'attribut `hidden` — que site.js pose sur les champs
   conditionnels. Sans cette ligne, « Précisez… » resterait toujours visible. */
.fld[hidden]{display:none}

.fld label{
  margin-bottom:7px;font-size:.88rem;font-weight:600;color:var(--navy-900);
  display:flex;align-items:baseline;gap:6px;
}
.fld label .opt{font-weight:500;color:var(--muted-2);font-size:.8rem}

/* Champs « remplis » : un fond très légèrement teinté au repos, blanc et
   cerclé de bleu au focus. Moins de traits qu'une boîte blanche à contour
   gris, et l'endroit où l'on écrit se voit tout de suite. */
.fld input,.fld select,.fld textarea{
  width:100%;font-family:inherit;font-size:.96rem;color:var(--ink);
  background:#F5F7FB;border:1px solid #E4E9F2;border-radius:11px;
  padding:11px 13px;transition:border-color .15s,box-shadow .15s,background .15s;
  -webkit-appearance:none;appearance:none;
}
.fld textarea{min-height:82px;resize:vertical;line-height:1.5}

.fld select{
  /* La flèche est un fond en data-URI : aucune requête, et pas de style
     en ligne (la politique de sécurité du site l'interdit). */
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5l5-5' fill='none' stroke='%2364748B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 14px center;padding-right:38px;
}

.fld input:hover,.fld select:hover,.fld textarea:hover{border-color:#D3DBE8;background:#F1F4FA}
.fld input:focus,.fld select:focus,.fld textarea:focus{
  outline:none;background:var(--surface);border-color:var(--blue-500);
  box-shadow:0 0 0 3px rgba(59,130,246,.16);
}
.fld input::placeholder,.fld textarea::placeholder{color:var(--muted-2)}

.fld .hint{margin-top:6px;font-size:.82rem;color:var(--muted);line-height:1.45}

/* --- Champ en erreur --- */
.fld.err input,.fld.err select,.fld.err textarea{border-color:var(--danger);background:#FFFCFC}
.fld.err input:focus,.fld.err select:focus,.fld.err textarea:focus{box-shadow:0 0 0 3px rgba(239,68,68,.16)}
.err-msg{margin-top:6px;font-size:.84rem;font-weight:600;color:var(--danger);line-height:1.4}

/* --- Cases à cocher --- */
/* Discrètes : petites cases, petit corps, gris — ce sont des mentions,
   pas des questions. */
.check{display:grid;grid-template-columns:16px minmax(0,1fr);gap:10px;align-items:start;
  font-size:.82rem;color:var(--muted);line-height:1.5}
.check + .check{margin-top:10px}
.check input{
  width:16px;height:16px;margin:2px 0 0;flex:none;accent-color:var(--blue-600);
  -webkit-appearance:auto;appearance:auto;border-radius:4px;padding:0;
}
.check a{color:inherit;text-decoration:underline}
.check.err{color:var(--danger)}
.check.err input{outline:2px solid var(--danger);outline-offset:2px}

/* Les deux mentions, sans encart ni bordure — juste sous les champs et
   au-dessus du bouton, à la taille d'une note de bas de formulaire. */
.consent-box{margin-top:clamp(20px,2.6vw,26px)}
.consent-box .err-msg{margin:6px 0 0 26px}

/* --- Leurre anti-robot ---
   Hors de l'écran plutôt que `display:none` : les robots les plus
   courants ignorent les champs masqués par le style, mais remplissent
   ceux qu'ils ne voient pas comme masqués. Il porte un libellé plausible
   et est retiré de l'ordre de tabulation. */
.hp{position:absolute;left:-9999px;top:0;width:1px;height:1px;overflow:hidden}

/* ============================== BANDEAUX ============================== */
.alert{
  display:grid;grid-template-columns:22px minmax(0,1fr);gap:13px;align-items:start;
  padding:16px 18px;border-radius:var(--r-md);margin-bottom:26px;font-size:.93rem;line-height:1.55;
}
.alert svg{margin-top:2px;flex:none}
.alert b{display:block;margin-bottom:3px}
.alert-err{background:var(--danger-bg);border:1px solid #F8B4B4;color:#991B1B}
.alert-err svg{color:var(--danger)}
.alert-warn{background:var(--warn-bg);border:1px solid #FBE0AE;color:#92400E}
.alert-warn svg{color:var(--warn)}
.alert-ok{background:var(--ok-bg);border:1px solid #A7E8CC;color:#065F46}
.alert-ok svg{color:var(--ok)}

.form-actions{margin-top:clamp(24px,3vw,34px)}
.form-actions .btn{width:100%}
.form-actions .after{margin-top:14px;font-size:.84rem;color:var(--muted);text-align:center;line-height:1.5}

/* =============================== COLONNE ============================== */
.aside-card{
  background:var(--bg);border:1px solid var(--line);border-radius:var(--r-lg);padding:24px 22px;
}
.aside-card + .aside-card{margin-top:16px}
.aside-card h2{font-size:1.02rem;margin-bottom:14px}

.aside-card.navy{
  background:linear-gradient(158deg,var(--navy-900),var(--navy-700));border-color:transparent;color:#fff;
  box-shadow:var(--sh-3);
}
.aside-card.navy h2{color:#fff}

.slots{display:flex;align-items:baseline;gap:10px;margin-bottom:10px}
.slots b{font-size:2.1rem;font-weight:800;letter-spacing:-.03em;line-height:1}
.slots span{font-size:.84rem;font-weight:700;color:#9FB6D6;text-transform:uppercase;letter-spacing:.06em}
.slots-bar{height:7px;border-radius:999px;background:rgba(255,255,255,.16);overflow:hidden;margin-bottom:12px}
.slots-bar i{display:block;height:100%;border-radius:999px;background:var(--blue-500)}
/* Remplissage par paliers de 5 % : des classes, pas un style en ligne
   (interdit par la politique de sécurité du site). */
.w0{width:0}      .w5{width:5%}    .w10{width:10%}  .w15{width:15%}  .w20{width:20%}
.w25{width:25%}   .w30{width:30%}  .w35{width:35%}  .w40{width:40%}  .w45{width:45%}
.w50{width:50%}   .w55{width:55%}  .w60{width:60%}  .w65{width:65%}  .w70{width:70%}
.w75{width:75%}   .w80{width:80%}  .w85{width:85%}  .w90{width:90%}  .w95{width:95%}
.w100{width:100%}
.aside-card.navy p{font-size:.89rem;color:#C7D5EA;line-height:1.6}

.steps{counter-reset:s;display:flex;flex-direction:column;gap:16px}
/* 2 px entre le titre et son texte, 12 px entre le numéro et la colonne :
   un seul `gap` s'appliquerait aux deux et décollerait les deux lignes. */
.steps li{display:grid;grid-template-columns:26px minmax(0,1fr);gap:2px 12px;list-style:none;align-items:start}
.steps li::before{
  counter-increment:s;content:counter(s);
  width:26px;height:26px;border-radius:50%;display:grid;place-items:center;
  background:var(--blue-50);border:1px solid #D3E1FD;color:var(--blue-700);
  font-size:.78rem;font-weight:800;
}
/* Le numéro occupe la colonne 1 ; le titre et le texte s'empilent dans la
   colonne 2. Sans ces placements explicites, le texte retomberait dans la
   colonne du numéro — large de 26 px — et se briserait mot par mot. */
.steps li::before{grid-column:1;grid-row:1}
.steps b{grid-column:2;grid-row:1;display:block;font-size:.91rem;color:var(--navy-900);margin-bottom:3px}
.steps span{grid-column:2;grid-row:2;font-size:.85rem;color:var(--muted);line-height:1.5}

.trust{display:flex;flex-direction:column;gap:11px}
.trust li{display:grid;grid-template-columns:18px minmax(0,1fr);gap:11px;list-style:none;
  align-items:start;font-size:.86rem;color:var(--ink-2);line-height:1.5}
.trust svg{margin-top:3px;color:var(--ok);flex:none}

/* ============================== MERCI ================================= */
.thanks{max-width:660px;margin-inline:auto;text-align:center}
.thanks-ico{
  width:74px;height:74px;border-radius:50%;margin:0 auto 26px;display:grid;place-items:center;
  background:var(--ok-bg);border:1px solid #A7E8CC;color:var(--ok);
}
.thanks h1{margin-bottom:18px}
.thanks .lead{margin-inline:auto;margin-bottom:30px}
.thanks .steps{text-align:left;max-width:460px;margin:0 auto 32px}
.thanks .cta-row{justify-content:center}

/* ============================== ÉCHANGE =============================== */
/* La page « Votre échange » (2026-10-27) : le fil, du plus ancien au plus
   récent — ses messages à droite, comme dans toute messagerie, les nôtres
   à gauche, teintés du bleu de la marque. Le texte reste tel qu'il a été
   tapé (retours à la ligne compris) ; une adresse trop longue passe à la ligne. */
.thread-subj{margin:0 0 18px;font-size:1rem;font-weight:700;color:var(--navy-900);line-height:1.4}
.thread-subj span{display:block;margin-bottom:2px;font-size:.76rem;font-weight:700;letter-spacing:.1em;
  text-transform:uppercase;color:var(--blue-600)}
.thread{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:14px}
.thread-msg{max-width:86%;padding:14px 16px;border-radius:var(--r-md);border:1px solid #E4E9F2;background:#F5F7FB}
.thread-msg.mine{align-self:flex-end}
.thread-msg.ours{align-self:flex-start;background:var(--blue-50);border-color:#D3E1FD}
.thread-msg.is-new{animation:threadIn .5s ease-out}
@keyframes threadIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.thread-msg.is-new{animation:none}}
.thread-who{margin:0 0 6px;font-size:.8rem;color:var(--muted);line-height:1.4}
.thread-who b{color:var(--navy-900);font-weight:700}
.thread-body{font-size:.95rem;line-height:1.6;color:var(--ink);white-space:pre-wrap;overflow-wrap:anywhere}
.thread-next{margin-top:clamp(24px,3vw,32px);padding-top:clamp(22px,2.6vw,28px);border-top:1px solid var(--line-2)}
/* Le contour d'arrivée : de l'air et des coins arrondis, comme `.alt` (site.css). */
.thread-next.is-flash{--fo:12px;border-radius:18px}
@media (max-width:640px){ .thread-next.is-flash{--fo:6px;border-radius:14px} }
/* Son message vient de partir : le saut #suite s'arrête plus haut, le dernier message et la
   confirmation se lisent ensemble (arrivée à 45 % de l'écran). Sans script, comme le reste.
   #suite : doit l'emporter sur `:root:not(.js) [id]` (site.css). */
#suite.is-sent{scroll-margin-top:45vh}

/* ============================= RESPONSIVE ============================= */
@media (max-width:1000px){
  .apply{grid-template-columns:1fr}
  /* Sur une colonne : le rappel des places AU-DESSUS du formulaire (il
     porte l'argument de rareté), puis le formulaire tout de suite — les
     deux autres encadrés (la suite, nos engagements) passent dessous,
     plutôt que de faire défiler trois cartes avant le premier champ. */
  .apply-aside{display:contents}
  .apply-aside .aside-card.navy{order:-1}
  .apply-aside .aside-card:not(.navy){order:1}
  .aside-card + .aside-card{margin-top:0}
}

@media (max-width:640px){
  .grid-2{grid-template-columns:1fr}
  .thread-msg{max-width:100%}
  /* Trois petits nombres tiennent sur une ligne, même étroite : les
     empiler ferait trois rangs pour rien. */
  .grid-3{gap:10px;align-items:end}
  .grid-3 .fld label{flex-wrap:wrap;gap:2px 6px}
}
