/* Cafetier Academy — Cookie consent UI
 * Bannière + modale premium, responsive, accessible.
 * Couleurs alignées sur la marque (bleu navy + or). */

:root {
  --cc-navy: #071B34;
  --cc-navy-2: #0E2444;
  --cc-gold: #D4A64A;
  --cc-gold-3: #B88A2E;
  --cc-text: #18212F;
  --cc-text-soft: #5B6472;
  --cc-line: #E5E8ED;
  --cc-bg-app: #F7F8FA;
}

/* ─── Bannière ─── */
.cc-banner {
  position: fixed;
  z-index: 9998;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 920px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--cc-line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(7, 27, 52, 0.18);
  padding: 22px 26px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
  color: var(--cc-text);
  animation: cc-slide-up 0.32s ease-out;
}
.cc-banner.cc-show { display: flex; }
.cc-banner-text {
  flex: 1;
  min-width: 0;
}
.cc-banner-title {
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--cc-text);
}
.cc-banner-title::before {
  content: '🍪';
  font-size: 16px;
  filter: saturate(1.2);
}
.cc-banner-text p {
  margin: 0;
  font-size: 13px;
  color: var(--cc-text-soft);
  line-height: 1.55;
}
.cc-banner-text a {
  color: var(--cc-gold-3);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cc-banner-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}
.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.14s, box-shadow 0.18s, background 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
  line-height: 1;
}
.cc-btn:focus-visible {
  outline: 2px solid var(--cc-gold);
  outline-offset: 2px;
}
.cc-btn-primary {
  background: linear-gradient(135deg, var(--cc-gold), var(--cc-gold-3));
  color: var(--cc-navy);
}
.cc-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(212, 166, 74, 0.32);
}
.cc-btn-ghost {
  background: var(--cc-bg-app);
  color: var(--cc-text);
  border-color: var(--cc-line);
}
.cc-btn-ghost:hover {
  border-color: var(--cc-gold);
  color: var(--cc-gold-3);
}
.cc-btn-link {
  background: transparent;
  color: var(--cc-text);
  border: 0;
  font-weight: 700;
  padding: 11px 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cc-btn-link:hover {
  color: var(--cc-gold-3);
}

/* ─── Modale ─── */
.cc-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(7, 27, 52, 0.55);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: cc-fade-in 0.2s ease-out;
}
.cc-overlay.cc-show { display: flex; }

.cc-modal {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(7, 27, 52, 0.30);
  max-width: 640px;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
  color: var(--cc-text);
  animation: cc-slide-up 0.28s ease-out;
}
.cc-modal-head {
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--cc-line);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  justify-content: space-between;
}
.cc-modal-head h2 {
  font-size: 18px;
  font-weight: 900;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.cc-modal-head p {
  font-size: 13px;
  color: var(--cc-text-soft);
  margin: 0;
  line-height: 1.55;
}
.cc-modal-close {
  background: transparent;
  border: 0;
  font-size: 22px;
  color: var(--cc-text-soft);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1;
}
.cc-modal-close:hover { background: var(--cc-bg-app); color: var(--cc-text); }
.cc-modal-close:focus-visible { outline: 2px solid var(--cc-gold); outline-offset: 2px; }

.cc-modal-body {
  padding: 18px 28px 8px;
  overflow-y: auto;
  flex: 1;
}

.cc-cat {
  padding: 14px 0;
  border-bottom: 1px solid var(--cc-line);
}
.cc-cat:last-child { border-bottom: 0; }
.cc-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 6px;
}
.cc-cat-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--cc-text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cc-cat-required {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(21, 169, 104, 0.10);
  color: #047857;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cc-cat-desc {
  font-size: 12.5px;
  color: var(--cc-text-soft);
  line-height: 1.6;
  margin: 0;
}

/* Toggle switch */
.cc-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.cc-toggle input { opacity: 0; width: 0; height: 0; }
.cc-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #C7CDD6;
  border-radius: 999px;
  transition: background 0.2s;
}
.cc-toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.cc-toggle input:checked + .cc-toggle-slider {
  background: linear-gradient(135deg, var(--cc-gold), var(--cc-gold-3));
}
.cc-toggle input:checked + .cc-toggle-slider::before {
  transform: translateX(20px);
}
.cc-toggle input:disabled + .cc-toggle-slider {
  background: #15A968;
  cursor: not-allowed;
  opacity: 0.6;
}
.cc-toggle input:disabled + .cc-toggle-slider::before {
  transform: translateX(20px);
}
.cc-toggle input:focus-visible + .cc-toggle-slider {
  box-shadow: 0 0 0 3px rgba(212, 166, 74, 0.30);
}

.cc-modal-foot {
  padding: 18px 28px 22px;
  border-top: 1px solid var(--cc-line);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  background: var(--cc-bg-app);
}

/* ─── Mobile ─── */
@media (max-width: 720px) {
  .cc-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 18px 18px 16px;
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .cc-banner-actions {
    flex-direction: column-reverse;
    width: 100%;
  }
  .cc-banner-actions .cc-btn { width: 100%; }
  .cc-modal-head { padding: 20px 22px 14px; }
  .cc-modal-body { padding: 14px 22px 6px; }
  .cc-modal-foot { padding: 14px 22px 18px; flex-direction: column-reverse; }
  .cc-modal-foot .cc-btn { width: 100%; }
}

/* ─── Animations ─── */
@keyframes cc-slide-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cc-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Empêche le scroll du body quand la modale est ouverte */
body.cc-modal-open { overflow: hidden; }
