/* ============================================
   sprint4-ext.css — v1.0.0 (Sprint 4, v2.49.0)
   Alerts + PushPreview + Notifs
   5 règles capitalisées appliquées (pas de transform translateY, pas de
   backdrop-filter, animation none important, etc.)
   ============================================ */

:root {
  --s4-bg-overlay: rgba(20, 32, 56, 0.92);
  --s4-bg-sheet: var(--ivoire, #F5EFE0);
  --s4-text: var(--nuit, #1A2845);
  --s4-text-soft: rgba(26, 40, 69, 0.65);
  --s4-text-muted: rgba(26, 40, 69, 0.5);
  --s4-border: var(--sable, #ECDDCB);
  --s4-accent: var(--boow, #F85558);
  --s4-success: var(--mousse, #7B9F35);
  --s4-success-soft: rgba(123, 159, 53, 0.10);
  --s4-warn: var(--terracotta, #C9622D);
  --s4-warn-soft: rgba(201, 98, 45, 0.12);
  --s4-danger-soft: rgba(248, 85, 88, 0.10);
  --s4-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   BASE OVERLAY (commun aux 3 sheets)
   ============================================ */
.alerts-overlay,
.push-preview-overlay,
.notifs-overlay {
  position: fixed;
  inset: 0;
  background: var(--s4-bg-overlay);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.24s var(--s4-ease);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: auto;
}

.alerts-overlay.is-open,
.push-preview-overlay.is-open,
.notifs-overlay.is-open {
  opacity: 1;
}

@media (min-width: 768px) {
  .alerts-overlay, .push-preview-overlay, .notifs-overlay {
    align-items: center;
  }
}

.alerts-sheet,
.push-preview-sheet,
.notifs-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  background: var(--s4-bg-sheet);
  color: var(--s4-text);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(26, 40, 69, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 1;
  animation: none !important;
  position: relative;
}

@media (min-width: 768px) {
  .alerts-sheet, .push-preview-sheet, .notifs-sheet {
    border-radius: 22px;
    max-height: 86vh;
  }
}

/* ============================================
   HEAD commun
   ============================================ */
.alerts-head, .push-preview-head, .notifs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--s4-border);
  flex-shrink: 0;
}

.alerts-eyebrow, .push-preview-eyebrow, .notifs-eyebrow {
  font-family: ui-monospace, "Geist Mono", monospace;
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--s4-text-soft);
  margin-bottom: 4px;
}

.alerts-title, .push-preview-title, .notifs-title {
  font-family: var(--font-display), "Unbounded", system-ui, sans-serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.alerts-close, .push-preview-close, .notifs-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--s4-border);
  background: transparent;
  color: var(--s4-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.16s var(--s4-ease);
}
.alerts-close:hover, .push-preview-close:hover, .notifs-close:hover {
  background: var(--s4-border);
}

/* ============================================
   ALERTS — alert cards
   ============================================ */
.alerts-body {
  overflow-y: auto;
  flex: 1;
}

.alerts-list {
  padding: 16px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--s4-border);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: background 0.16s var(--s4-ease);
}
.alert-card:hover { background: rgba(26, 40, 69, 0.03); }

.alert-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alert-card-j3 .alert-icon { background: var(--s4-danger-soft); color: var(--s4-accent); }
.alert-card-hamon .alert-icon { background: var(--s4-warn-soft); color: var(--s4-warn); }
.alert-card-engagement-end .alert-icon { background: var(--s4-success-soft); color: var(--s4-success); }

.alert-content { flex: 1; min-width: 0; }

.alert-sub-name {
  font-family: ui-monospace, "Geist Mono", monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--s4-text-muted);
  margin-bottom: 3px;
}

.alert-title {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--s4-text);
  line-height: 1.2;
}

.alert-subtitle {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--s4-text-soft);
  line-height: 1.4;
}

.alerts-foot-prose {
  padding: 14px 20px 22px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--s4-text-muted);
  text-align: center;
  border-top: 1px solid var(--s4-border);
}

/* Empty state alerts */
.alerts-empty {
  padding: 50px 30px;
  text-align: center;
}

.alerts-empty-icon {
  display: inline-flex;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--s4-success-soft);
  color: var(--s4-success);
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.alerts-empty-prose {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--s4-text-soft);
}

/* ============================================
   PUSH PREVIEW — preview cards style
   ============================================ */
.push-preview-body {
  overflow-y: auto;
  flex: 1;
  padding: 18px 20px 8px;
}

.push-preview-prose {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--s4-text-soft);
  max-width: 36ch;
}

.push-preview-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--s4-text);
  padding: 16px;
  border-radius: 14px;
}

