/* Travicy public chatbot widget · NEW LOOK Deep Navy + Coral + Teal */
#travicy-chat-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999999;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  color: #071B44;
}

#travicy-chat-launcher {
  width: 68px;
  height: 68px;
  border-radius: 34px;
  background: radial-gradient(circle at 30% 30%, #102C6B 0%, #071B44 70%);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(7, 27, 68, 0.38), 0 0 0 0 rgba(255, 126, 107, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: tv-float 3.4s ease-in-out infinite, tv-ring 2.6s ease-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#travicy-chat-launcher::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 40px;
  border: 2px solid rgba(255, 126, 107, 0.55);
  opacity: 0;
  animation: tv-halo 2.6s ease-out infinite;
  pointer-events: none;
}
#travicy-chat-launcher:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 18px 40px rgba(7, 27, 68, 0.45), 0 0 0 0 rgba(255, 126, 107, 0);
  animation: none;
}
#travicy-chat-launcher:hover::after { animation: none; opacity: 0; }
#travicy-chat-launcher svg {
  width: 30px;
  height: 30px;
  stroke-width: 1.9;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}
#travicy-chat-launcher .tv-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  border-radius: 6px;
  background: #FF7E6B;
  border: 2px solid #071B44;
  box-shadow: 0 0 0 0 rgba(255, 126, 107, 0.75);
  animation: tv-pulse 1.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes tv-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes tv-ring {
  0% { box-shadow: 0 14px 32px rgba(7, 27, 68, 0.38), 0 0 0 0 rgba(255, 126, 107, 0.55); }
  70% { box-shadow: 0 14px 32px rgba(7, 27, 68, 0.38), 0 0 0 18px rgba(255, 126, 107, 0); }
  100% { box-shadow: 0 14px 32px rgba(7, 27, 68, 0.38), 0 0 0 0 rgba(255, 126, 107, 0); }
}
@keyframes tv-halo {
  0% { opacity: 0.7; transform: scale(1); }
  70% { opacity: 0; transform: scale(1.25); }
  100% { opacity: 0; transform: scale(1.25); }
}
@keyframes tv-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 126, 107, 0.7); }
  50% { box-shadow: 0 0 0 6px rgba(255, 126, 107, 0); }
}

/* Invitation label that pops beside the launcher on first visit */
#travicy-chat-invite {
  position: absolute;
  right: 78px;
  bottom: 12px;
  background: #fff;
  color: #071B44;
  border: 1px solid #E2E8F0;
  border-radius: 999px;
  padding: 9px 14px 9px 12px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(7, 27, 68, 0.14);
  display: flex;
  align-items: center;
  gap: 6px;
  transform: translateX(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
#travicy-chat-invite .tv-invite-close {
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 2px;
  border-radius: 999px;
  line-height: 0;
  pointer-events: auto;
}
#travicy-chat-invite .tv-invite-close:hover { color: #071B44; background: #F1F5F9; }
#travicy-chat-invite.tv-invite-visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
#travicy-chat-invite::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: 18px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid #E2E8F0;
  border-top: 1px solid #E2E8F0;
  transform: rotate(45deg);
}
@media (prefers-reduced-motion: reduce) {
  #travicy-chat-launcher, #travicy-chat-launcher::after, #travicy-chat-launcher .tv-dot {
    animation: none;
  }
}

#travicy-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 90px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(7, 27, 68, 0.28);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #E2E8F0;
}
#travicy-chat-panel.tv-open { display: flex; }

