/* Scoped, non-intrusive assistant. Global Renova V50. */
#gr-ai-widget { position: relative; z-index: 9998; font: 400 14px/1.5 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #172f2a; }
#gr-ai-widget *, #gr-ai-widget *::before, #gr-ai-widget *::after { box-sizing: border-box; }
#gr-ai-widget [hidden] { display: none !important; }
#gr-ai-widget button, #gr-ai-widget input, #gr-ai-widget textarea { font: inherit; }
#gr-ai-widget button { cursor: pointer; }
#gr-ai-widget button:focus-visible, #gr-ai-widget a:focus-visible, #gr-ai-widget input:focus-visible, #gr-ai-widget textarea:focus-visible { outline: 3px solid #6fbd91; outline-offset: 3px; }
#gr-ai-widget .gr-ai-fab { position: fixed; bottom: 22px; right: 22px; z-index: 9999; border: 0; border-radius: 999px; background: #123d33; color: white; box-shadow: 0 8px 26px rgba(8,39,30,.25); display: flex; align-items: center; gap: 12px; padding: 10px 20px 10px 12px; text-align: left; transition: transform .18s ease, box-shadow .18s ease; }
#gr-ai-widget .gr-ai-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 35px rgba(8,39,30,.31); }
#gr-ai-widget .gr-ai-fab-icon { display: grid; place-items: center; width: 41px; height: 41px; border-radius: 50%; background: #a4d8b8; color: #143b30; }
#gr-ai-widget .gr-ai-fab-icon svg { width: 25px; height: 25px; }
#gr-ai-widget .gr-ai-fab-label { display: grid; line-height: 1.28; font-size: 12px; }
#gr-ai-widget .gr-ai-fab-label strong { display: block; font-size: 14px; font-weight: 750; }
#gr-ai-widget.gr-ai-open .gr-ai-fab { display: none; }
#gr-ai-widget .gr-ai-panel { position: fixed; right: 22px; bottom: 22px; width: min(394px, calc(100vw - 24px)); height: min(650px, calc(100dvh - 44px)); z-index: 9999; border: 1px solid #dfece7; border-radius: 22px; box-shadow: 0 24px 80px rgba(0,0,0,.2); background: #fff; display: flex; flex-direction: column; overflow: hidden; color: #172f2a; }
#gr-ai-widget .gr-ai-header { display: flex; gap: 10px; align-items: center; flex: 0 0 auto; padding: 15px 15px; color: #fff; background: linear-gradient(110deg, #123f34, #1d6450); }
#gr-ai-widget .gr-ai-brand-icon { background: rgba(232,250,238,.18); padding: 9px; width: 42px; height: 42px; border-radius: 13px; }
#gr-ai-widget .gr-ai-brand-icon svg { width: 24px; height: 24px; }
#gr-ai-widget .gr-ai-header-text { display: grid; flex: 1; line-height: 1.35; }
#gr-ai-widget .gr-ai-header-text strong { font-size: 16px; font-weight: 750; }
#gr-ai-widget .gr-ai-header-text span { color: #d7eddf; font-size: 12px; }
#gr-ai-widget .gr-ai-header-text i { display: inline-block; vertical-align: 1px; border-radius: 50%; width: 7px; height: 7px; background: #a6e8ac; margin-right: 4px; }
#gr-ai-widget .gr-ai-close { background: transparent; padding: 7px; color: #fff; border: 0; border-radius: 9px; }
#gr-ai-widget .gr-ai-close svg { height: 20px; width: 20px; display: block; }
#gr-ai-widget .gr-ai-conversation { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; background: #f5faf7; }
#gr-ai-widget .gr-ai-messages { display: flex; flex-direction: column; gap: 13px; padding: 20px 15px 8px; overflow-y: auto; overflow-x: hidden; min-height: 50px; flex: 1 1 auto; overscroll-behavior: contain; }
#gr-ai-widget .gr-ai-bubble { max-width: 90%; border-radius: 16px 16px 16px 4px; box-shadow: 0 1px 5px rgba(8,51,35,.05); padding: 12px 13px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.8px; line-height: 1.5; }
#gr-ai-widget .gr-ai-bubble-bot { align-self: flex-start; background: #fff; border: 1px solid #e7eee9; }
#gr-ai-widget .gr-ai-bubble-user { align-self: flex-end; color: #fff; background: #155945; border-radius: 16px 16px 4px 16px; }
#gr-ai-widget .gr-ai-bubble-label { display: block; font-size: 11px; font-weight: 700; color: #256c53; margin-bottom: 5px; }
#gr-ai-widget .gr-ai-quick { display: flex; gap: 7px; flex-wrap: wrap; padding: 9px 14px 11px; }
#gr-ai-widget .gr-ai-quick button { background: #fff; color: #1b5441; border: 1px solid #cce4d8; border-radius: 20px; font-size: 11.5px; font-weight: 600; padding: 7px 10px; }
#gr-ai-widget .gr-ai-quick button:hover { background: #e7f6ec; }
#gr-ai-widget .gr-ai-typing { padding: 4px 16px 10px; color: #5b7369; font-size: 12px; }
#gr-ai-widget .gr-ai-contact-cta { padding: 7px 13px 10px; background: #f5faf7; }
#gr-ai-widget .gr-ai-to-lead { width: 100%; padding: 11px; border: 1px solid #9ed5ac; border-radius: 11px; color: #14503d; background: #e7f7e9; font-size: 12.5px; font-weight: 700; }
#gr-ai-widget .gr-ai-contact-cta-highlight .gr-ai-to-lead { background: #d7f0dd; }
#gr-ai-widget .gr-ai-to-lead:hover { background: #d5efdc; }
#gr-ai-widget .gr-ai-footer { padding: 7px 15px 5px; background: #fff; display: flex; justify-content: space-between; gap: 8px; flex: 0 0 auto; font-size: 10px; color: #6b8378; border-top: 1px solid #edf2ee; }
#gr-ai-widget .gr-ai-footer a { color: #1d7053; text-decoration: underline; }
#gr-ai-widget .gr-ai-composer { display: flex; align-items: center; gap: 10px; background: #fff; padding: 8px 12px 6px; flex: 0 0 auto; }
#gr-ai-widget .gr-ai-composer textarea { resize: none; flex: 1; min-height: 44px; max-height: 96px; padding: 11px; background: #f6f9f7; border: 1px solid #dae7df; border-radius: 12px; line-height: 1.35; color: #19392f; width: 100%; }
#gr-ai-widget .gr-ai-composer button { background: #18523f; color: #fff; border: 0; border-radius: 11px; width: 41px; height: 41px; display: grid; place-items: center; flex-shrink: 0; }
#gr-ai-widget .gr-ai-composer button:disabled { opacity: .48; cursor: not-allowed; }
#gr-ai-widget .gr-ai-composer svg { width: 20px; height: 20px; }
#gr-ai-widget .gr-ai-disclosure { text-align: center; color: #75867d; font-size: 9.4px; padding: 0px 12px 9px; background: #fff; flex: 0 0 auto; line-height: 1.4; }
#gr-ai-widget .gr-ai-lead { flex: 1 1 auto; overflow-y: auto; padding: 17px 18px; min-height: 0; background: #f7faf8; }
#gr-ai-widget .gr-ai-back { border: 0; background: none; padding: 0 0 8px; color: #186c4b; font-size: 12px; }
#gr-ai-widget .gr-ai-lead h3 { margin: 4px 0 5px; font-size: 20px; line-height: 1.25; color: #123d31; }
#gr-ai-widget .gr-ai-lead > p { margin: 0 0 15px; color: #627b70; font-size: 12.5px; }
#gr-ai-widget .gr-ai-lead-form { display: grid; gap: 9px; }
#gr-ai-widget .gr-ai-lead-form > label:not(.gr-ai-consent) { display: grid; gap: 4px; font-size: 12px; color: #204638; font-weight: 600; }
#gr-ai-widget .gr-ai-lead-form label span { font-size: 11px; color: #6d8078; font-weight: 400; }
#gr-ai-widget .gr-ai-lead-form input:not([type=checkbox]), #gr-ai-widget .gr-ai-lead-form textarea { width: 100%; border: 1px solid #d4e5da; border-radius: 9px; background: #fff; color: #16392b; padding: 9px 10px; min-height: 37px; font-size: 13px; }
#gr-ai-widget .gr-ai-lead-form .gr-ai-consent { display: flex; align-items: flex-start; gap: 10px; color: #576e61; font-size: 11px; line-height: 1.4; margin-top: 4px; }
#gr-ai-widget .gr-ai-consent input { margin-top: 3px; accent-color: #1b654e; }
#gr-ai-widget .gr-ai-consent span { color: #536e5f; font-size: 11px; }
#gr-ai-widget .gr-ai-consent a { color: #0e6443; text-decoration: underline; }
#gr-ai-widget .gr-ai-send-lead { display: block; width: 100%; background: #185841; color: #fff; border: none; border-radius: 10px; padding: 11px; font-weight: 750; }
#gr-ai-widget .gr-ai-send-lead:disabled { opacity: .55; }
#gr-ai-widget .gr-ai-form-status { min-height: 18px; margin: 0; color: #aa322b; font-size: 11.5px; }
#gr-ai-widget .gr-ai-honeypot, #gr-ai-widget .gr-ai-visually-hidden { position: absolute !important; clip: rect(0,0,0,0); height: 1px; width: 1px; overflow: hidden; white-space: nowrap; }
@media (max-width: 600px) {
 #gr-ai-widget .gr-ai-panel { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: min(680px, calc(100dvh - 16px)); border-radius: 18px; }
 #gr-ai-widget .gr-ai-fab { right: 12px; bottom: 14px; padding: 9px 12px 9px 9px; }
 #gr-ai-widget .gr-ai-fab-label { font-size: 11px; }
 #gr-ai-widget .gr-ai-fab-label strong { font-size: 12px; }
 #gr-ai-widget .gr-ai-bubble { max-width: 94%; }
}
@media (prefers-reduced-motion: reduce) { #gr-ai-widget .gr-ai-fab { transition: none; } }


/* V51 — iPhone / Android: chat discret, sans zoom Safari ni chevauchement du CTA. */
@media (max-width: 600px) {
  /* Le bouton flottant devient rond et ne masque plus les appels à l'action. */
  #gr-ai-widget .gr-ai-fab {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 56px;
    height: 56px;
    padding: 7px;
    justify-content: center;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 7px 22px rgba(8,39,30,.28);
  }
  #gr-ai-widget.gr-ai-has-bottom-cta .gr-ai-fab {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
  #gr-ai-widget .gr-ai-fab-icon { width: 40px; height: 40px; }
  #gr-ai-widget .gr-ai-fab-label { display: none; }

  /* Occupation de l'écran visible : l'ouverture du clavier réduit le panneau. */
  #gr-ai-widget .gr-ai-panel {
    top: var(--gr-ai-viewport-top, 0px);
    bottom: auto;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--gr-ai-viewport-height, 100dvh);
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  /* Safari iOS zoome automatiquement les champs dont la police est < 16px. */
  #gr-ai-widget .gr-ai-composer textarea,
  #gr-ai-widget .gr-ai-lead-form input:not([type=checkbox]),
  #gr-ai-widget .gr-ai-lead-form textarea {
    font-size: 16px;
  }
  #gr-ai-widget .gr-ai-composer textarea { min-height: 46px; }
  #gr-ai-widget .gr-ai-disclosure {
    padding-bottom: calc(9px + env(safe-area-inset-bottom, 0px));
  }
  /* Dégager l'espace de saisie tant que le clavier mobile est ouvert. */
  #gr-ai-widget.gr-ai-keyboard-open .gr-ai-quick,
  #gr-ai-widget.gr-ai-keyboard-open .gr-ai-contact-cta,
  #gr-ai-widget.gr-ai-keyboard-open .gr-ai-footer,
  #gr-ai-widget.gr-ai-keyboard-open .gr-ai-disclosure { display: none; }
}

/* Ne pas masquer le CTA principal tant que la fenêtre IA n'est pas ouverte. */
@media (max-width: 760px) {
  body.gr-ai-widget-open .mobile-bottom-cta {
    visibility: hidden;
    pointer-events: none;
  }
}
