/* -------------------------------------------
   0. Police globale orchestrateur (Google Font)
   ------------------------------------------- */

/* À mettre en tout début de fichier */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* Police & rendu doux sur tout le formulaire + le chat */
#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;
}

/* Masquer le footer Gravity Forms */
#gform_103 .gform_footer,
#gform_103 .gform_page_footer {
  display: none !important;
}

/* -------------------------------------------
   1. Conteneur global du chat
   ------------------------------------------- */

#h2j-chat {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  border-radius: 16px;
  padding: 16px;
  background: #f7f8fc;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
}

/* En-tête */
#h2j-chat-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

#h2j-chat-header .h2j-chat-title {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

#h2j-chat-header .h2j-chat-subtitle {
  font-size: 13px;
  color: #64748b;
}

/* -------------------------------------------
   2. Zone de messages
   ------------------------------------------- */

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

  /* On masque visuellement la barre de scroll
     sans empêcher le scroll à la molette */
  scrollbar-width: none !important;        /* Firefox */
  -ms-overflow-style: none !important;     /* IE/Edge legacy */
}

#h2j-chat-log::-webkit-scrollbar {
  display: none !important;                /* Chrome/Safari/Edge */
}

/* Rendre les retours à la ligne visibles */
#h2j-chat-log .msg {
  white-space: pre-line;
}

/* Style générique des bulles */
#h2j-chat-log .msg {
  display: inline-block;
  max-width: 90%;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

/* Messages utilisateur : alignés à droite, bulles bleues */
#h2j-chat-log .msg.user {
  align-self: flex-end;
  background: #2563eb;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

/* Messages assistant : alignés à gauche, bulles grises */
#h2j-chat-log .msg.assistant {
  align-self: flex-start;
  background: #e5e7eb;
  color: #111827;
  border-bottom-left-radius: 4px;
}

/* Liens dans les messages assistant */
#h2j-chat-log .msg a {
  color: #2563eb;
  text-decoration: underline;
}

/* -------------------------------------------
   3. Zone d'entrée
   ------------------------------------------- */

#h2j-chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* Champ texte */
#h2j-chat-input #h2j-message {
  flex: 1;
  border-radius: 999px;
  border: 1px solid #cbd5f5;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

/* Bouton avec icône */
#h2j-send {
  border: none;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

#h2j-send:hover {
  background: #1d4ed8;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

#h2j-send:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Icône dans le bouton */
.h2j-send-icon svg {
  display: block;
}

/* -------------------------------------------
   4. Bloc mail "Éléments à fournir"
   ------------------------------------------- */

.h2j-mail-block {
  background: #eceff3;
  padding: 16px;
  border-radius: 14px;
  margin-top: 12px;
  max-width: 550px;
}

.h2j-mail-title {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #111827;
  font-weight: 500;
}

.h2j-mail-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

.h2j-mail-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  font-size: 14px;
  background: #f9fafb;
}

.h2j-mail-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.h2j-mail-send {
  background: #2563eb;
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: 0.2s;
}

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

.h2j-mail-arrow {
  color: white;
  font-size: 18px;
  margin-left: 1px;
}

.h2j-mail-result {
  margin-top: 8px;
  font-size: 13px;
  color: #111827;
}

/* -------------------------------------------
   5. Bulle de fin (merci)
   ------------------------------------------- */

/* Style premium dans la même gamme de bleu */
.h2j-end-message {
  align-self: flex-start;
  max-width: 520px;
  margin: 20px 0 4px 0;
  padding: 16px 18px;
  border-radius: 18px;
  background: #c7d2fe;              /* bleu très doux */
  border: 3px solid #2563eb;        /* bordure légère */
}

.h2j-end-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}

.h2j-end-icon {
  font-size: 20px;
  color: #2563eb;
  margin-top: 2px;
}

.h2j-end-text {
  font-size: 14px;
  color: #1f2937;
  line-height: 1.5;
}