.tv-header {
  background: linear-gradient(135deg, #071B44 0%, #102C6B 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tv-header .tv-avatar {
  width: 34px;
  height: 34px;
  border-radius: 17px;
  background: rgba(45, 212, 191, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2DD4BF;
  font-weight: 800;
  font-size: 14px;
}
.tv-header .tv-titleblock { flex: 1; min-width: 0; }
.tv-header .tv-eyebrow {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #2DD4BF;
}
.tv-header .tv-title {
  font-size: 14px;
  font-weight: 700;
  margin-top: 2px;
  color: #fff;
}
.tv-header .tv-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tv-header .tv-close:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }

.tv-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #F8FAFC;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tv-msg {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.tv-msg.tv-assistant {
  align-self: flex-start;
  background: #fff;
  color: #071B44;
  border: 1px solid #E2E8F0;
  border-bottom-left-radius: 4px;
}
.tv-msg.tv-user {
  align-self: flex-end;
  background: #071B44;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.tv-msg.tv-system {
  align-self: center;
  background: rgba(45, 212, 191, 0.14);
  color: #0d9488;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
}
.tv-typing {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 10px 14px;
  display: inline-flex;
  gap: 4px;
}
.tv-typing span {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: #94A3B8;
  animation: tv-blink 1.2s infinite;
}
.tv-typing span:nth-child(2) { animation-delay: 0.2s; }
.tv-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes tv-blink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.tv-quicks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px 0;
  background: #F8FAFC;
}
.tv-quick {
  background: #fff;
  border: 1px solid #E2E8F0;
  color: #0d9488;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.tv-quick:hover { border-color: #2DD4BF; background: rgba(45, 212, 191, 0.06); }

.tv-input-wrap {
  border-top: 1px solid #E2E8F0;
  padding: 12px;
  display: flex;
  gap: 8px;
  background: #fff;
}
.tv-input {
  flex: 1;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: #071B44;
  outline: none;
  resize: none;
  max-height: 100px;
  background: #fff;
}
.tv-input::placeholder { color: #94A3B8; }
.tv-input:focus { border-color: #2DD4BF; }
.tv-send {
  background: #FF7E6B;
  color: #071B44;
  border: none;
  border-radius: 12px;
  padding: 0 14px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.tv-send:hover { background: #E5654F; }
.tv-send:disabled { opacity: 0.5; cursor: not-allowed; }
.tv-send svg { width: 16px; height: 16px; stroke-width: 2; }

.tv-footer {
  text-align: center;
  font-size: 10.5px;
  color: #94A3B8;
  padding: 6px 12px 10px;
  background: #fff;
}
.tv-footer a { color: #0d9488; text-decoration: none; font-weight: 600; }

/* --- Tablette (portrait/paysage): panel plafonne mais reste ancré à droite --- */
@media (max-width: 900px) {
  #travicy-chat-panel {
    width: min(400px, calc(100vw - 32px));
    max-width: none;
  }
}

/* --- Mobile: quasi fullscreen, iOS-safe --- */
@media (max-width: 640px) {
  #travicy-chat-root {
    right: 12px;
    bottom: 12px;
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
  }
  #travicy-chat-panel {
    position: fixed !important;
    right: 8px !important;
    left: 8px !important;
    bottom: 82px !important;
    bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
    top: 12px !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    border-radius: 18px;
  }
  #travicy-chat-launcher {
    width: 60px;
    height: 60px;
    border-radius: 30px;
    animation: none; /* évite le rebond gênant en mobile */
  }
  #travicy-chat-launcher::after { animation: none; opacity: 0; }
  #travicy-chat-launcher svg { width: 26px; height: 26px; }
  .tv-input {
    font-size: 16px; /* iOS ne zoome pas sur focus si >= 16px */
    line-height: 1.4;
  }
  .tv-msgs { padding: 14px 12px; }
  .tv-msg { max-width: 88%; font-size: 14px; }
  .tv-quicks { padding: 10px 12px 0; }
  .tv-quick { font-size: 12px; }
  .tv-header { padding: 12px 14px; }
  .tv-header .tv-title { font-size: 13.5px; }
  #travicy-chat-invite {
    right: 68px;
    bottom: 10px;
    font-size: 12px;
    padding: 10px 12px 10px 14px;
    min-width: 200px;
    max-width: min(260px, calc(100vw - 100px));
    white-space: normal;
    line-height: 1.4;
    border-radius: 14px;  /* plus pilule sur multi-ligne */
    align-items: flex-start;
  }
  #travicy-chat-invite::after { display: none !important; }  /* triangle inutile sur bulle carrée */
}

/* --- Très petits écrans: on cache l'invite (pas la place) --- */
@media (max-width: 380px) {
  #travicy-chat-invite { display: none !important; }
}

/* -----------------------------------------------------------------------
 * Tarteaucitron cookie banner — Travicy NEW LOOK redesign
 * Transforme la bannière full-width en carte popup discrete (bottom-left)
 * Deep Navy + Coral + Teal + Inter. Boutons ronds, tone-based.
 * --------------------------------------------------------------------- */

#tarteaucitronRoot,
#tarteaucitronRoot * {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif !important;
  box-sizing: border-box !important;
}

