/* ============================================================
   TripBook : tutoriel du tableau de bord (styles)
   Couleurs unies (bleu #0891b2), aucun dégradé. Suit le thème
   clair / sombre via les variables du dashboard (--bg-card, --text1…).
   ============================================================ */

.tf-tour-root,
.tf-tour-reminder,
.tf-help-btn {
  --tour-ocean: #0891b2;
  --tour-ocean-bg: rgba(8, 145, 178, 0.08);
  --tour-card: var(--bg-card, #ffffff);
  --tour-text1: var(--text1, #0f172a);
  --tour-text2: var(--text2, #334155);
  --tour-text3: var(--text3, #64748b);
  --tour-border: var(--border, #e2e8f0);
  --tour-track: var(--bg, #f1f5f9);
  --tour-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.28), 0 6px 16px -6px rgba(15, 23, 42, 0.12);
  --tour-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

body.tf-tour-active { overflow: hidden !important; }

/* ── Fond assombri avec découpe ─────────────────────────── */
.tf-tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  opacity: 0;
  transition: opacity 0.3s var(--tour-ease);
}
.tf-tour-backdrop.tf-visible { opacity: 1; }
.tf-tour-backdrop svg { display: block; width: 100%; height: 100%; }
.tf-tour-backdrop rect.tf-mask-bg { fill: #fff; }
.tf-tour-backdrop rect.tf-mask-cut { fill: #000; transition: x 0.45s var(--tour-ease), y 0.45s var(--tour-ease), width 0.45s var(--tour-ease), height 0.45s var(--tour-ease); }
.tf-tour-backdrop rect.tf-overlay { fill: rgba(15, 23, 42, 0.55); }

/* ── Halo autour de l'élément montré ────────────────────── */
.tf-tour-spotlight {
  position: fixed;
  z-index: 100001;
  pointer-events: none;
  border-radius: 12px;
  box-shadow: 0 0 0 2px var(--tour-ocean), 0 0 0 6px rgba(8, 145, 178, 0.22);
  opacity: 0;
  transition: top 0.45s var(--tour-ease), left 0.45s var(--tour-ease),
              width 0.45s var(--tour-ease), height 0.45s var(--tour-ease),
              opacity 0.25s var(--tour-ease);
}
.tf-tour-spotlight.tf-visible { opacity: 1; }

/* ── Bulle ──────────────────────────────────────────────── */
.tf-tour-tooltip {
  position: fixed;
  z-index: 100002;
  top: 0;
  left: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  background: var(--tour-card);
  border: 1px solid var(--tour-border);
  border-radius: 16px;
  box-shadow: var(--tour-shadow);
  padding: 18px 20px 16px;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--tour-text1);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s var(--tour-ease), transform 0.25s var(--tour-ease);
}
.tf-tour-tooltip.tf-visible { opacity: 1; transform: none; }
.tf-tour-tooltip.tf-center {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, calc(-50% + 4px));
}
.tf-tour-tooltip.tf-center.tf-visible { transform: translate(-50%, -50%); }

.tf-tour-arrow {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--tour-card);
  border: 1px solid var(--tour-border);
  transform: rotate(45deg);
  pointer-events: none;
  display: none;
}
.tf-tour-tooltip.tf-arrow-top .tf-tour-arrow,
.tf-tour-tooltip.tf-arrow-bottom .tf-tour-arrow,
.tf-tour-tooltip.tf-arrow-left .tf-tour-arrow,
.tf-tour-tooltip.tf-arrow-right .tf-tour-arrow { display: block; }
.tf-tour-tooltip.tf-arrow-top    .tf-tour-arrow { top: -8px !important; margin-left: -7px; border-right: none; border-bottom: none; }
.tf-tour-tooltip.tf-arrow-bottom .tf-tour-arrow { bottom: -8px; top: auto !important; margin-left: -7px; border-left: none; border-top: none; }
.tf-tour-tooltip.tf-arrow-left   .tf-tour-arrow { left: -8px !important; margin-top: -7px; border-right: none; border-top: none; }
.tf-tour-tooltip.tf-arrow-right  .tf-tour-arrow { right: -8px; left: auto !important; margin-top: -7px; border-left: none; border-bottom: none; }

.tf-tour-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.tf-tour-eyebrow {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tour-ocean);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tf-tour-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--tour-text3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tf-tour-close {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: var(--tour-track);
  color: var(--tour-text3);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tf-tour-close:hover { background: var(--tour-ocean-bg); color: var(--tour-ocean); }

.tf-tour-progress {
  height: 4px;
  border-radius: 4px;
  background: var(--tour-track);
  overflow: hidden;
  margin-bottom: 14px;
}
.tf-tour-progress span {
  display: block;
  height: 100%;
  background: var(--tour-ocean);
  border-radius: 4px;
  transition: width 0.35s var(--tour-ease);
}

.tf-tour-title {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--tour-text1);
  margin: 0 0 8px;
}
.tf-tour-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--tour-text2);
  margin: 0 0 10px;
}
.tf-tour-body { margin-bottom: 6px; }

.tf-tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 6px;
}
.tf-tour-actions-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tf-tour-actions-right { display: flex; gap: 8px; margin-left: auto; }

.tf-tour-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  min-height: 38px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tf-tour-btn-primary { background: var(--tour-ocean); color: #fff; font-weight: 700; }
.tf-tour-btn-primary:hover { background: #0e7490; }
.tf-tour-btn-secondary { background: var(--tour-card); color: var(--tour-text2); border-color: var(--tour-border); }
.tf-tour-btn-secondary:hover { border-color: var(--tour-ocean); color: var(--tour-ocean); }
.tf-tour-link {
  background: none;
  border: none;
  padding: 4px 0;
  font-family: inherit;
  font-size: 12px;
  color: var(--tour-text3);
  cursor: pointer;
}
.tf-tour-link:hover { color: var(--tour-ocean); text-decoration: underline; }
.tf-tour-btn:focus-visible,
.tf-tour-link:focus-visible,
.tf-tour-close:focus-visible,
.tf-help-btn:focus-visible {
  outline: 2px solid var(--tour-ocean);
  outline-offset: 2px;
}

/* ── Rappel « Tutoriel disponible » ─────────────────────── */
.tf-tour-reminder {
  position: fixed;
  left: 16px;
  bottom: 84px;
  z-index: 9500;
  width: 260px;
  box-sizing: border-box;
  background: var(--tour-card);
  border: 1px solid var(--tour-border);
  border-left: 3px solid var(--tour-ocean);
  border-radius: 12px;
  box-shadow: var(--tour-shadow);
  padding: 14px 16px;
  font-family: 'Inter', system-ui, sans-serif;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s var(--tour-ease), transform 0.22s var(--tour-ease);
}
.tf-tour-reminder.tf-visible { opacity: 1; transform: none; }
.tf-tour-reminder-title { font-size: 13.5px; font-weight: 700; color: var(--tour-text1); margin: 0 24px 4px 0; }
.tf-tour-reminder-text { font-size: 12.5px; line-height: 1.5; color: var(--tour-text2); margin-bottom: 10px; }
.tf-tour-reminder .tf-tour-btn { min-height: 32px; padding: 6px 14px; font-size: 12.5px; }
.tf-tour-reminder-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--tour-text3);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.tf-tour-reminder-close:hover { background: var(--tour-ocean-bg); color: var(--tour-ocean); }

/* ── Bouton « ? Comment ça marche » sous le titre de chaque page ── */
.tf-help-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 11px 4px 4px;
  border: 1px solid var(--tour-border);
  border-radius: 100px;
  background: var(--tour-card);
  color: var(--tour-text2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.tf-help-btn[hidden] { display: none; }
.tf-help-btn:hover { border-color: var(--tour-ocean); color: var(--tour-ocean); }
.tf-help-ic {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--tour-ocean);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dash-head > div:first-child .tf-help-btn,
.page-head > div:first-child .tf-help-btn { display: inline-flex; }
.dash-head > div:first-child .tf-help-btn[hidden],
.page-head > div:first-child .tf-help-btn[hidden] { display: none; }

/* Carte « Revoir le tutoriel » de l'onglet Aide : mise en avant */
[data-tour="aide-restart"] { border: 1.5px solid #0891b2 !important; }

/* ── Mobile : bulle en bas d'écran, pleine largeur ─────── */
@media (max-width: 767px) {
  .tf-tour-tooltip {
    width: auto;
    max-width: none;
    left: 12px !important;
    right: 12px;
    top: auto !important;
    bottom: 12px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 16px 16px 14px;
    border-radius: 14px;
    transform: translateY(8px);
  }
  .tf-tour-tooltip.tf-visible { transform: none; }
  .tf-tour-tooltip.tf-center {
    top: 50% !important;
    left: 12px !important;
    right: 12px;
    bottom: auto;
    transform: translateY(calc(-50% + 8px));
  }
  .tf-tour-tooltip.tf-center.tf-visible { transform: translateY(-50%); }
  .tf-tour-arrow { display: none !important; }
  .tf-tour-title { font-size: 16px; }
  .tf-tour-desc { font-size: 13px; }
  .tf-tour-btn { min-height: 42px; padding: 10px 14px; }
  .tf-tour-reminder { left: 12px; right: 12px; bottom: 12px; width: auto; }
}

/* ── Mouvements réduits ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .tf-tour-backdrop,
  .tf-tour-spotlight,
  .tf-tour-tooltip,
  .tf-tour-reminder,
  .tf-tour-progress span,
  .tf-tour-backdrop rect.tf-mask-cut {
    transition: none !important;
  }
  .tf-tour-tooltip,
  .tf-tour-reminder { transform: none !important; }
  .tf-tour-tooltip.tf-center { transform: translate(-50%, -50%) !important; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 767px) {
  .tf-tour-tooltip.tf-center { transform: translateY(-50%) !important; }
}

/* ── Données d'exemple (affichées uniquement pendant la visite) ── */
.tf-ex-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px dashed #0891b2;
  background: rgba(8, 145, 178, 0.08);
  color: #0891b2;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
  white-space: nowrap;
  vertical-align: middle;
}
.tf-tour-ex-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--tour-track);
  font-size: 12px;
  line-height: 1.45;
  color: var(--tour-text2);
}
.tf-ex-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 12px; }
.tf-ex-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--border, #e2e8f0); }
.tf-ex-list-row { border-top: none; padding: 13px 20px; }
.tf-ex-avatar {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
  background: rgba(8, 145, 178, 0.1); color: #0891b2;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}
.tf-ex-main { flex: 1; min-width: 0; }
.tf-ex-name { font-size: 13.5px; font-weight: 600; color: var(--text1, #0f172a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-ex-sub { font-size: 11.5px; color: var(--text3, #64748b); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-ex-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.tf-ex-amount { font-size: 13px; font-weight: 700; color: var(--text1, #0f172a); }
.tf-ex-when { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--text3, #64748b); white-space: nowrap; }
.tf-ex-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.tf-ex-status { font-size: 10.5px; border: 1px solid; border-radius: 20px; padding: 1px 7px; }
.tf-ex-promo-langs { margin: 10px 0 12px; font-size: 12.5px; line-height: 1.6; color: rgba(255, 255, 255, 0.85); position: relative; z-index: 1; }
.tf-ex-promo-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.promo-dark-card .tf-ex-badge { color: #fff; border-color: rgba(255, 255, 255, 0.7); background: rgba(255, 255, 255, 0.12); }
.tf-ex-msg { padding: 0 !important; overflow: hidden; display: flex; min-height: 380px; }
.tf-ex-msg-list { width: 38%; min-width: 220px; border-right: 1px solid var(--border, #e2e8f0); }
.tf-ex-conv { padding: 12px 16px; border-top: 1px solid var(--border, #e2e8f0); border-left: 3px solid transparent; }
.tf-ex-conv.on { background: rgba(8, 145, 178, 0.08); border-left-color: #0891b2; }
.tf-ex-conv-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text1, #0f172a); }
.tf-ex-conv-top span { font-size: 11px; color: var(--text3, #64748b); }
.tf-ex-thread { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tf-ex-thread-head { display: flex; flex-direction: column; padding: 14px 16px; border-bottom: 1px solid var(--border, #e2e8f0); font-size: 13.5px; color: var(--text1, #0f172a); }
.tf-ex-bubbles { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.tf-ex-bubble { align-self: flex-start; max-width: 78%; padding: 9px 13px; border-radius: 14px; background: var(--bg, #f1f5f9); color: var(--text1, #0f172a); font-size: 13px; line-height: 1.45; }
.tf-ex-bubble.me { align-self: flex-end; background: #0891b2; color: #fff; }
.tf-ex-bubble span { display: block; margin-top: 3px; font-size: 10.5px; opacity: 0.7; }
.tf-ex-usage { background: var(--bg-card, #fff); border: 1px solid var(--border, #e2e8f0); border-radius: 16px; padding: 16px 20px; margin: 0 0 16px; }
.tf-ex-usage-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 15px; color: var(--text1, #0f172a); }
.tf-ex-usage-top strong { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tf-ex-usage-top span { font-size: 12.5px; font-weight: 700; color: #0891b2; }
.tf-ex-bar { height: 8px; border-radius: 8px; background: var(--bg, #f1f5f9); overflow: hidden; margin: 10px 0 8px; }
.tf-ex-bar span { display: block; height: 100%; background: #0891b2; border-radius: 8px; }
.tf-ex-stack { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 767px) {
  .tf-ex-msg { flex-direction: column; }
  .tf-ex-msg-list { width: auto; min-width: 0; border-right: none; border-bottom: 1px solid var(--border, #e2e8f0); }
  .tf-ex-conv:nth-child(n+3) { display: none; }
}
