/* --- Variables --- */
:root{
  --cgpt-bg: #0b0f19;
  --cgpt-panel: rgba(16, 22, 35, .78);
  --cgpt-stroke: rgba(255,255,255,.12);
  --cgpt-ink: #eaf0ff;
  --cgpt-muted: #b8c0d9;
  --cgpt-accent: #5ea0ff;
  --cgpt-green: #38d39f;
  --cgpt-danger: #ff6b6b;
  --cgpt-radius: 16px;
  --cgpt-shadow: 0 20px 50px rgba(0,0,0,.35);
  --cgpt-blur: blur(10px);
}

/* Accessibilité */
.screen-reader-text{ position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden; }

/* --- Floating Action Button --- */
.cgpt-fab{
  position: fixed; right: 18px; bottom: 18px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--cgpt-accent); color: #fff;
  border: 0; border-radius: 999px; padding: 10px 14px;
  font: 600 14px/1 system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial,sans-serif;
  box-shadow: var(--cgpt-shadow); cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  z-index: 9999;
}
.cgpt-fab:hover{ transform: translateY(-2px); }
.cgpt-fab-dot{ width: 8px; height: 8px; border-radius: 50%; background:#fff; opacity:.9; }
.cgpt-fab-label{ letter-spacing: .2px; }

/* --- Chat window --- */
.cgpt-chat{
  position: fixed; right: 18px; bottom: 78px;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 110px);
  display: flex; flex-direction: column;
  background: var(--cgpt-panel); color: var(--cgpt-ink);
  border: 1px solid var(--cgpt-stroke);
  border-radius: 18px; box-shadow: var(--cgpt-shadow);
  backdrop-filter: var(--cgpt-blur);
  overflow: hidden; z-index: 9999; transform-origin: bottom right;
  transition: opacity .2s ease, transform .2s ease;
}
.cgpt-chat.hidden{ opacity: 0; pointer-events: none; transform: scale(.96); }
.cgpt-chat.visible{ opacity: 1; transform: scale(1); }

.cgpt-head{
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px; border-bottom: 1px solid var(--cgpt-stroke);
  background: linear-gradient(180deg, rgba(94,160,255,.25), transparent);
}
.cgpt-head-left{ display: flex; gap: 10px; align-items: center; }
.cgpt-avatar{ width: 32px; height: 32px; border-radius: 50%; background: #1b2235; display: grid; place-items: center; font-size:18px; }
.cgpt-botname{ font-weight: 700; }
.cgpt-status{ color: var(--cgpt-muted); font-size: 12px; display:flex; align-items:center; gap:6px; }
.cgpt-dot{ width:8px; height:8px; background: var(--cgpt-green); border-radius:50%; box-shadow:0 0 0 6px rgba(56,211,159,.15); }

.cgpt-close{
  background: transparent; border: 0; color: var(--cgpt-ink);
  width: 32px; height: 32px; border-radius: 8px; font-size: 18px; cursor: pointer;
}
.cgpt-close:hover{ background: rgba(255,255,255,.06); }

.cgpt-messages{
  padding: 12px; overflow: auto; display: flex; flex-direction: column; gap: 8px;
  scroll-behavior: smooth;
}

.cgpt-row{ display:flex; }
.cgpt-row.user{ justify-content: flex-end; }
.cgpt-row.bot{ justify-content: flex-start; }

.cgpt-bubble{
  max-width: 85%;
  padding: 10px 12px; border-radius: 14px; line-height: 1.4;
  border: 1px solid var(--cgpt-stroke);
  animation: pop .15s ease;
}
@keyframes pop{ from{ transform: scale(.97); opacity:.8 } to{ transform: scale(1); opacity:1 } }

.cgpt-bubble.user{ background: rgba(94,160,255,.18); }
.cgpt-bubble.bot{ background: rgba(255,255,255,.06); }

.cgpt-typing{ padding: 6px 12px; }
.cgpt-typing .cgpt-bubble{ width: 52px; text-align:center; letter-spacing:2px; }

/* --- Input --- */
.cgpt-form{
  display: flex; gap: 8px; padding: 10px;
  border-top: 1px solid var(--cgpt-stroke); background: rgba(0,0,0,.15);
}
#cgpt-input{
  flex: 1; background: rgba(255,255,255,.06); color: var(--cgpt-ink);
  border: 1px solid var(--cgpt-stroke); border-radius: 12px; padding: 10px 12px;
}
#cgpt-input::placeholder{ color: var(--cgpt-muted); }
.cgpt-send{
  background: var(--cgpt-accent); color: #fff; border: 0; padding: 10px 14px;
  border-radius: 12px; cursor: pointer; font-weight: 700;
}
.cgpt-send:hover{ filter: brightness(1.05); }