/* Le block "alert" est la bannière initiale */
#tarteaucitronAlertBig {
  position: fixed !important;
  left: 20px !important;
  right: auto !important;
  bottom: 20px !important;
  top: auto !important;
  width: 420px !important;
  max-width: calc(100vw - 32px) !important;
  background: #fff !important;
  color: #071B44 !important;
  padding: 18px 20px 16px !important;
  border-radius: 16px !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 24px 60px rgba(7, 27, 68, 0.18) !important;
  text-align: left !important;
  z-index: 999998 !important;
  animation: tv-cookies-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
@keyframes tv-cookies-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

#tarteaucitronAlertBig::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #FF7E6B 0%, #2DD4BF 100%);
  margin-bottom: 12px;
}

/* Texte principal */
#tarteaucitronDisclaimerAlert {
  color: #334155 !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  font-weight: 500 !important;
  display: block !important;
  margin-bottom: 14px !important;
  text-shadow: none !important;
}

/* Zone boutons — flex */
#tarteaucitronAlertBig .tarteaucitronCTAButton,
#tarteaucitronAlertBig #tarteaucitronPersonalize,
#tarteaucitronAlertBig #tarteaucitronCloseAlert,
#tarteaucitronAlertBig #tarteaucitronAllAllowed,
#tarteaucitronAlertBig #tarteaucitronAllDenied,
#tarteaucitronAlertBig #tarteaucitronAllAllowed2,
#tarteaucitronAlertBig #tarteaucitronAllDenied2 {
  font-family: 'Inter', system-ui, sans-serif !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  padding: 9px 14px !important;
  border-radius: 10px !important;
  margin: 4px 6px 4px 0 !important;
  border: none !important;
  cursor: pointer !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
  transition: background 0.15s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

/* Accept all → coral primary */
#tarteaucitronAlertBig #tarteaucitronAllAllowed,
#tarteaucitronAlertBig #tarteaucitronAllAllowed2,
#tarteaucitronAlertBig .tarteaucitronAllow,
#tarteaucitronPercentage {
  background: #FF7E6B !important;
  color: #071B44 !important;
}
#tarteaucitronAlertBig #tarteaucitronAllAllowed:hover,
#tarteaucitronAlertBig #tarteaucitronAllAllowed2:hover {
  background: #E5654F !important;
}

/* Deny all → white / border */
#tarteaucitronAlertBig #tarteaucitronAllDenied,
#tarteaucitronAlertBig #tarteaucitronAllDenied2,
#tarteaucitronAlertBig .tarteaucitronDeny {
  background: #fff !important;
  color: #334155 !important;
  border: 1px solid #E2E8F0 !important;
}
#tarteaucitronAlertBig #tarteaucitronAllDenied:hover,
#tarteaucitronAlertBig #tarteaucitronAllDenied2:hover {
  background: #F8FAFC !important;
}

/* Personnaliser → link teal */
#tarteaucitronAlertBig #tarteaucitronPersonalize,
#tarteaucitronAlertBig #tarteaucitronPersonalize2 {
  background: transparent !important;
  color: #0d9488 !important;
  padding-left: 4px !important;
  padding-right: 4px !important;
}
#tarteaucitronAlertBig #tarteaucitronPersonalize:hover {
  color: #071B44 !important;
  background: transparent !important;
}

/* Politique de confidentialité link */
#tarteaucitronAlertBig .tarteaucitronPrivacyUrl,
#tarteaucitronAlertBig a {
  color: #0d9488 !important;
  text-decoration: none !important;
  font-weight: 600 !important;
}
#tarteaucitronAlertBig a:hover {
  color: #071B44 !important;
  text-decoration: underline !important;
}

/* Le petit widget "Personnalisation" du bas droit — on l'avait déjà showIcon:false,
 * mais si jamais il ré-apparaît, on le range hors du chatbot */
#tarteaucitronManager,
#tarteaucitronPercentage {
  bottom: 20px !important;
  left: 20px !important;
  right: auto !important;
}

/* Panel Personnaliser (services list) — reste centré, propre */
#tarteaucitronServices,
#tarteaucitronBack {
  z-index: 999997 !important;
}

/* Mobile : la carte occupe presque toute la largeur */
@media (max-width: 480px) {
  #tarteaucitronAlertBig {
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    width: auto !important;
    padding: 16px !important;
  }
}
