/* ══════════════════════════════════════════════
   Cash Explorer — Cookie Consent (CNIL/RGPD)
   Bannière bottom-fixed + modal de personnalisation.
   Cohérent avec la palette vert Cash Explorer (style.css).
══════════════════════════════════════════════ */

/* ── Bannière ── */
.ce-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99998;
  background: rgba(10, 10, 10, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--green-border, rgba(22, 163, 74, 0.35));
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  color: var(--white, #f5f5f5);
  animation: ce-cookie-slide-up 0.3s ease-out;
}

@keyframes ce-cookie-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.ce-cookie-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.ce-cookie-banner-text {
  flex: 1 1 360px;
  min-width: 0;
}

.ce-cookie-banner-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--white, #f5f5f5);
}

.ce-cookie-banner-text p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted2, #a0a0a0);
}

.ce-cookie-banner-text a {
  color: var(--green-l, #22c55e);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ce-cookie-banner-text a:hover {
  color: #fff;
}

.ce-cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Boutons ── */
.ce-cookie-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  font-family: inherit;
}

.ce-cookie-btn:active {
  transform: scale(0.97);
}

.ce-cookie-btn-accept {
  background: var(--green-l, #22c55e);
  color: #0a0a0a;
}
.ce-cookie-btn-accept:hover {
  background: #16a34a;
}

.ce-cookie-btn-reject {
  background: transparent;
  color: var(--white, #f5f5f5);
  border-color: rgba(255, 255, 255, 0.18);
}
.ce-cookie-btn-reject:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.04);
}

.ce-cookie-btn-customize,
.ce-cookie-btn-save {
  background: transparent;
  color: var(--green-l, #22c55e);
  border-color: var(--green-border, rgba(22, 163, 74, 0.35));
}
.ce-cookie-btn-customize:hover,
.ce-cookie-btn-save:hover {
  background: var(--green-dim, rgba(22, 163, 74, 0.12));
  border-color: var(--green-l, #22c55e);
}

/* ── Modal ── */
.ce-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: ce-cookie-fade-in 0.2s ease-out;
}

@keyframes ce-cookie-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ce-cookie-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ce-cookie-modal-panel {
  position: relative;
  background: var(--card, #141414);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  color: var(--white, #f5f5f5);
}

.ce-cookie-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.ce-cookie-modal-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--white, #f5f5f5);
}

.ce-cookie-modal-close {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--muted2, #a0a0a0);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}
.ce-cookie-modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.ce-cookie-modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted2, #a0a0a0);
}

.ce-cookie-modal-body > p:first-child {
  margin: 0 0 18px;
}

.ce-cookie-category {
  background: var(--card2, #1a1a1a);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.ce-cookie-category:last-child {
  margin-bottom: 0;
}

.ce-cookie-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ce-cookie-category-head strong {
  color: var(--white, #f5f5f5);
  font-size: 14px;
  font-weight: 600;
}

.ce-cookie-category-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--green-l, #22c55e);
  background: var(--green-dim, rgba(22, 163, 74, 0.12));
  border: 1px solid var(--green-border, rgba(22, 163, 74, 0.35));
  padding: 2px 8px;
  border-radius: 999px;
}

.ce-cookie-category-sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted, #666);
  margin-top: 2px;
}

.ce-cookie-category p {
  margin: 0;
  font-size: 12px;
  color: var(--muted2, #a0a0a0);
}

/* ── Switch ── */
.ce-cookie-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.ce-cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ce-cookie-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.ce-cookie-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.ce-cookie-switch input:checked + .ce-cookie-slider {
  background: var(--green-l, #22c55e);
}

.ce-cookie-switch input:checked + .ce-cookie-slider::before {
  transform: translateX(20px);
}

.ce-cookie-switch input:focus-visible + .ce-cookie-slider {
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.4);
}

.ce-cookie-modal-footer {
  display: flex;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  flex-wrap: wrap;
}

.ce-cookie-modal-footer .ce-cookie-btn {
  flex: 1 1 130px;
}

/* ── Responsive mobile ── */
@media (max-width: 640px) {
  .ce-cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
  }
  .ce-cookie-banner-actions {
    justify-content: stretch;
  }
  .ce-cookie-banner-actions .ce-cookie-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 12px;
    font-size: 12.5px;
  }
  .ce-cookie-modal {
    padding: 0;
    align-items: flex-end;
  }
  .ce-cookie-modal-panel {
    max-width: 100%;
    max-height: 94vh;
    border-radius: 16px 16px 0 0;
  }
  .ce-cookie-modal-footer .ce-cookie-btn {
    flex: 1 1 100%;
  }
}
