/* ══════════════════════════════════════════════════════════════════
   NIAKS TECH — NIAKS ASSISTANT (bouton + fenêtre de chat)
   ------------------------------------------------------------------
   Empilé au-dessus de #wa-float, même coin — #wa-float garde sa
   propre règle CSS dans shell.css intégralement inchangée. Tout ici
   est position:fixed : impact CLS nul, aucun élément ne pousse le
   contenu de la page.

   Pendant que le panneau est ouvert (body.na-open), le bouton NIAKS
   ET #wa-float s'effacent : sur mobile surtout, les garder visibles
   en permanence aurait mangé une bonne partie de la hauteur utile du
   panneau pour rien — personne ne clique sur WhatsApp en pleine
   conversation avec NIAKS. #wa-float est réduit via `transform`, la
   SEULE propriété que sa transition dans shell.css anime déjà : on
   ne redéclare jamais sa règle `transition` ici, pour ne jamais
   pouvoir la faire diverger d'un futur changement dans shell.css.
   ══════════════════════════════════════════════════════════════════ */

/* ── Bouton flottant ── */
.na-btn {
  position: fixed; right: 22px; bottom: 90px; z-index: 61;
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--g1), var(--g2) 45%, var(--g4));
  border: none; cursor: pointer; padding: 0;
  box-shadow: 0 8px 28px rgba(196,152,48,0.35);
  transition: transform .25s ease, box-shadow .25s ease, opacity .25s ease, visibility .25s ease;
}
.na-btn-icon { font-family: 'Cinzel', serif; font-weight: 600; font-size: 20px; color: var(--dark); }
.na-btn:hover, .na-btn:focus-visible {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 34px rgba(196,152,48,0.5);
}
.na-btn[aria-expanded="true"] {
  box-shadow: 0 0 0 4px rgba(196,152,48,0.18), 0 8px 28px rgba(196,152,48,0.35);
}

body.na-open .na-btn { opacity: 0; visibility: hidden; pointer-events: none; transform: scale(.85); }
body.na-open #wa-float { transform: scale(0); pointer-events: none; }

/* ── Panneau ── */
.na-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 9500;
  width: 380px; max-width: calc(100vw - 44px);
  height: min(600px, calc(100vh - 120px));
  display: flex; flex-direction: column;
  background: linear-gradient(165deg, rgba(10,20,38,0.98), rgba(3,9,18,0.99));
  border: 1px solid rgba(196,152,48,0.28);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(196,152,48,0.06);
  overflow: hidden;
  transform-origin: bottom right;
  opacity: 0; transform: translateY(16px) scale(.92);
  visibility: hidden; pointer-events: none;
  transition: opacity .28s ease, transform .28s cubic-bezier(.22,.61,.36,1), visibility .28s ease;
}
body.na-open .na-panel {
  opacity: 1; transform: translateY(0) scale(1);
  visibility: visible; pointer-events: auto;
}

