/* ==========================================================================
   Senolo — Tutoriel guidé : popovers, invite modal, mobile-friendly
   Charte : bleu Senolo #0e58a4, doux, lisible pour seniors
   ========================================================================== */

/* ---- Modal d'invitation ("Voulez-vous suivre le tour ?") ---------------- */
.senolo-tuto-invite-overlay {
  position: fixed; inset: 0;
  background: rgba(14, 88, 164, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100000;
  padding: 1.25rem;
  animation: senoloTutoFadeIn .25s ease-out;
}

.senolo-tuto-invite {
  background: #ffffff;
  border-radius: 24px;
  padding: 2rem 1.75rem 1.75rem;
  max-width: 460px; width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(14, 88, 164, 0.35), 0 0 0 1px rgba(14, 88, 164, 0.08);
  animation: senoloTutoPop .35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.senolo-tuto-invite-emoji {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 0.75rem;
  animation: senoloTutoBounce 1.5s ease-in-out infinite;
}

.senolo-tuto-invite-title {
  color: #0e58a4;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  line-height: 1.25;
}

.senolo-tuto-invite-text {
  color: #374151;
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 0 0 1.75rem;
}

.senolo-tuto-invite-actions {
  display: flex; gap: 0.75rem;
  flex-wrap: wrap; justify-content: center;
}

.senolo-tuto-btn {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.85rem 1.5rem;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  min-height: 48px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  flex: 1 1 auto;
  min-width: 140px;
}

.senolo-tuto-btn-primary {
  background: linear-gradient(135deg, #0e58a4 0%, #1a76d2 100%);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(14, 88, 164, 0.35);
}
.senolo-tuto-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(14, 88, 164, 0.45); }
.senolo-tuto-btn-primary:active { transform: translateY(0); }
.senolo-tuto-btn-primary:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(14, 88, 164, 0.5);
}

.senolo-tuto-btn-ghost { background: #f3f4f6; color: #374151; }
.senolo-tuto-btn-ghost:hover { background: #e5e7eb; }
.senolo-tuto-btn-ghost:focus-visible {
  outline: 2px solid #9ca3af;
  outline-offset: 2px;
}

/* ==========================================================================
   Popovers driver.js (overrides charte Senolo)
   ========================================================================== */

.senolo-tuto-popover.driver-popover {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(14, 88, 164, 0.32), 0 0 0 1px rgba(14, 88, 164, 0.06);
  border: none;
  padding: 1.5rem 1.5rem 1.25rem;
  max-width: 380px;
  font-family: inherit;
  animation: senoloTutoPop .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.senolo-tuto-popover .driver-popover-title {
  color: #0e58a4;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
  line-height: 1.3;
  padding-right: 1.5rem; /* place pour la croix */
}

.senolo-tuto-popover .driver-popover-description {
  color: #374151;
  font-size: 1.02rem;
  line-height: 1.6;
  margin-bottom: 1.1rem;
}

.senolo-tuto-popover .driver-popover-description strong {
  color: #0e58a4;
  font-weight: 700;
}

/* ---- Footer (progress + boutons) ---------------------------------------- */
.senolo-tuto-popover .driver-popover-footer {
  margin-top: 0.5rem;
  gap: 0.6rem;
  align-items: center;
}

.senolo-tuto-popover .driver-popover-progress-text {
  color: #0e58a4;
  font-weight: 600;
  font-size: 0.85rem;
  background: rgba(14, 88, 164, 0.09);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}

.senolo-tuto-popover .driver-popover-navigation-btns {
  gap: 0.5rem;
  flex: 1;
  justify-content: flex-end;
}

/* ---- Boutons Suivant / Précédent --------------------------------------- */
.senolo-tuto-popover .driver-popover-prev-btn,
.senolo-tuto-popover .driver-popover-next-btn {
  font-family: inherit !important;
  font-weight: 600 !important;
  border-radius: 12px !important;
  padding: 0.7rem 1.2rem !important;
  border: none !important;
  text-shadow: none !important;
  font-size: 0.98rem !important;
  min-height: 44px !important;
  cursor: pointer !important;
  transition: background .15s ease, transform .12s ease, box-shadow .15s ease !important;
  outline: none !important;
}

.senolo-tuto-popover .driver-popover-next-btn {
  background: linear-gradient(135deg, #0e58a4 0%, #1a76d2 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(14, 88, 164, 0.35) !important;
}
.senolo-tuto-popover .driver-popover-next-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(14, 88, 164, 0.45) !important;
}

/* Focus visible : ring bleu doux autour du bouton "Suivant/Terminer" */
.senolo-tuto-popover .driver-popover-next-btn:focus,
.senolo-tuto-popover .driver-popover-next-btn:focus-visible {
  box-shadow: 0 4px 12px rgba(14, 88, 164, 0.35), 0 0 0 4px rgba(14, 88, 164, 0.25) !important;
}

.senolo-tuto-popover .driver-popover-prev-btn {
  background: #f3f4f6 !important;
  color: #374151 !important;
}
.senolo-tuto-popover .driver-popover-prev-btn:hover { background: #e5e7eb !important; }
.senolo-tuto-popover .driver-popover-prev-btn:focus,
.senolo-tuto-popover .driver-popover-prev-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.5) !important;
}

/* ---- Croix de fermeture : DISCRÈTE, pas de halo ------------------------ */
.senolo-tuto-popover .driver-popover-close-btn {
  position: absolute !important;
  top: 0.65rem !important;
  right: 0.65rem !important;
  background: transparent !important;
  color: #9ca3af !important;
  font-size: 1.5rem !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  outline: none !important;
  box-shadow: none !important;
  transition: color .15s ease, background .15s ease !important;
  text-shadow: none !important;
}
.senolo-tuto-popover .driver-popover-close-btn:hover {
  color: #0e58a4 !important;
  background: rgba(14, 88, 164, 0.08) !important;
}
.senolo-tuto-popover .driver-popover-close-btn:focus,
.senolo-tuto-popover .driver-popover-close-btn:focus-visible,
.senolo-tuto-popover .driver-popover-close-btn:active {
  outline: none !important;
  box-shadow: none !important;
  color: #0e58a4 !important;
  background: rgba(14, 88, 164, 0.08) !important;
}

/* ---- Flèche du popover ------------------------------------------------- */
.senolo-tuto-popover .driver-popover-arrow {
  border-color: transparent !important;
}
.senolo-tuto-popover.driver-popover-arrow-side-bottom .driver-popover-arrow { border-bottom-color: #ffffff !important; }
.senolo-tuto-popover.driver-popover-arrow-side-top    .driver-popover-arrow { border-top-color:    #ffffff !important; }
.senolo-tuto-popover.driver-popover-arrow-side-left   .driver-popover-arrow { border-left-color:   #ffffff !important; }
.senolo-tuto-popover.driver-popover-arrow-side-right  .driver-popover-arrow { border-right-color:  #ffffff !important; }

/* ---- Stage : halo doux + pulse autour de l'élément highlight ----------- */
.driver-active-element,
.driver-active-element * {
  pointer-events: auto !important;
}

.driver-stage {
  border-radius: 16px !important;
  animation: senoloTutoStagePulse 2.4s ease-in-out infinite;
}

/* ==========================================================================
   Mobile : popovers prennent toute la largeur, boutons plus gros
   ========================================================================== */
@media (max-width: 768px) {
  .senolo-tuto-invite {
    padding: 1.5rem 1.25rem 1.25rem;
    border-radius: 20px;
  }
  .senolo-tuto-invite-title { font-size: 1.35rem; }
  .senolo-tuto-invite-text { font-size: 1rem; }
  .senolo-tuto-invite-emoji { font-size: 3rem; }

  .senolo-tuto-popover.driver-popover {
    max-width: calc(100vw - 24px);
    width: calc(100vw - 24px);
    margin: 0 12px;
    padding: 1.25rem 1.15rem 1rem;
    border-radius: 18px;
  }
  .senolo-tuto-popover .driver-popover-title { font-size: 1.15rem; padding-right: 2rem; }
  .senolo-tuto-popover .driver-popover-description { font-size: 0.97rem; }

  .senolo-tuto-popover .driver-popover-prev-btn,
  .senolo-tuto-popover .driver-popover-next-btn {
    flex: 1;
    text-align: center;
    padding: 0.8rem 0.9rem !important;
  }

  .senolo-tuto-popover .driver-popover-progress-text {
    font-size: 0.78rem;
    padding: 0.25rem 0.55rem;
  }

  .senolo-tuto-btn { font-size: 1rem; padding: 0.85rem 1rem; }
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes senoloTutoFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes senoloTutoPop {
  0%   { opacity: 0; transform: scale(0.9) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes senoloTutoBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@keyframes senoloTutoStagePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.0); }
  50%      { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.25); }
}

/* Respecte les préférences d'animation réduite */
@media (prefers-reduced-motion: reduce) {
  .senolo-tuto-invite-emoji,
  .driver-stage,
  .senolo-tuto-invite,
  .senolo-tuto-popover.driver-popover { animation: none !important; }
}
