/* Modale tutoriel — charte CMQ (primary Elementor, cartes blanches, ombres header). */

html.cmq-tutorial-open {
  overflow: hidden;
}

.cmq-tutorial {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.cmq-tutorial[hidden] {
  display: none !important;
}

.cmq-tutorial__overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 40, 50, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.cmq-tutorial__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 0 20px 0 rgba(97, 127, 153, 0.18);
  padding: 32px 28px 24px;
  font-family: var(--e-global-typography-text-font-family), Sans-serif;
  color: #5e5e5e;
}

/* Réinitialisation des boutons Elementor / thème dans la modale */
.cmq-tutorial button {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  min-height: unset;
  width: auto;
  text-decoration: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  box-shadow: none;
}

.cmq-tutorial__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none !important;
  border-radius: 50% !important;
  background: #f3f5f7 !important;
  background-color: #f3f5f7 !important;
  color: var(--e-global-color-primary) !important;
  font-size: 22px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.cmq-tutorial__close:hover,
.cmq-tutorial__close:focus {
  background: #e8ecef !important;
  background-color: #e8ecef !important;
  color: var(--e-global-color-primary) !important;
  transform: scale(0.98);
}

.cmq-tutorial__eyebrow {
  margin: 0 0 8px;
  font-family: var(--e-global-typography-accent-font-family), Sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--e-global-color-primary);
}

.cmq-tutorial__title {
  margin: 0 0 12px;
  padding-right: 28px;
  font-family: var(--e-global-typography-primary-font-family), Sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--e-global-color-primary);
}

.cmq-tutorial__body {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: #5e5e5e;
}

.cmq-tutorial__slides {
  min-height: 120px;
}

.cmq-tutorial__slide:not(.is-active) {
  display: none;
}

.cmq-tutorial__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 20px;
}

.cmq-tutorial__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(97, 127, 153, 0.25);
  transition: background 0.2s ease, transform 0.2s ease;
}

.cmq-tutorial__dot.is-active {
  background: var(--e-global-color-primary);
  transform: scale(1.15);
}

.cmq-tutorial__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cmq-tutorial__nav {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.cmq-tutorial .cmq-tutorial__btn,
.cmq-tutorial button.cmq-tutorial__btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: var(--e-global-typography-accent-font-family), Sans-serif !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  padding: 12px 24px !important;
  border-radius: 30px !important;
  border-width: 1px !important;
  border-style: solid !important;
  cursor: pointer !important;
  transition:
    background 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease !important;
}

.cmq-tutorial .cmq-tutorial__btn--ghost,
.cmq-tutorial button.cmq-tutorial__btn--ghost {
  background: transparent !important;
  background-color: transparent !important;
  color: #5e5e5e !important;
  border-color: transparent !important;
  padding-left: 0 !important;
  box-shadow: none !important;
}

.cmq-tutorial .cmq-tutorial__btn--ghost:hover,
.cmq-tutorial .cmq-tutorial__btn--ghost:focus,
.cmq-tutorial button.cmq-tutorial__btn--ghost:hover,
.cmq-tutorial button.cmq-tutorial__btn--ghost:focus {
  background: transparent !important;
  background-color: transparent !important;
  color: var(--e-global-color-primary) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.cmq-tutorial .cmq-tutorial__btn--secondary,
.cmq-tutorial button.cmq-tutorial__btn--secondary {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: var(--e-global-color-primary) !important;
  border-color: var(--e-global-color-primary) !important;
  box-shadow: none !important;
}

.cmq-tutorial .cmq-tutorial__btn--secondary:hover,
.cmq-tutorial .cmq-tutorial__btn--secondary:focus,
.cmq-tutorial button.cmq-tutorial__btn--secondary:hover,
.cmq-tutorial button.cmq-tutorial__btn--secondary:focus {
  background: color-mix(in srgb, var(--e-global-color-primary) 8%, #ffffff) !important;
  background-color: color-mix(in srgb, var(--e-global-color-primary) 8%, #ffffff) !important;
  color: var(--e-global-color-primary) !important;
  border-color: var(--e-global-color-primary) !important;
}

.cmq-tutorial .cmq-tutorial__btn--primary,
.cmq-tutorial button.cmq-tutorial__btn--primary {
  background: var(--e-global-color-primary) !important;
  background-color: var(--e-global-color-primary) !important;
  color: #ffffff !important;
  border-color: var(--e-global-color-primary) !important;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--e-global-color-primary) 20%, transparent) !important;
}

.cmq-tutorial .cmq-tutorial__btn--primary:hover,
.cmq-tutorial .cmq-tutorial__btn--primary:focus,
.cmq-tutorial button.cmq-tutorial__btn--primary:hover,
.cmq-tutorial button.cmq-tutorial__btn--primary:focus {
  background: transparent !important;
  background-color: transparent !important;
  color: var(--e-global-color-primary) !important;
  border-color: var(--e-global-color-primary) !important;
  transform: scale(1.02);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--e-global-color-primary) 28%, transparent) !important;
}

@supports not (background: color-mix(in srgb, red 50%, white)) {
  .cmq-tutorial .cmq-tutorial__btn--primary,
  .cmq-tutorial button.cmq-tutorial__btn--primary {
    box-shadow: 0 2px 8px rgba(97, 127, 153, 0.2) !important;
  }

  .cmq-tutorial .cmq-tutorial__btn--primary:hover,
  .cmq-tutorial .cmq-tutorial__btn--primary:focus,
  .cmq-tutorial button.cmq-tutorial__btn--primary:hover,
  .cmq-tutorial button.cmq-tutorial__btn--primary:focus {
    box-shadow: 0 4px 12px rgba(97, 127, 153, 0.28) !important;
  }

  .cmq-tutorial .cmq-tutorial__btn--secondary:hover,
  .cmq-tutorial .cmq-tutorial__btn--secondary:focus,
  .cmq-tutorial button.cmq-tutorial__btn--secondary:hover,
  .cmq-tutorial button.cmq-tutorial__btn--secondary:focus {
    background: #e8ecef !important;
    background-color: #e8ecef !important;
  }
}

@media (max-width: 480px) {
  .cmq-tutorial__dialog {
    padding: 28px 20px 20px;
  }

  .cmq-tutorial__title {
    font-size: 20px;
  }

  .cmq-tutorial__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .cmq-tutorial__nav {
    width: 100%;
    margin-left: 0;
  }

  .cmq-tutorial__nav .cmq-tutorial__btn {
    flex: 1;
    text-align: center;
  }

  .cmq-tutorial__btn--ghost {
    order: 2;
    text-align: center;
    padding: 8px;
  }
}