/* --- Links in bubbles --- */
.cgpt-bubble a{ color: #cfe3ff; text-decoration: underline; }

/* --- Modal (identité) --- */
.cgpt-modal{
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: grid; place-items: center; z-index: 10000;
}
.cgpt-modal.hidden{ display: none; }
.cgpt-modal-card{
  width: min(520px, calc(100vw - 32px));
  background: var(--cgpt-panel); color: var(--cgpt-ink);
  border: 1px solid var(--cgpt-stroke); border-radius: 18px;
  box-shadow: var(--cgpt-shadow); backdrop-filter: var(--cgpt-blur);
  padding: 16px;
}
.cgpt-modal-head{ display:flex; justify-content: space-between; align-items:center; margin-bottom: 8px; }
.cgpt-modal-close{
  background: transparent; border: 0; color: var(--cgpt-ink); font-size: 20px; cursor: pointer; width: 32px; height: 32px; border-radius: 8px;
}
.cgpt-modal-close:hover{ background: rgba(255,255,255,.06); }
.cgpt-modal-desc{ color: var(--cgpt-muted); margin: 6px 0 12px; }

.cgpt-ident-grid{ display: grid; gap: 12px; }
.cgpt-field label{ display:block; font-weight: 600; margin-bottom: 6px; }
.cgpt-field input{
  width: 100%; padding: 10px 12px; border-radius: 12px;
  background: rgba(255,255,255,.06); color: var(--cgpt-ink);
  border: 1px solid var(--cgpt-stroke);
}
.cgpt-field input:focus{ outline: 2px solid rgba(94,160,255,.5); outline-offset: 2px; }
.cgpt-error{ color: var(--cgpt-danger); font-size: 12px; min-height: 14px; display:block; margin-top: 4px; }

.cgpt-primary{
  background: var(--cgpt-green); color:#041015; border: 0; padding: 12px 14px;
  border-radius: 12px; font-weight: 800; cursor: pointer;
}
.cgpt-primary:hover{ filter: brightness(1.05); }

.cgpt-privacy{ margin-top: 8px; color: var(--cgpt-muted); font-size: 12px; }

/* --- Mobile tweaks --- */
@media (max-width: 420px){
  .cgpt-chat{ right: 12px; left: 12px; width: auto; }
}

/* ============================================================
   PATCH: uniformiser le champ Email (et tous les inputs) + anti-autofill
   ============================================================ */

/* Même style pour text / email / tel (spécificité forte + !important) */
#cgpt-ident-form .cgpt-field input,
#cgpt-ident-form .cgpt-field input[type="text"],
#cgpt-ident-form .cgpt-field input[type="email"],
#cgpt-ident-form .cgpt-field input[type="tel"]{
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,.06) !important;
  color: var(--cgpt-ink) !important;
  border: 1px solid var(--cgpt-stroke) !important;
  border-radius: 12px !important;
  padding: 10px 12px !important;
  line-height: 1.2;
  box-shadow: none !important;
  min-height: 44px;
  transition: box-shadow .15s ease, border-color .15s ease;
}

/* Focus cohérent */
#cgpt-ident-form .cgpt-field input:focus{
  outline: 2px solid rgba(94,160,255,.5);
  outline-offset: 2px;
  border-color: rgba(94,160,255,.55) !important;
}

/* Placeholder cohérent */
#cgpt-ident-form .cgpt-field input::placeholder{
  color: var(--cgpt-muted) !important;
  opacity: 1;
}

/* Chrome/Edge (WebKit) : neutraliser le fond jaune/blanc d'autofill */
#cgpt-ident-form .cgpt-field input:-webkit-autofill,
#cgpt-ident-form .cgpt-field input:-webkit-autofill:hover,
#cgpt-ident-form .cgpt-field input:-webkit-autofill:focus{
  -webkit-text-fill-color: var(--cgpt-ink) !important;
  caret-color: var(--cgpt-ink) !important;
  box-shadow: 0 0 0 1000px rgba(255,255,255,.06) inset !important;
  border: 1px solid var(--cgpt-stroke) !important;
  border-radius: 12px !important;
  transition: background-color 99999s ease-in-out 0s !important;
}

/* Firefox : neutraliser l'autofill */
#cgpt-ident-form .cgpt-field input:-moz-autofill{
  box-shadow: 0 0 0 1000px rgba(255,255,255,.06) inset !important;
  -moz-text-fill-color: var(--cgpt-ink) !important;
}

/* ============================================================
   NOUVEAU STYLE demandé (overrides non destructifs)
   ============================================================ */

/* Titre du popup en blanc bien lisible */
#cgpt-ident-title{
  color:#fff !important;
  font-weight: 800;
}

/* Masquer totalement l’ancienne note si elle reste dans le DOM */
.cgpt-modal-desc{ display:none !important; }

/* FAB plus grand, moderne, icône + gradient */
.cgpt-fab{
  padding: 12px 18px;                 /* plus grand */
  font-weight: 700;
  font-size: 15px;
  background: linear-gradient(135deg, #5aa0ff, #3d7bff);
  box-shadow: 0 12px 30px rgba(61,123,255,.35);
}
.cgpt-fab:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(61,123,255,.45);
}
.cgpt-fab-icon{
  width:18px; height:18px; display:inline-block; flex:0 0 18px;
  color:#fff; opacity:.95;
}

/* Labels pour plus de lisibilité (couleur douce) */
.cgpt-field label{
  color:#cfd6e4;
  font-weight:700;
}

/* Bouton du formulaire : toucher visuel plus “CTA” */
.cgpt-primary{
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 800;
}
