/* ──────────────────────────────────────────────────────────────
   Serra Di Falco — Cookie consent banner styles
   Conforme CNIL 2022
   ────────────────────────────────────────────────────────────── */

.cc-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 -8px 40px -8px rgba(0, 0, 0, 0.5);
  transform: translateY(110%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: "Manrope", -apple-system, "Segoe UI", sans-serif;
}

.cc-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cc-title {
  font-family: "DM Serif Display", Georgia, serif;
  font-style: italic;
  font-size: 22px;
  color: var(--terracotta-soft);
  margin-bottom: 8px;
}

.cc-desc {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(246, 241, 232, 0.75);
  max-width: 860px;
}

.cc-link {
  color: var(--terracotta-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cc-link:hover { color: var(--cream); }

.cc-btn-text {
  display: inline-block;
  margin-top: 10px;
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(246, 241, 232, 0.5);
  cursor: pointer;
  transition: color 0.15s;
  background: none;
  border: none;
  padding: 0;
}
.cc-btn-text:hover { color: rgba(246, 241, 232, 0.85); }

/* ── Preferences panel ──────────────────────────────────────── */
.cc-prefs {
  border-top: 1px solid rgba(246, 241, 232, 0.1);
  padding-top: 18px;
}
.cc-prefs[hidden] { display: none; }

.cc-prefs-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cc-pref-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  background: rgba(246, 241, 232, 0.05);
  border-radius: 10px;
}

.cc-pref-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cc-required-badge {
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(143, 174, 148, 0.2);
  color: #b7cdba;
  padding: 3px 8px;
  border-radius: 999px;
}

.cc-pref-desc {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(246, 241, 232, 0.55);
}

/* ── Toggle switch ──────────────────────────────────────────── */
.cc-toggle {
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(246, 241, 232, 0.15);
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  border: none;
  padding: 0;
  margin-top: 2px;
}

.cc-toggle--on {
  background: var(--terracotta);
}

.cc-toggle--disabled {
  cursor: default;
  opacity: 0.7;
}

.cc-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cream);
  transition: transform 0.2s ease;
  display: block;
}

.cc-toggle[aria-checked="true"] .cc-toggle-thumb {
  transform: translateX(18px);
}

/* ── Action buttons ─────────────────────────────────────────── */
.cc-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cc-btn {
  height: 44px;
  padding: 0 22px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  border: none;
}

.cc-btn--outline {
  background: transparent;
  border: 1px solid rgba(246, 241, 232, 0.25);
  color: rgba(246, 241, 232, 0.85);
}
.cc-btn--outline:hover {
  border-color: rgba(246, 241, 232, 0.6);
  color: var(--cream);
  background: rgba(246, 241, 232, 0.06);
}

.cc-btn--save {
  display: none; /* affiché uniquement quand le panel est ouvert */
}
.cc-prefs:not([hidden]) ~ .cc-actions .cc-btn--save {
  display: inline-flex;
  align-items: center;
}

.cc-btn--primary {
  background: var(--terracotta);
  color: var(--cream);
}
.cc-btn--primary:hover { background: var(--terracotta-deep); }

/* ── Floating "manage cookies" button ───────────────────────── */
.cc-floating-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9998;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  border: 1px solid rgba(246, 241, 232, 0.15);
  color: var(--cream);
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  line-height: 1;
}
.cc-floating-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px -4px rgba(0, 0, 0, 0.5);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cc-inner { padding: 20px 20px 24px; gap: 16px; }
  .cc-title { font-size: 18px; }
  .cc-actions { flex-direction: column; align-items: stretch; }
  .cc-btn { width: 100%; text-align: center; justify-content: center; display: flex; align-items: center; }
  .cc-btn--save { width: 100%; }
  .cc-pref-row { flex-direction: row; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner { transition: none; }
  .cc-btn { transition: none; }
  .cc-btn-text { transition: none; }
  .cc-toggle { transition: none; }
  .cc-toggle-thumb { transition: none; }
  .cc-floating-btn { transition: none; }
}
