/* Assistant « audit patrimonial gratuit » : styles du chat seulement.
   Tout est sous .np-chat. Aucune police chargée : Figtree et Playfair Display viennent du site.
   Le bouton d'envoi et le CTA utilisent les classes du site (button w-button). */

/* Le cadre prend toute la largeur du bloc ; la colonne de la conversation reste à 760 px au plus, centrée */
.np-chat{--np-chat-marge:max(24px,calc((100% - 760px) / 2));display:flex;flex-direction:column;border-radius:16px;background:#F8F4F0;font-family:Figtree,Arial,sans-serif;color:#121426;overflow:hidden;overflow:clip}
.np-chat *{box-sizing:border-box}
.np-chat p{margin:0}

/* En-tête : photo, nom, mention IA */
.np-chat__head{display:flex;align-items:center;gap:14px;padding:16px var(--np-chat-marge);border-bottom:1px solid #EBE4DC;background:#fff}
.np-chat__avatar{flex-shrink:0;width:48px;height:48px;border-radius:50%;background:#EBE4DC url("https://cdn.prod.website-files.com/62b396b0d7c9a06179696f8c/68a848497e5b4d90ac7746fb_643ff7a31651915135f832ec_Malek%2520Ziane.webp-p-500.webp") center 20%/cover no-repeat}
.np-chat__name{font-size:16px;font-weight:700;line-height:1.3}
.np-chat__status{display:flex;align-items:center;gap:6px;font-size:14px;line-height:1.3;color:rgba(18,20,38,.7)}
.np-chat__dot{width:8px;height:8px;border-radius:50%;background:#CF9804}

/* Fil de la conversation */
.np-chat__log{position:relative;display:flex;flex-direction:column;gap:12px;height:min(560px,62vh);padding:24px var(--np-chat-marge);overflow-y:auto;overscroll-behavior:contain}
.np-chat__msg{max-width:85%;padding:12px 16px;border-radius:16px;font-size:16px;line-height:1.5}
.np-chat__msg p+p,.np-chat__msg p+ul,.np-chat__msg ul+p{margin-top:10px}
.np-chat__msg ul{margin:0;padding-left:20px}
.np-chat__msg li+li{margin-top:6px}
.np-chat__msg a{color:inherit;text-decoration:underline;text-underline-offset:2px}
.np-chat__msg--bot{align-self:flex-start;border-bottom-left-radius:4px;background:#fff}
.np-chat__msg--user{align-self:flex-end;border-bottom-right-radius:4px;background:#121426;color:#fff;white-space:pre-wrap}
.np-chat__msg--error{align-self:flex-start;border:1px solid #CFD1DE;background:#fff;color:#121426}

/* Indicateur « en train d'écrire » */
.np-chat__typing{display:flex;align-items:center;gap:10px;align-self:flex-start;padding:12px 16px;border-radius:16px;border-bottom-left-radius:4px;background:#fff;font-size:14px;color:rgba(18,20,38,.7)}
.np-chat__dots{display:inline-flex;gap:4px}
.np-chat__dots span{width:7px;height:7px;border-radius:50%;background:#9698AE;animation:np-chat-dot 1.2s infinite ease-in-out}
.np-chat__dots span:nth-child(2){animation-delay:.15s}
.np-chat__dots span:nth-child(3){animation-delay:.3s}

/* Apparition des éléments ajoutés par le script (pas du contenu servi avec la page) */
.np-chat__new{animation:np-chat-in .25s ease-out both}

/* Réponses proposées */
.np-chat__choices{display:flex;flex-wrap:wrap;gap:8px}
.np-chat__choice{min-height:44px;padding:8px 16px;border:1px solid #121426;border-radius:50px;background:#fff;color:#121426;font:inherit;font-size:15px;line-height:1.3;text-align:left;cursor:pointer;transition:background .15s,color .15s}
.np-chat__choice:hover{background:#121426;color:#fff}
.np-chat__choice:focus-visible,.np-chat__input:focus-visible{outline:2px solid #CF9804;outline-offset:2px}

/* Proposition de consultation : en cours d'audit ou après le diagnostic */
.np-chat__next{display:flex;flex-direction:column;align-items:flex-start;gap:12px;padding:20px;border-radius:16px;background:#FFF9EB}
.np-chat__next--compact{padding:0;background:none}
.np-chat__next-who{display:flex;align-items:center;gap:12px}
.np-chat__avatar--small{width:40px;height:40px}
.np-chat__next-title{font-family:"Playfair Display",Georgia,serif;font-weight:600;font-size:22px;line-height:1.3}
.np-chat__next-text{font-size:16px;line-height:1.5}
.np-chat__next-proof{font-size:14px;line-height:1.4;color:rgba(18,20,38,.7)}
.np-chat__next-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px 20px}
.np-chat__later{min-height:44px;padding:0;border:0;background:none;color:#121426;font:inherit;font-size:15px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.np-chat__later:focus-visible{outline:2px solid #CF9804;outline-offset:2px}

/* Saisie */
.np-chat__form{display:flex;gap:10px;margin:0;padding:16px var(--np-chat-marge);border-top:1px solid #EBE4DC;background:#fff}
.np-chat__label,.np-chat__trap{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.np-chat__input{flex:1;min-width:0;height:53px;margin:0;padding:0 20px;border:1px solid #121426;border-radius:50px;background:#fff;color:inherit;font:inherit;font-size:16px}
.np-chat__input:disabled{border-color:#CFD1DE;background:#F8F4F0}
.np-chat__send{flex-shrink:0}
.np-chat__send:disabled{opacity:.5;cursor:default}
.np-chat__note{padding:0 var(--np-chat-marge) 16px;background:#fff;font-size:12px;line-height:1.45;color:rgba(18,20,38,.7)}

@keyframes np-chat-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes np-chat-dot{0%,60%,100%{opacity:.35;transform:none}30%{opacity:1;transform:translateY(-3px)}}

@media (prefers-reduced-motion:reduce){
  .np-chat__new{animation:none}
  .np-chat__dots span{animation:none;opacity:.7}
}

@media (max-width:767px){
  .np-chat{border-radius:12px}
  .np-chat__head{padding:12px 16px}
  /* Un seul défilement, celui de la page ; la saisie reste collée en bas de l'écran */
  .np-chat__log{height:auto;min-height:0;overflow:visible;padding:16px}
  .np-chat__msg{max-width:92%}
  .np-chat__form{position:sticky;bottom:0;z-index:2;padding:12px 16px}
  .np-chat__next{padding:16px}
  .np-chat__next-title{font-size:20px}
  .np-chat__next-actions .button{width:100%;text-align:center}
  .np-chat__input{height:48px;padding:0 16px}
  .np-chat__note{padding:0 16px 12px}
}
