/* ==========================================================================
   Lucide — Bandeau de consentement cookies (CNIL/RGPD)
   Calé sur le Kit UI 5a (accent #6d5cf6, Inter, radius 16, thème clair).
   Aucune dépendance externe. Tout est préfixé .lc- pour éviter les collisions.
   ========================================================================== */

.lc-root {
  --lc-accent: var(--accent, #6d5cf6);
  --lc-accent-ink: #ffffff;
  --lc-ink: var(--ink, #20242e);
  --lc-muted: var(--muted, #6f7480);
  --lc-surface: var(--surface, #ffffff);
  --lc-border: var(--border, #ede9dc);
  --lc-radius: var(--radius, 16px);
  --lc-shadow: 0 24px 60px -28px rgba(35, 40, 55, 0.45);
  --lc-body: var(--body, "Inter", system-ui, -apple-system, "Segoe UI", sans-serif);
}

/* --- Voile (uniquement quand le panneau détaillé est ouvert) --------------- */
.lc-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: rgba(20, 24, 30, 0.42);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.lc-overlay.lc-open { opacity: 1; visibility: visible; }

/* --- Conteneur bas de page ------------------------------------------------- */
.lc-dialog {
  position: fixed;
  z-index: 2147483001;
  left: 50%;
  bottom: clamp(12px, 3vw, 28px);
  transform: translateX(-50%) translateY(16px);
  width: min(680px, calc(100vw - 24px));
  box-sizing: border-box;
  background: var(--lc-surface);
  color: var(--lc-ink);
  border: 1px solid var(--lc-border);
  border-radius: var(--lc-radius);
  box-shadow: var(--lc-shadow);
  font-family: var(--lc-body);
  padding: 22px 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}
.lc-dialog.lc-open { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.lc-dialog * { box-sizing: border-box; }

/* !important : neutralise les styles de titre (h2) de la page hôte qui fuiteraient. */
.lc-title {
  margin: 0 0 8px !important;
  font-family: var(--lc-body) !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.01em !important;
  color: var(--lc-ink) !important;
  text-transform: none !important;
}
.lc-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--lc-muted);
}
.lc-text a { color: var(--lc-accent); text-decoration: underline; text-underline-offset: 2px; }

/* --- Boutons --------------------------------------------------------------- */
.lc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.lc-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 11px 20px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
  line-height: 1;
}
.lc-btn:active { transform: translateY(1px); }
.lc-btn:focus-visible { outline: 2px solid var(--lc-accent); outline-offset: 2px; }

/* Accepter et Refuser = MÊME poids visuel (exigence CNIL) */
.lc-btn--primary {
  background: var(--lc-accent);
  color: var(--lc-accent-ink);
  flex: 1 1 auto;
}
.lc-btn--primary:hover { background: #5b4be0; }
.lc-btn--secondary {
  background: var(--lc-surface);
  color: var(--lc-ink);
  border-color: var(--lc-border);
  flex: 1 1 auto;
}
.lc-btn--secondary:hover { border-color: var(--lc-ink); }
.lc-btn--ghost {
  background: transparent;
  color: var(--lc-muted);
  padding: 11px 12px;
  flex: 0 0 auto;
}
.lc-btn--ghost:hover { color: var(--lc-ink); }

/* --- Panneau détaillé (catégories) ---------------------------------------- */
.lc-panel { display: none; margin-top: 16px; }
.lc-dialog.lc-detailed .lc-panel { display: block; }
.lc-dialog.lc-detailed { width: min(560px, calc(100vw - 24px)); }

.lc-cat {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--lc-border);
}
.lc-cat-body { flex: 1 1 auto; }
.lc-cat-name { margin: 0 0 3px; font-size: 0.9rem; font-weight: 700; }
.lc-cat-desc { margin: 0; font-size: 0.82rem; line-height: 1.5; color: var(--lc-muted); }

/* Interrupteur */
.lc-switch { position: relative; flex: 0 0 auto; width: 42px; height: 24px; margin-top: 2px; }
.lc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.lc-slider {
  position: absolute; inset: 0;
  background: #cdd2da;
  border-radius: 999px;
  transition: background 0.18s ease;
  pointer-events: none;
}
.lc-slider::before {
  content: ""; position: absolute;
  height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.lc-switch input:checked + .lc-slider { background: var(--lc-accent); }
.lc-switch input:checked + .lc-slider::before { transform: translateX(18px); }
.lc-switch input:disabled { cursor: not-allowed; }
.lc-switch input:disabled + .lc-slider { background: var(--lc-accent); opacity: 0.45; }
.lc-switch input:focus-visible + .lc-slider { outline: 2px solid var(--lc-accent); outline-offset: 2px; }

/* --- Pastille de réouverture (après un choix) ----------------------------- */
.lc-reopen {
  position: fixed;
  z-index: 2147482000;
  left: 16px;
  bottom: 16px;
  display: none;
  align-items: center;
  gap: 7px;
  background: var(--lc-surface);
  color: var(--lc-muted);
  border: 1px solid var(--lc-border);
  border-radius: 999px;
  box-shadow: 0 6px 18px -10px rgba(35, 40, 55, 0.4);
  font-family: var(--lc-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
}
.lc-reopen.lc-visible { display: inline-flex; }
.lc-reopen:hover { color: var(--lc-ink); border-color: var(--lc-ink); }
.lc-reopen svg { width: 15px; height: 15px; }

/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 520px) {
  .lc-dialog { padding: 18px 18px; bottom: 8px; }
  .lc-btn--primary, .lc-btn--secondary { flex: 1 1 100%; }
  .lc-btn--ghost { flex: 1 1 100%; text-align: center; }
  .lc-reopen span { display: none; }
  .lc-reopen { padding: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .lc-dialog, .lc-overlay, .lc-slider, .lc-slider::before { transition: none; }
}
