/* LDI Handoff v3.1 - Style identique au tchat Axel */
:root {
  --blue: #00b8e6;
  --blue-2: #00a8d4;
  --blue-glow: #00d4f0;
  --dark: #0a0a0a;
  --dark-2: #1a1a1a;
  --border: #e2e8f0;
  --bg-2: #f8fafc;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.3);
}

.axel-suggestion.handoff {
  background: var(--blue) !important;
  color: white !important;
  border-color: var(--blue) !important;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.axel-suggestion.handoff:hover {
  background: var(--blue-2) !important;
  color: white !important;
  border-color: var(--blue-2) !important;
}
.axel-suggestion.handoff i { font-size: 0.85rem; }

.ldi-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: ldiFade .2s ease;
}
.ldi-modal-overlay.open { display: flex; }
@keyframes ldiFade { from { opacity: 0; } to { opacity: 1; } }

.ldi-modal {
  background: white;
  width: 400px; max-width: calc(100vw - 32px);
  height: 620px; max-height: calc(100vh - 120px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: ldiPop .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes ldiPop { from { transform: translateY(20px) scale(0.95); opacity: 0; } to { transform: none; opacity: 1; } }

.ldi-modal-head {
  background: var(--dark); color: white;
  padding: 16px 20px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 2px solid var(--blue);
  flex-shrink: 0;
}
.ldi-modal-head .avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: white; padding: 2px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.ldi-modal-head .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ldi-modal-head .info { flex: 1; min-width: 0; }
.ldi-modal-head .info strong {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem; font-weight: 700;
  color: white;
}
.ldi-modal-head .info small {
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  display: flex; align-items: center; gap: 6px;
}
.ldi-modal-head .info .online-dot {
  width: 8px; height: 8px; background: #10b981; border-radius: 50%;
  animation: ldiPulse 2s infinite;
}
@keyframes ldiPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.ldi-modal-close {
  color: white; font-size: 1.2rem;
  padding: 8px; border-radius: 8px;
  background: transparent; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ldi-modal-close:hover { background: rgba(255,255,255,0.1); }

.ldi-modal-body {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-2);
  display: flex; flex-direction: column;
}

.ldi-intro {
  background: white;
  margin: 16px 20px 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--dark);
  align-self: flex-start;
  max-width: 85%;
  animation: ldiMsgIn 0.3s ease;
}
.ldi-intro strong {
  color: var(--blue);
  display: block;
  font-size: 0.78rem; font-weight: 700;
  margin-bottom: 4px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
@keyframes ldiMsgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.ldi-form {
  padding: 16px 20px;
  background: white;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ldi-form .form-group { margin-bottom: 12px; }
.ldi-form .form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.ldi-form input,
.ldi-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: inherit; font-size: 0.92rem;
  resize: none;
  min-height: 42px; max-height: 100px;
  box-sizing: border-box;
  transition: border-color 0.2s;
  color: var(--dark);
  background: white;
}
.ldi-form input:focus,
.ldi-form textarea:focus {
  outline: none;
  border-color: var(--blue);
}
.ldi-form textarea { min-height: 60px; }
.ldi-form .form-error {
  color: #dc2626; font-size: 0.75rem; margin-top: 4px; display: none;
}

.ldi-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.8rem; color: #475569;
  margin: 10px 0 12px;
  cursor: pointer;
  line-height: 1.45;
  user-select: none;
}
.ldi-consent .ldi-check {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  margin-top: 2px;
}
.ldi-consent .ldi-check input {
  width: 18px; height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--blue);
}
.ldi-consent .ldi-consent-text {
  flex: 1 1 0%;
  min-width: 0;
  display: block;
}

.btn-submit {
  width: 100%;
  padding: 12px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.2s, transform 0.15s;
}
.btn-submit:hover:not(:disabled) { background: var(--blue-2); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* === Chat live (apres start) === */
.ldi-chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ldi-chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: white;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: #64748b;
}
.ldi-chat-head .status { display: flex; align-items: center; gap: 6px; }
.ldi-chat-head .status .dot {
  width: 8px; height: 8px; border-radius: 50%; background: #10b981;
  animation: ldiPulse 2s infinite;
}
.ldi-end {
  background: transparent; border: 1px solid var(--border);
  color: #64748b; padding: 4px 10px; border-radius: 8px;
  font-size: 0.78rem; cursor: pointer; font-family: inherit;
  transition: background 0.2s;
}
.ldi-end:hover:not(:disabled) { background: var(--bg-2); }
.ldi-end:disabled { opacity: 0.5; cursor: not-allowed; }

.ldi-chat-msgs {
  flex: 1; overflow-y: auto;
  padding: 20px;
  background: var(--bg-2);
  display: flex; flex-direction: column; gap: 12px;
}
.ldi-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.92rem; line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
  animation: ldiMsgIn 0.3s ease;
}
.ldi-msg.patrick {
  background: white; color: var(--dark);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
  align-self: flex-start;
}
.ldi-msg.patrick strong {
  display: block;
  color: var(--blue);
  font-size: 0.78rem; font-weight: 700;
  margin-bottom: 4px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.ldi-msg.client {
  background: var(--dark); color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.ldi-msg .ts {
  font-size: 0.7rem; color: #94a3b8;
  margin-top: 4px; opacity: 0.8;
}
.ldi-msg.client .ts { color: rgba(255,255,255,0.6); }
.ldi-msg.system {
  align-self: center;
  max-width: 95%;
  background: transparent;
  padding: 4px 12px;
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
  font-style: italic;
}

.ldi-input-area {
  padding: 14px 16px;
  background: white;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: flex-end;
  flex-shrink: 0;
}
.ldi-input {
  flex: 1; padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: inherit; font-size: 0.92rem;
  resize: none; min-height: 42px; max-height: 100px;
  transition: border-color 0.2s;
  color: var(--dark);
}
.ldi-input:focus { outline: none; border-color: var(--blue); }
.ldi-input:disabled { background: var(--bg-2); cursor: not-allowed; }
.ldi-send {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--blue); color: white;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
  transition: background 0.2s;
}
.ldi-send:hover:not(:disabled) { background: var(--blue-2); }
.ldi-send:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 480px) {
  .ldi-modal { width: auto; max-width: calc(100vw - 24px); height: calc(100vh - 80px); }
  .ldi-modal-head { padding: 14px 16px; }
}