/* ── En-tête ── */
.na-head {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  padding: 16px 14px 16px 18px;
  background: rgba(2,8,16,0.6);
  border-bottom: 1px solid rgba(196,152,48,0.16);
}
.na-emblem {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid rgba(196,152,48,0.4);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif; font-size: 15px; color: var(--g1);
  background: rgba(196,152,48,0.08);
}
.na-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.na-head-title {
  font-family: 'Cinzel', serif; font-weight: 500; font-size: 15px; letter-spacing: 1.5px;
  background: linear-gradient(160deg, var(--g1) 0%, var(--g2) 40%, var(--g3) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.na-head-sub {
  font-family: 'Montserrat', sans-serif; font-size: 10px; font-weight: 500;
  letter-spacing: 1.2px; text-transform: uppercase; color: rgba(238,242,248,0.4);
}
.na-close {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: none; cursor: pointer; padding: 0;
  color: rgba(238,242,248,0.45); font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: color .25s ease, background .25s ease;
}
.na-close:hover, .na-close:focus-visible { color: var(--g2); background: rgba(196,152,48,0.1); }

/* ── Corps (journal des messages) ── */
.na-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  background: radial-gradient(ellipse at top, rgba(196,152,48,0.05), transparent 55%);
  scrollbar-width: thin; scrollbar-color: rgba(196,152,48,0.4) transparent;
}
.na-body::-webkit-scrollbar { width: 6px; }
.na-body::-webkit-scrollbar-thumb { background: rgba(196,152,48,0.35); border-radius: 3px; }

.na-bubble {
  font-family: 'Montserrat', sans-serif; font-weight: 300;
  font-size: 13.5px; line-height: 1.6; letter-spacing: .1px;
  padding: 11px 14px; border-radius: 13px; max-width: 86%;
}
.na-bubble-bot {
  align-self: flex-start; border-bottom-left-radius: 3px;
  background: rgba(255,255,255,0.05); color: rgba(238,242,248,0.9);
  border: 1px solid rgba(196,152,48,0.12);
}
.na-bubble-user {
  align-self: flex-end; border-bottom-right-radius: 3px;
  background: linear-gradient(120deg, var(--g2), var(--g4));
  color: var(--dark); font-weight: 500;
}
.na-bubble-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.na-bubble-action {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Cinzel', serif; font-weight: 400; font-size: 9.5px;
  letter-spacing: 2px; text-transform: uppercase; text-decoration: none;
  color: var(--dark); background: linear-gradient(120deg, var(--g2), var(--g3));
  padding: 9px 14px; border-radius: 20px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.na-bubble-action:hover, .na-bubble-action:focus-visible {
  transform: translateY(-1px); box-shadow: 0 6px 18px rgba(196,152,48,0.3);
}

/* ── Indicateur de saisie ── */
.na-typing { align-self: flex-start; display: flex; gap: 4px; padding: 13px 16px; }
.na-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: rgba(196,152,48,0.55);
  animation: naTyping 1.1s ease-in-out infinite;
}
.na-typing span:nth-child(2) { animation-delay: .15s; }
.na-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes naTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ── Suggestions ── */
.na-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.na-chip {
  font-family: 'Montserrat', sans-serif; font-size: 11.5px; font-weight: 500;
  color: var(--g1); background: rgba(196,152,48,0.08);
  border: 1px solid rgba(196,152,48,0.3); border-radius: 20px;
  padding: 8px 14px; cursor: pointer;
  transition: background .25s ease, border-color .25s ease, transform .2s ease;
}
.na-chip:hover, .na-chip:focus-visible {
  background: rgba(196,152,48,0.16); border-color: var(--g2); transform: translateY(-1px);
}

/* ── Actions permanentes : parler à l'équipe · nouvelle conversation ──
   Deux liens textuels discrets (même typographie que le sous-titre de l'en-tête), jamais un bloc : le panneau
   garde sa hauteur utile, et le relais humain est toujours à un clic. */
.na-tools {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 7px 14px; background: rgba(2,8,16,0.55); border-top: 1px solid rgba(196,152,48,0.1);
}
.na-tool {
  font-family: 'Montserrat', sans-serif; font-size: 10px; font-weight: 500; letter-spacing: 1.2px;
  text-transform: uppercase; text-decoration: none; color: rgba(196,152,48,0.75);
  background: none; border: none; padding: 4px 2px; cursor: pointer;
  transition: color .25s ease;
}
.na-tool:hover, .na-tool:focus-visible { color: var(--g1); }
.na-tool-sep { color: rgba(196,152,48,0.35); font-size: 10px; }

/* ── Formulaire de coordonnées (avec consentement explicite) ──
   Carte intégrée à la conversation, aux couleurs de la marque : jamais un pop-up, jamais affichée sans
   que le visiteur l'ait demandée (rappel, rendez-vous, numéro tapé dans le chat). */
.na-lead {
  align-self: flex-start; max-width: 92%; width: 100%; display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-radius: 13px; border-bottom-left-radius: 3px;
  background: rgba(196,152,48,0.06); border: 1px solid rgba(196,152,48,0.28);
}
.na-lead-field { display: flex; flex-direction: column; gap: 4px; }
.na-lead-field span {
  font-family: 'Montserrat', sans-serif; font-size: 10px; font-weight: 500; letter-spacing: 1.2px;
  text-transform: uppercase; color: rgba(238,242,248,0.55);
}
.na-lead input[type="text"], .na-lead input[type="tel"] {
  width: 100%; box-sizing: border-box; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(196,152,48,0.2); border-radius: 10px; padding: 9px 12px;
  font-family: 'Montserrat', sans-serif; font-size: 13px; color: var(--white);
}
.na-lead input[type="text"]:focus, .na-lead input[type="tel"]:focus { border-color: rgba(196,152,48,0.55); outline: none; }
.na-lead .na-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.na-lead-consent { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.na-lead-consent input { flex-shrink: 0; width: 17px; height: 17px; margin: 2px 0 0; accent-color: #c49830; }
.na-lead-consent span {
  font-family: 'Montserrat', sans-serif; font-size: 11.5px; font-weight: 300; line-height: 1.55; color: rgba(238,242,248,0.78);
}
.na-lead-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.na-lead-submit {
  font-family: 'Cinzel', serif; font-weight: 400; font-size: 9.5px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--dark); background: linear-gradient(120deg, var(--g2), var(--g3));
  border: none; border-radius: 20px; padding: 10px 18px; cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, opacity .25s ease;
}
.na-lead-submit:hover:not(:disabled), .na-lead-submit:focus-visible { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(196,152,48,0.3); }
.na-lead-submit:disabled { opacity: .5; cursor: progress; }
.na-lead-alt {
  font-family: 'Montserrat', sans-serif; font-size: 10.5px; letter-spacing: .6px; color: rgba(196,152,48,0.85);
  text-decoration: underline; text-underline-offset: 3px;
}
.na-lead-alt:hover, .na-lead-alt:focus-visible { color: var(--g1); }
.na-lead-msg { margin: 0; min-height: 0; font-family: 'Montserrat', sans-serif; font-size: 11.5px; line-height: 1.5; color: #e8b4a8; }
.na-lead-msg:empty { display: none; }

/* ── Comparateur d'offres (chantier 3, 23/09/2026) ──
   3 blocs empilés (Essentielle / Professionnelle / Sur Mesure), pas 3 colonnes côte à côte : reste lisible
   sans défilement horizontal sur les ~300-380 px du panneau, y compris mobile. Même carte que .na-lead
   (fond et bordure or discrets), pour rester visuellement cohérent avec le reste de la conversation. */
.na-compare { align-self: flex-start; max-width: 92%; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.na-compare-col {
  padding: 13px 14px; border-radius: 13px; border-bottom-left-radius: 3px;
  background: rgba(196,152,48,0.06); border: 1px solid rgba(196,152,48,0.28);
}
.na-compare-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(196,152,48,0.16);
}
.na-compare-name { font-family: 'Cinzel', serif; font-weight: 500; font-size: 13px; letter-spacing: 1px; color: var(--g1); }
.na-compare-price { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 13px; color: rgba(238,242,248,0.92); text-align: right; }
.na-compare-list { margin: 0 0 8px; padding: 0 0 0 16px; }
.na-compare-list li { font-family: 'Montserrat', sans-serif; font-weight: 300; font-size: 12px; line-height: 1.55; color: rgba(238,242,248,0.78); }
.na-compare-foot { font-family: 'Montserrat', sans-serif; font-weight: 500; font-size: 10.5px; letter-spacing: .3px; color: rgba(196,152,48,0.85); }

/* ── Zone de saisie ── */
.na-input-row {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; background: rgba(2,8,16,0.7);
  border-top: 1px solid rgba(196,152,48,0.14);
}
.na-input {
  flex: 1; min-width: 0; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(196,152,48,0.16); border-radius: 22px;
  padding: 10px 16px; font-family: 'Montserrat', sans-serif; font-size: 13px;
  color: var(--white);
}
.na-input::placeholder { color: rgba(238,242,248,0.35); }
.na-input:focus { border-color: rgba(196,152,48,0.5); outline: none; }
.na-send {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; border: none; padding: 0;
  background: linear-gradient(145deg, var(--g2), var(--g4)); color: var(--dark);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform .2s ease;
}
.na-send svg { width: 15px; height: 15px; }
.na-send:hover, .na-send:focus-visible { transform: scale(1.08); }
.na-send:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* ── Mention confidentialité / IA (sous la saisie, toujours visible) ── */
.na-privacy {
  flex-shrink: 0; margin: 0; padding: 6px 14px 10px;
  background: rgba(2,8,16,0.7);
  font-family: 'Montserrat', sans-serif; font-size: 9.5px; line-height: 1.5;
  color: rgba(238,242,248,0.4);
}
.na-privacy a { color: rgba(196,152,48,0.75); text-decoration: none; }
.na-privacy a:hover, .na-privacy a:focus-visible { color: var(--g1); }

/* ── Mobile (même palier que le reste du site) ── */
@media (max-width: 600px) {
  .na-btn { right: 16px; bottom: 76px; width: 50px; height: 50px; }
  .na-btn-icon { font-size: 18px; }
  .na-panel {
    right: 10px; left: 10px; bottom: 16px;
    width: auto; max-width: none;
    height: min(76vh, 620px);
    border-radius: 16px;
  }
  /* 16 px minimum dans les champs : en dessous, iOS zoome la page à la saisie */
  .na-lead input[type="text"], .na-lead input[type="tel"], .na-input { font-size: 16px; }
  .na-lead { max-width: 100%; }
  .na-compare { max-width: 100%; }
}

/* ── Mouvement réduit ── */
@media (prefers-reduced-motion: reduce) {
  .na-btn, .na-panel, .na-chip, .na-send, .na-close, .na-bubble-action, .na-tool, .na-lead-submit {
    transition: none !important;
  }
  body.na-open .na-panel, .na-panel { transform: none !important; }
  body.na-open .na-btn { transform: none !important; }
  .na-typing span { animation: none !important; opacity: .7; }
}
