/* ============================================================
   Copilfid — Pop-up de réservation de démo (natif, sans Tally)
   Calé sur les tokens du site (thème sombre, accent teal).
   Aucune dépendance externe hors widget Calendly (chargé à la
   dernière étape uniquement).
   ============================================================ */

/* Variables de repli si la page hôte ne les définit pas */
.lead-overlay{
  --lp-bg:var(--surface,#172033);
  --lp-bg-2:var(--surface-2,#1e293b);
  --lp-bg-3:var(--surface-3,#26334a);
  --lp-border:var(--border,rgba(148,163,184,.14));
  --lp-border-strong:var(--border-strong,rgba(148,163,184,.26));
  --lp-teal:var(--teal,#1c8a63);
  --lp-teal-bright:var(--teal-bright,#34a87d);
  --lp-soft:var(--teal-soft,rgba(28,138,99,.12));
  --lp-text:var(--text,#f1f5f9);
  --lp-muted:var(--muted,#94a3b8);
  --lp-muted-2:var(--muted-2,#64748b);
  --lp-red:var(--red,#ef4444);
}

/* ===== Overlay ===== */
.lead-overlay{
  position:fixed;inset:0;z-index:1000;
  display:flex;align-items:center;justify-content:center;
  padding:24px;
  background:rgba(7,12,23,.72);
  backdrop-filter:blur(6px) saturate(120%);
  -webkit-backdrop-filter:blur(6px) saturate(120%);
  opacity:0;visibility:hidden;pointer-events:none;
  transition:opacity .28s ease, visibility .28s ease;
}
.lead-overlay.open{opacity:1;visibility:visible;pointer-events:auto}

/* ===== Carte ===== */
.lead-card{
  position:relative;
  width:100%;max-width:540px;
  max-height:calc(100dvh - 48px);
  display:flex;flex-direction:column;
  background:var(--lp-bg);
  border:1px solid var(--lp-border-strong);
  border-radius:18px;
  box-shadow:0 30px 80px -20px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.02) inset;
  overflow:hidden;
  transform:translateY(14px) scale(.985);
  opacity:0;
  transition:transform .3s cubic-bezier(.16,1,.3,1), opacity .3s ease;
}
.lead-overlay.open .lead-card{transform:none;opacity:1}
@media (prefers-reduced-motion:reduce){
  .lead-overlay,.lead-card{transition:none}
  .lead-card{transform:none}
}

/* ===== Entête : progression + fermeture ===== */
.lp-head{
  display:flex;align-items:center;gap:16px;
  padding:18px 20px 14px;
  border-bottom:1px solid var(--lp-border);
  flex:none;
}
.lp-progress{flex:1;min-width:0}
.lp-step-label{
  font-family:'DM Mono',ui-monospace,monospace;
  font-size:12px;letter-spacing:.04em;
  color:var(--lp-muted);
  text-transform:uppercase;
  margin-bottom:8px;
  display:block;
}
.lp-bar{height:4px;border-radius:100px;background:var(--lp-bg-3);overflow:hidden}
.lp-bar-fill{
  height:100%;border-radius:100px;
  background:linear-gradient(90deg,var(--lp-teal),var(--lp-teal-bright));
  width:0;transition:width .4s cubic-bezier(.16,1,.3,1);
}
.lp-close{
  flex:none;display:grid;place-items:center;
  width:36px;height:36px;border-radius:9px;
  background:var(--lp-bg-2);border:1px solid var(--lp-border);
  color:var(--lp-muted);cursor:pointer;
  transition:background .2s,color .2s,border-color .2s;
}
.lp-close:hover{background:var(--lp-bg-3);color:var(--lp-text);border-color:var(--lp-border-strong)}
.lp-close svg{width:18px;height:18px}

/* ===== Corps scrollable ===== */
.lp-body{
  padding:26px 28px 8px;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  flex:1;
}
.lp-eyebrow{
  font-family:'DM Mono',ui-monospace,monospace;
  font-size:12px;letter-spacing:.06em;text-transform:uppercase;
  color:var(--lp-teal-bright);margin-bottom:12px;
  display:flex;align-items:center;gap:8px;
}
.lp-eyebrow::before{content:"";width:18px;height:1.5px;background:var(--lp-teal-bright);display:block}
.lp-title{
  font-family:'Bricolage Grotesque',sans-serif;
  font-weight:700;letter-spacing:-.02em;line-height:1.1;
  font-size:25px;color:var(--lp-text);
  text-wrap:balance;
}
.lp-sub{margin-top:10px;color:var(--lp-muted);font-size:15px;line-height:1.55}

/* ===== Champs ===== */
.lp-fields{display:flex;flex-direction:column;gap:16px;margin-top:22px}
.lp-row{display:grid;grid-template-columns:1fr 1fr;gap:14px}
@media (max-width:440px){.lp-row{grid-template-columns:1fr}}
.lp-field{display:flex;flex-direction:column;gap:7px}
.lp-label{font-size:13.5px;font-weight:600;color:var(--lp-text)}
.lp-label .req{color:var(--lp-teal-bright);margin-left:2px}
.lp-input{
  width:100%;
  font-family:'DM Sans',system-ui,sans-serif;
  font-size:15.5px;color:var(--lp-text);
  background:var(--lp-bg-2);
  border:1px solid var(--lp-border-strong);
  border-radius:11px;
  padding:13px 15px;
  transition:border-color .2s, box-shadow .2s, background .2s;
}
.lp-input::placeholder{color:var(--lp-muted-2)}
.lp-input:focus{
  outline:none;
  border-color:var(--lp-teal-bright);
  box-shadow:0 0 0 3px rgba(52,168,125,.18);
}
.lp-input.lp-invalid{border-color:var(--lp-red);box-shadow:0 0 0 3px rgba(239,68,68,.16)}
.lp-err{font-size:12.5px;color:var(--lp-red);min-height:0;display:none}
.lp-err.show{display:block}

/* compteur de caractères */
.lp-count{font-family:'DM Mono',monospace;font-size:11.5px;color:var(--lp-muted-2);text-align:right;margin-top:-2px}

/* ===== Choix (radios stylés) ===== */
.lp-choices{display:flex;flex-direction:column;gap:11px;margin-top:22px}
.lp-choice{
  position:relative;display:flex;align-items:center;gap:13px;
  padding:15px 16px;border-radius:12px;cursor:pointer;
  background:var(--lp-bg-2);
  border:1px solid var(--lp-border-strong);
  transition:border-color .18s, background .18s, transform .12s;
}
.lp-choice:hover{border-color:rgba(52,168,125,.45);background:var(--lp-bg-3)}
.lp-choice:active{transform:scale(.992)}
.lp-choice input{position:absolute;opacity:0;width:0;height:0}
.lp-tick{
  flex:none;width:20px;height:20px;border-radius:50%;
  border:2px solid var(--lp-muted-2);
  display:grid;place-items:center;transition:border-color .18s, background .18s;
}
.lp-tick::after{content:"";width:9px;height:9px;border-radius:50%;background:#fff;transform:scale(0);transition:transform .18s}
.lp-choice-txt{font-size:15.5px;font-weight:500;color:var(--lp-text)}
.lp-choice input:checked ~ .lp-tick{border-color:var(--lp-teal-bright);background:var(--lp-teal)}
.lp-choice input:checked ~ .lp-tick::after{transform:scale(1)}
.lp-choice:has(input:checked){border-color:var(--lp-teal-bright);background:var(--lp-soft)}
.lp-choice input:focus-visible ~ .lp-tick{box-shadow:0 0 0 3px rgba(52,168,125,.3)}

/* champ conditionnel "Autre" */
.lp-conditional{
  max-height:0;overflow:hidden;opacity:0;
  transition:max-height .3s ease, opacity .25s ease, margin .3s ease;
  margin-top:0;
}
.lp-conditional.show{max-height:140px;opacity:1;margin-top:4px}

/* honeypot — invisible pour humains, piège à bots */
.lp-hp{position:absolute!important;left:-9999px!important;width:1px;height:1px;overflow:hidden;opacity:0}

/* ===== Pied : navigation ===== */
.lp-foot{
  display:flex;align-items:center;gap:12px;
  padding:18px 28px 24px;
  border-top:1px solid var(--lp-border);
  flex:none;
}
.lp-foot .lp-spacer{flex:1}
.lp-btn{
  font-family:'DM Sans',system-ui,sans-serif;
  font-size:15px;font-weight:600;
  padding:13px 22px;border-radius:11px;border:1px solid transparent;
  cursor:pointer;display:inline-flex;align-items:center;gap:9px;
  transition:transform .18s, box-shadow .2s, background .2s, border-color .2s, color .2s;
  white-space:nowrap;
}
.lp-btn:disabled{opacity:.55;cursor:not-allowed}
.lp-btn-primary{
  background:var(--lp-teal);color:#052017;
  box-shadow:0 10px 26px -12px rgba(28,138,99,.8), inset 0 1px 0 rgba(255,255,255,.22);
}
.lp-btn-primary:not(:disabled):hover{background:var(--lp-teal-bright);transform:translateY(-1px)}
.lp-btn-ghost{background:var(--lp-bg-2);color:var(--lp-text);border-color:var(--lp-border-strong)}
.lp-btn-ghost:not(:disabled):hover{background:var(--lp-bg-3)}
.lp-btn .arr{transition:transform .2s}
.lp-btn-primary:not(:disabled):hover .arr{transform:translateX(3px)}

/* spinner état chargement */
.lp-spin{
  width:16px;height:16px;border-radius:50%;
  border:2px solid rgba(5,32,23,.35);border-top-color:#052017;
  animation:lp-spin .7s linear infinite;
}
@keyframes lp-spin{to{transform:rotate(360deg)}}

/* ===== Écrans terminaux (succès / erreur / non qualifié) ===== */
.lp-final{display:flex;flex-direction:column;align-items:center;text-align:center;padding:14px 8px 6px}
.lp-icon{
  width:62px;height:62px;border-radius:50%;display:grid;place-items:center;
  margin-bottom:20px;
}
.lp-icon.ok{background:var(--lp-soft);color:var(--lp-teal-bright);border:1px solid rgba(52,168,125,.35)}
.lp-icon.info{background:rgba(245,158,11,.12);color:var(--amber,#f59e0b);border:1px solid rgba(245,158,11,.3)}
.lp-icon.err{background:rgba(239,68,68,.12);color:var(--lp-red);border:1px solid rgba(239,68,68,.3)}
.lp-icon svg{width:30px;height:30px}
.lp-final .lp-title{font-size:23px}
.lp-final .lp-sub{margin-top:12px;max-width:40ch}

/* widget Calendly inline */
.lp-cal-wrap{margin-top:18px;border-radius:12px;overflow:hidden;border:1px solid var(--lp-border)}
.lp-calendly{min-width:280px;height:560px;background:var(--lp-bg-2)}
.lp-cal-loading{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:14px;height:100%;color:var(--lp-muted);font-size:14px;
}
.lp-confirm-banner{
  display:flex;align-items:center;gap:11px;
  background:var(--lp-soft);border:1px solid rgba(52,168,125,.3);
  border-radius:11px;padding:13px 15px;margin-top:4px;
  font-size:14px;color:var(--lp-text);text-align:left;
}
.lp-confirm-banner svg{flex:none;width:18px;height:18px;color:var(--lp-teal-bright)}

/* note de confidentialité */
.lp-privacy{
  display:flex;align-items:flex-start;gap:9px;
  margin-top:22px;padding-top:16px;border-top:1px solid var(--lp-border);
  font-size:12.5px;line-height:1.5;color:var(--lp-muted-2);
}
.lp-privacy svg{flex:none;width:14px;height:14px;margin-top:2px}

/* lien de secours Calendly */
.lp-fallback-link{
  color:var(--lp-teal-bright);font-weight:600;text-decoration:underline;
  text-underline-offset:3px;
}

/* entrée d'étape */
.lp-step{animation:lp-stepin .32s cubic-bezier(.16,1,.3,1)}
@keyframes lp-stepin{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.lp-step{animation:none}}

/* ===== Mobile ===== */
@media (max-width:560px){
  .lead-overlay{padding:0;align-items:flex-end}
  .lead-card{
    max-width:100%;max-height:94dvh;
    border-radius:20px 20px 0 0;
    border-bottom:none;
  }
  .lp-body{padding:22px 20px 6px}
  .lp-head{padding:16px 16px 12px}
  .lp-foot{padding:16px 20px 22px}
  .lp-title{font-size:22px}
  .lp-btn{padding:14px 20px;flex:1;justify-content:center}
  .lp-foot .lp-spacer{display:none}
  .lp-calendly{height:62dvh;min-height:420px}
}

/* bouton CTA de la section bêta */
.beta-cta{display:flex;justify-content:center}
