/* ============================================================================
   WEBINAR MODAL — Modale d'annonce webinaire (metropole-lyon uniquement)
   Namespace : .wm-* (webinar modal)
   Design : pattern exact cs-overlay / glassmorphism du design system
   z-index : 9500 (sous les toasts à 9999, au-dessus de tout le reste)
   ============================================================================ */

/* ── Overlay ───────────────────────────────────────────────────────────── */

.wm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition:
    background 380ms ease,
    backdrop-filter 380ms ease;
  pointer-events: none;
}

.wm-overlay.wm-visible {
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  pointer-events: auto;
}

.wm-overlay[hidden] { display: none; }

/* ── Panel ─────────────────────────────────────────────────────────────── */

.wm-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface-base) 94%, transparent);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-light);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 8px 28px rgba(0, 0, 0, 0.10),
    0 32px 80px rgba(0, 0, 0, 0.16),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.95);
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  transition:
    opacity 400ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 440ms cubic-bezier(0.16, 1, 0.3, 1);
}

.wm-overlay.wm-visible .wm-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Ligne d'accent primary en haut du panel */
.wm-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--primary-alpha-45) 20%,
    var(--primary) 50%,
    var(--primary-alpha-45) 80%,
    transparent 100%
  );
}

/* ── Bouton fermer ─────────────────────────────────────────────────────── */

.wm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--primary-alpha-12);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
}

.wm-close:hover {
  background: var(--primary-alpha-25);
  color: var(--primary);
  transform: scale(1.12) rotate(90deg);
}

/* ── Body ──────────────────────────────────────────────────────────────── */

.wm-body {
  padding: 36px 32px 28px;
}

/* ── Eyebrow ───────────────────────────────────────────────────────────── */

.wm-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
}

/* ── Titre ─────────────────────────────────────────────────────────────── */

.wm-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--text-primary);
  margin: 0 0 10px;
}

/* ── Description ───────────────────────────────────────────────────────── */

.wm-desc {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 24px;
}

.wm-desc strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Date badge ────────────────────────────────────────────────────────── */

.wm-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-alpha-12);
  border: 1px solid var(--primary-alpha-35);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 20px;
}

/* ── Actions ───────────────────────────────────────────────────────────── */

.wm-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 700;
  padding: 13px 20px;
  border-radius: 14px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.18s ease;
}

.wm-btn:hover  { transform: translateY(-1px) scale(1.02); }
.wm-btn:active { transform: scale(0.98); transition-duration: 80ms; }

.wm-btn--primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 14px var(--primary-alpha-35);
}

.wm-btn--primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 6px 20px var(--primary-alpha-45);
}

.wm-btn--secondary {
  color: var(--primary);
  background: var(--primary-alpha-12);
  border-color: var(--primary-alpha-35);
}

.wm-btn--secondary:hover {
  background: var(--primary-alpha-25);
  box-shadow: 0 2px 8px var(--primary-alpha-18);
}

/* ── Lien "plus tard" ──────────────────────────────────────────────────── */

.wm-footer {
  margin-top: 14px;
  text-align: center;
}

.wm-dismiss {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.wm-dismiss:hover {
  color: var(--text-secondary);
  background: var(--primary-alpha-12);
}

/* ── Dark mode — tout automatique via alias sémantiques ──────────────── */

[data-theme="dark"] .wm-panel {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 8px 28px rgba(0, 0, 0, 0.40),
    0 32px 80px rgba(0, 0, 0, 0.50),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* ── Responsive mobile — bottom sheet ─────────────────────────────────── */

@media (max-width: 540px) {
  .wm-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .wm-panel {
    border-radius: 24px 24px 0 0;
    max-width: 100%;
    transform: translateY(100%);
  }

  .wm-overlay.wm-visible .wm-panel {
    transform: translateY(0);
  }

  .wm-body {
    padding: 28px 20px 24px;
  }
}
