/* =========================================================
   0. Police globale
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

#gform_103,
#gform_103 *,
#h2j-chat,
#h2j-chat * {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================================
   1. CHAT – STRUCTURE COMMUNE
   ========================================================= */
#h2j-chat {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  background: #f7f8fc;
  box-shadow: 0 12px 30px rgba(15,23,42,.18);
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
}

#h2j-chat-log {
  max-height: 640px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#h2j-chat-log::-webkit-scrollbar { display: none; }

#h2j-chat-log .msg {
  max-width: 90%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.5;
  white-space: pre-line;
}

/* =========================================================
   2. CHAT – PUBLIC (BLEU)
   ========================================================= */
#h2j-chat-log .msg.user {
  align-self: flex-end;
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 4px;
}

#h2j-chat-log .msg.assistant {
  align-self: flex-start;
  background: #e5e7eb;
  color: #111827;
  border-bottom-left-radius: 4px;
}

#h2j-chat-log .msg a {
  color: #2563eb;
  text-decoration: underline;
}

#h2j-chat-input {
  display: flex;
  gap: 8px;
}

#h2j-message {
  flex: 1;
  border-radius: 999px;
  border: 1px solid #cbd5f5;
  padding: 10px 14px;
}

#h2j-message:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}

#h2j-send {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

#h2j-send:hover {
  background: #1d4ed8;
}

/* =========================================================
   3. MODE INTERNE — ROUGE PREMIUM
   ========================================================= */
body.h2j-mode-interne #h2j-chat {
  background: #fff5f5;
  box-shadow: 0 14px 34px rgba(185,28,28,.25);
  border: 1px solid rgba(220,38,38,.25);
}

/* Messages */
body.h2j-mode-interne #h2j-chat-log .msg.user {
  background: #dc2626;
  color: #fff;
}

body.h2j-mode-interne #h2j-chat-log .msg.assistant {
  background: #fee2e2;
  color: #450a0a;
}

/* Liens */
body.h2j-mode-interne #h2j-chat-log .msg a {
  color: #b91c1c;
}

/* Champ texte */
body.h2j-mode-interne #h2j-message {
  border-color: #fecaca;
}

body.h2j-mode-interne #h2j-message:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220,38,38,.2);
}

/* Bouton envoyer */
body.h2j-mode-interne #h2j-send {
  background: #dc2626;
}

body.h2j-mode-interne #h2j-send:hover {
  background: #991b1b;
}

/* =========================================================
   4. LOADING
   ========================================================= */
.h2j-loading {
  background: #e5e7eb;
  padding: 12px 16px;
  border-radius: 16px;
  display: flex;
  gap: 8px;
}

.h2j-loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563eb;
  animation: h2jBounce 1s infinite;
}

body.h2j-mode-interne .h2j-loading-dots span {
  background: #dc2626;
}

@keyframes h2jBounce {
  0%,100% { opacity:.3; }
  50% { opacity:1; }
}

/* =========================================================
   5. SOUS-TUILES INTERNES
   ========================================================= */
.h2j-internal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(180px,1fr));
  gap: 12px;
}

.h2j-internal-tile {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  color: #991b1b;
  box-shadow: 0 4px 14px rgba(220,38,38,.12);
}

.h2j-internal-tile:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
