/* Niro sur tout le site : bulle en bas à droite et fenêtre de discussion.
   Ajoutée à chaque page par le plugin (réglage ia.partout), aux couleurs du site (variables de tokens.css). */

.niro-site {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 60;
  color: #fff;
  font-family: var(--font-body, "Inter", system-ui, -apple-system, "Segoe UI", sans-serif);
  font-size: 15px;
  line-height: 1.45;
}
.niro-site *, .niro-site *::before, .niro-site *::after { box-sizing: border-box; }
/* le style de base du site (marges entre éléments, largeur des paragraphes) ne s'applique pas ici */
.niro-site :where(*) { margin: 0; max-width: none; }
.niro-site [hidden] { display: none !important; }
html:has(.site-nav[data-open="true"]) .niro-site { display: none; }

.niro-site-bulle {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 9px 24px 9px 9px;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--radius-pill, 9999px);
  background: var(--color-base, #221212); color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  cursor: pointer;
}
.niro-site-bulle:hover { background: var(--color-surface, #2b1816); }
.niro-site-bulle:focus-visible, .niro-site button:focus-visible, .niro-site textarea:focus-visible, .niro-site a:focus-visible {
  outline: 2px solid var(--color-cool, #cff4ff); outline-offset: 2px;
}
/* rond orange avec l'étoile Niroline, comme le bouton Niro de la page de devis */
.niro-site-ava {
  display: inline-grid; place-items: center; flex: none;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--color-accent, #fd4819); color: var(--color-base, #221212);
}
.niro-site-ava svg { width: 25px; height: 25px; }
.niro-site-ava--p { width: 34px; height: 34px; }
.niro-site-ava--p svg { width: 18px; height: 18px; }
.niro-site-libelle { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; line-height: 1.1; }
.niro-site-libelle b { font: 500 18px/1.1 var(--font-display, "Space Grotesk", sans-serif); }
.niro-site-libelle small { font: 13px/1.1 var(--font-body, "Inter", system-ui, sans-serif); color: #cdbfbc; }
.niro-site[data-ouvert="true"] .niro-site-bulle { display: none; }

.niro-site-panneau {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  width: min(460px, calc(100vw - 32px));
  height: min(720px, calc(100dvh - var(--header-height, 72px) - 40px));
  display: flex; flex-direction: column;
  background: var(--color-base, #221212);
  border: 1px solid var(--color-line, rgba(255, 255, 255, .14));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

.niro-site-tete {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 12px 14px 16px;
  border-bottom: 1px solid var(--color-line, rgba(255, 255, 255, .14));
}
.niro-site-tete div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.niro-site-tete b { font: 500 21px/1.1 var(--font-display, "Space Grotesk", sans-serif); letter-spacing: .01em; }
.niro-site-tete div > span { font-size: 13.5px; color: rgba(255, 255, 255, .62); }
.niro-site-icone {
  width: 34px; height: 34px; flex: none;
  display: inline-grid; place-items: center;
  border: 0; border-radius: var(--radius-pill, 9999px);
  background: transparent; color: rgba(255, 255, 255, .8); cursor: pointer;
}
.niro-site-icone:hover { background: var(--color-surface-alt, #341614); color: #fff; }
.niro-site-icone svg { width: 18px; height: 18px; }

.niro-site-fil {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.niro-site-msg { max-width: 90%; padding: 11px 14px; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.niro-site-msg.a { align-self: flex-start; background: var(--color-surface, #2b1816); }
.niro-site-msg.u { align-self: flex-end; background: var(--color-surface-alt, #341614); border: 1px solid var(--color-line, rgba(255, 255, 255, .14)); }
.niro-site-msg.erreur { background: transparent; border: 1px solid rgba(253, 72, 25, .6); color: rgba(255, 255, 255, .85); }
.niro-site-msg p + p, .niro-site-msg p + ul, .niro-site-msg ul + p { margin-top: 8px; }
.niro-site-msg ul { padding-left: 18px; list-style: disc; }
.niro-site-msg li + li { margin-top: 3px; }
.niro-site-msg b { font-weight: 600; }
.niro-site a { color: var(--color-cool, #cff4ff); text-decoration: underline; text-underline-offset: 2px; }
.niro-site a:hover { color: #fff; }
.niro-site-msg.attente::after { content: "…"; display: inline-block; animation: niro-site-attente 1.2s steps(4, end) infinite; overflow: hidden; vertical-align: bottom; width: 0; }
@keyframes niro-site-attente { to { width: 1.1em; } }

.niro-site-sugg { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.niro-site-sugg button {
  padding: 7px 12px; border-radius: var(--radius-pill, 9999px);
  border: 1px solid var(--color-line, rgba(255, 255, 255, .14));
  background: transparent; color: #fff; font: 14px/1.3 var(--font-body, "Inter", system-ui, sans-serif);
  text-align: left; cursor: pointer;
}
.niro-site-sugg button:hover { background: var(--color-surface-alt, #341614); }

.niro-site-form {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--color-line, rgba(255, 255, 255, .14));
}
.niro-site-form textarea {
  flex: 1; min-width: 0; min-height: 44px; max-height: 120px; resize: none;
  padding: 11px 12px; border: 1px solid var(--color-line, rgba(255, 255, 255, .14)); border-radius: 0;
  background: var(--color-surface, #2b1816); color: #fff;
  font: 16px/1.4 var(--font-body, "Inter", system-ui, sans-serif);
}
.niro-site-form textarea::placeholder { color: rgba(255, 255, 255, .5); }
.niro-site-envoyer {
  width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center;
  border: 0; border-radius: var(--radius-pill, 9999px);
  background: var(--color-accent, #fd4819); color: #fff; cursor: pointer;
}
.niro-site-envoyer:disabled { opacity: .45; cursor: default; }
.niro-site-envoyer svg { width: 18px; height: 18px; }

.niro-site-pied { padding: 0 16px 12px; font-size: 12px; line-height: 1.4; color: rgba(255, 255, 255, .55); }

@media (max-width: 560px) {
  .niro-site-bulle { padding: 7px 20px 7px 7px; }
  .niro-site-ava { width: 42px; height: 42px; }
  .niro-site-ava svg { width: 23px; height: 23px; }
  .niro-site-ava--p { width: 32px; height: 32px; }
  .niro-site-msg { font-size: 15px; }
  .niro-site-panneau {
    right: 0; left: 0; bottom: 0; width: 100%;
    height: min(85dvh, 640px);
    border-left: 0; border-right: 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}
@media (prefers-reduced-motion: reduce) { .niro-site-msg.attente::after { animation: none; width: 1.1em; } }
@media print { .niro-site { display: none; } }