.push-preview-card {
  background: rgba(245, 239, 224, 0.97);
  color: var(--s4-text);
  border-radius: 10px;
  padding: 11px 13px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.push-preview-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 11px;
}

.push-preview-card-icon { font-size: 14px; }

.push-preview-card-app {
  font-weight: 600;
  color: var(--s4-text);
  flex: 1;
}

.push-preview-card-time {
  color: var(--s4-text-muted);
}

.push-preview-card-title {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--s4-text);
  margin-bottom: 2px;
}

.push-preview-card-body {
  font-size: 12.5px;
  color: var(--s4-text-soft);
  line-height: 1.35;
}

.push-preview-foot {
  padding: 14px 20px 22px;
  border-top: 1px solid var(--s4-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.push-preview-btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 0;
  font: inherit;
  font-weight: 500;
  font-size: 14.5px;
  cursor: pointer;
  transition: all 0.16s var(--s4-ease);
}

.push-preview-btn-primary {
  background: var(--s4-text);
  color: var(--s4-bg-sheet);
}
.push-preview-btn-primary:hover { background: #0e1a35; }

.push-preview-btn-ghost {
  background: transparent;
  color: var(--s4-text);
  border: 1px solid var(--s4-border);
}
.push-preview-btn-ghost:hover { background: var(--s4-border); }

.push-preview-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}

.push-preview-status-ok {
  background: var(--s4-success-soft);
  color: #5a8d2e;
}

.push-preview-status-denied {
  background: var(--s4-danger-soft);
  color: #c43a3d;
}

.push-preview-help {
  margin: 0;
  font-size: 12.5px;
  color: var(--s4-text-soft);
  line-height: 1.4;
}

/* ============================================
   NOTIFS — perm banner + rules + toggles
   ============================================ */
.notifs-body {
  overflow-y: auto;
  flex: 1;
  padding: 16px 20px 22px;
}

.notifs-perm-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 18px;
}

.notifs-perm-banner-ok { background: var(--s4-success-soft); color: var(--s4-text); }
.notifs-perm-banner-ok svg { color: var(--s4-success); flex-shrink: 0; margin-top: 1px; }

.notifs-perm-banner-denied { background: var(--s4-danger-soft); color: var(--s4-text); }
.notifs-perm-banner-denied svg { color: var(--s4-accent); flex-shrink: 0; margin-top: 1px; }

.notifs-perm-banner-default { background: var(--s4-warn-soft); color: var(--s4-text); }
.notifs-perm-banner-default svg { color: var(--s4-warn); flex-shrink: 0; margin-top: 1px; }

.notifs-perm-banner > div { flex: 1; min-width: 0; }

.notifs-perm-title {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin-bottom: 2px;
}

.notifs-perm-sub {
  font-size: 12.5px;
  color: var(--s4-text-soft);
  line-height: 1.4;
}

.notifs-perm-cta {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  border: 0;
  background: var(--s4-warn);
  color: var(--s4-bg-sheet);
  font: inherit;
  font-family: ui-monospace, "Geist Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: background 0.16s var(--s4-ease);
}
.notifs-perm-cta:hover { background: #b0561d; }

.notifs-section-head {
  font-family: ui-monospace, "Geist Mono", monospace;
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--s4-text-soft);
  margin: 4px 0 10px;
}

.notifs-rules-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--s4-border);
  border-radius: 12px;
  overflow: hidden;
}

.notifs-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--s4-border);
  transition: background 0.16s var(--s4-ease);
}

.notifs-rule:last-child { border-bottom: 0; }
.notifs-rule:hover { background: rgba(26, 40, 69, 0.02); }

.notifs-rule-text { flex: 1; min-width: 0; }

.notifs-rule-label {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--s4-text);
  margin-bottom: 3px;
}

.notifs-rule-sub {
  font-size: 12.5px;
  color: var(--s4-text-soft);
  line-height: 1.4;
}

/* Toggle switch */
.notifs-toggle {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 0;
  background: rgba(26, 40, 69, 0.18);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.18s var(--s4-ease);
}

.notifs-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--s4-bg-sheet);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.18s var(--s4-ease);
}

.notifs-toggle.is-on {
  background: var(--s4-success);
}

.notifs-toggle.is-on .notifs-toggle-thumb {
  transform: translateX(18px);
}

.notifs-test-btn {
  width: 100%;
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--s4-border);
  background: transparent;
  color: var(--s4-text);
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.16s var(--s4-ease);
}
.notifs-test-btn:hover { background: var(--s4-border); }

/* ============================================
   prefers-reduced-motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .alerts-sheet, .push-preview-sheet, .notifs-sheet,
  .alerts-overlay, .push-preview-overlay, .notifs-overlay,
  .notifs-toggle-thumb, .notifs-toggle {
    animation: none !important;
    transition: none !important;
  }
}