.h2j-end-text strong {
  font-weight: 600;
}
/* ----------- BULLE DE FIN (modernisée) ----------- */

.h2j-end-message {
    background: #eef2ff;             /* bleu doux premium */
    border-radius: 18px;
    padding: 22px 24px;
    margin: 20px 0;
    align-self: flex-start;
    max-width: 520px;
    text-align: center;              /* centrage du texte et du pictogramme */
}

.h2j-end-icon {
    font-size: 42px;                 /* emoji plus gros */
    line-height: 1;
    margin-bottom: 10px;             /* espace AVANT le texte */
}

.h2j-end-text {
    font-size: 14px;
    color: #1f2a44;
    line-height: 1.6;
}

.h2j-end-text strong {
    font-weight: 600;
    color: #111827;
}

/* -------------------------------------------
   6. Bulle de chargement orchestrateur
   ------------------------------------------- */

/* Bulle de chargement pendant l’analyse */
.h2j-loading {
  background: #e5e7eb;
  color: #111827;
  border-radius: 16px;
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
  font-size: 14px;
}

/* Points animés */
.h2j-loading-dots {
  display: inline-flex;
  gap: 4px;
}

.h2j-loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #2563eb;
  animation: h2j-bounce 1s infinite ease-in-out;
  opacity: 0.6;
}

.h2j-loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.h2j-loading-dots span:nth-child(3) {
  animation-delay: 0.30s;
}

@keyframes h2j-bounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.3;
  }
  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}
/* === Bloc de pré-sélection H2Justice – styles des tuiles === */

/* === Styles discrets et sobres pour les tuiles de pré-sélection === */

:root {
  --h2j-primary: #12375a;      /* bleu foncé CJ */
  --h2j-bg: #f8fafc;           /* fond très léger */
  --h2j-card-bg: #ffffff;      /* blanc */
  --h2j-border: rgba(18, 55, 90, 0.18);
  --h2j-border-hover: rgba(18, 55, 90, 0.45);
  --h2j-text: #1f2933;
  --h2j-muted: #6b7280;
  --h2j-radius: 12px;
  --h2j-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  --h2j-shadow-hover: 0 6px 18px rgba(15, 23, 42, 0.12);
}

/* Conteneur */
#h2j-presel {
  padding: 16px 12px;
  background: var(--h2j-bg);
}

/* Carte centrale */
.h2j-presel-inner {
  max-width: 900px;
  margin: 0 auto;
  background: var(--h2j-card-bg);
  border-radius: 14px;
  padding: 28px 24px 22px;
  box-shadow: var(--h2j-shadow);
  border: 1px solid rgba(18, 55, 90, 0.08);
}

/* Titres */
.h2j-presel-title {
  margin: 0 0 2px;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--h2j-primary);
}

.h2j-presel-subtitle {
  margin: 0 0 18px;
  font-size: 0.92rem;
  color: var(--h2j-muted);
}

/* Grille */
.h2j-presel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

/* Tuile discrète */
.h2j-tile {
  background: var(--h2j-card-bg);
  border: 1px solid var(--h2j-border);
  border-radius: var(--h2j-radius);
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: all 0.15s ease-out;
}

.h2j-tile:hover {
  border-color: var(--h2j-border-hover);
  box-shadow: var(--h2j-shadow-hover);
  transform: translateY(-1px);
}

.h2j-tile-icon {
  font-size: 1rem;
  opacity: 0.85;
}

.h2j-tile-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--h2j-primary);
}

.h2j-tile-text {
  font-size: 0.78rem;
  line-height: 1.25;
  color: var(--h2j-muted);
}

.h2j-presel-footnote {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--h2j-muted);
}

/* Responsive */
@media (max-width: 600px) {
  .h2j-presel-inner { padding: 20px 16px; }
  .h2j-tile { padding: 10px 12px; }
}
