/* ============================================================
   POPUP ALTERNANCE — Neo-Brutalist Warm Grid
   ============================================================ */

/* ── Overlay ─────────────────────────────────────────────── */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.65);
  backdrop-filter: blur(4px);
  z-index: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.popup-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Popup wrapper ────────────────────────────────────────── */
.popup-alternance {
  position: fixed;
  bottom: clamp(20px, 4vw, 40px);
  right:  clamp(16px, 4vw, 48px);
  z-index: 801;
  width: min(400px, calc(100vw - 32px));
  transform: translateY(20px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1),
              opacity   0.35s cubic-bezier(0.25, 1, 0.5, 1);
}
.popup-alternance.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}
.popup-alternance[aria-hidden="true"] {
  display: none;
}

/* ── Card ─────────────────────────────────────────────────── */
.popup__card {
  background: var(--cream);
  border: var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Bande accent latérale gauche */
.popup__card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--cyan);
  flex-shrink: 0;
}

/* ── Header ───────────────────────────────────────────────── */
.popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 14px 22px;
  border-bottom: var(--border);
  background: var(--ink);
}

.popup__tag {
  font-family: var(--ff-mono);
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes popupPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

.popup__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 240, 229, 0.2);
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.popup__close:hover {
  background: rgba(255, 240, 229, 0.1);
  border-color: rgba(255, 240, 229, 0.4);
}
.popup__close:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

/* ── Body ─────────────────────────────────────────────────── */
.popup__body-wrap {
  padding: 20px 20px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popup__title {
  font-family: var(--ff-display);
  font-size: clamp(1.3rem, 3.5vw, 1.65rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.0;
  color: var(--ink);
}

.popup__body {
  font-family: var(--ff-body);
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.65;
}

/* ── Stats rapides ────────────────────────────────────────── */
.popup__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: var(--border);
  background: var(--cream-2);
  box-shadow: var(--shadow-sm);
}

.popup__stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-right: var(--border);
}
.popup__stat:last-child { border-right: none; }

.popup__stat-value {
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}

.popup__stat-label {
  font-family: var(--ff-mono);
  font-size: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  line-height: 1.3;
}

/* ── Footer ───────────────────────────────────────────────── */
.popup__footer {
  padding: 14px 20px 14px 22px;
  border-top: var(--border);
  background: var(--cream-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.popup__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cream);
  background: var(--ink);
  border: var(--border);
  padding: 10px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, gap 0.15s;
  white-space: nowrap;
}
.popup__cta:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-md);
  gap: 12px;
}
.popup__cta:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

/* Indicateurs de message (dots) */
.popup__dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.popup__dot {
  width: 6px;
  height: 6px;
  background: rgba(26, 26, 26, 0.2);
  border: 1px solid var(--ink);
  transition: background 0.2s;
}
.popup__dot--active {
  background: var(--ink);
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .popup-alternance,
  .popup-overlay {
    transition: none;
  }
  .popup__tag::before {
    animation: none;
  }
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  .popup-alternance {
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: auto;
  }
}
