/* Variables nécessaires (reprises ici pour la page portail qui ne charge pas style.css) */
:root {
  --blue:   #0088ff;
  --text:   #ddeaff;
  --text-2: #7a90b8;
}

/* ═══════════════════════════════════════════════════════════
   COOKIE BANNER + MODAL RGPD
   ═══════════════════════════════════════════════════════════ */

/* ── Bannière ──────────────────────────────────────────── */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9000;
  background: rgba(10, 18, 35, 0.97);
  border-top: 1px solid rgba(96, 165, 250, 0.2);
  backdrop-filter: blur(12px);
  transform: translateY(100%);
  transition: transform .4s cubic-bezier(.22,.68,0,1.2);
  padding: 1.1rem 1.5rem;
}
#cookie-banner.visible { transform: translateY(0); }

.cb-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.cb-text { flex: 1; min-width: 240px; }
.cb-text strong { display: block; margin-bottom: .35rem; font-size: .95rem; color: var(--text); }
.cb-text p  { margin: 0; font-size: .8rem; color: var(--text-2); line-height: 1.5; }
.cb-actions { display: flex; gap: .6rem; flex-wrap: wrap; flex-shrink: 0; }

/* ── Boutons partagés ──────────────────────────────────── */
.cb-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .2s, transform .15s;
  white-space: nowrap;
  font-family: inherit;
}
.cb-btn:hover  { opacity: .85; transform: translateY(-1px); }
.cb-btn:active { transform: translateY(0); }

.cb-btn--accept {
  background: var(--blue);
  color: #fff;
}
.cb-btn--refuse {
  background: rgba(255,255,255,.08);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.12);
}
.cb-btn--link {
  background: none;
  color: var(--text-2);
  padding: .5rem .6rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cb-btn--link:hover { color: var(--text); opacity: 1; }

/* ── Modal ─────────────────────────────────────────────── */
#cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
#cookie-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.cm-box {
  background: #0d1a30;
  border: 1px solid rgba(96,165,250,.18);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
}

.cm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.4rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.cm-title { font-size: 1.05rem; font-weight: 700; color: var(--text); margin: 0; }
.cm-close {
  background: rgba(255,255,255,.08);
  border: none;
  color: var(--text-2);
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
  flex-shrink: 0;
}
.cm-close:hover { background: rgba(255,255,255,.15); color: var(--text); }

.cm-body { padding: 1rem 1.4rem; }
.cm-intro {
  font-size: .8rem;
  color: var(--text-2);
  margin: 0 0 1.1rem;
  line-height: 1.55;
}

/* ── Catégorie ─────────────────────────────────────────── */
.cm-cat {
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  padding: .9rem 1rem;
  margin-bottom: .7rem;
}
.cm-cat:last-child { margin-bottom: 0; }

.cm-cat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.cm-cat-name { font-size: .88rem; font-weight: 600; color: var(--text); margin-bottom: .25rem; }
.cm-cat-desc { font-size: .75rem; color: var(--text-2); line-height: 1.5; }

/* ── Toggle locked ─────────────────────────────────────── */
.cm-toggle--locked {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.cm-toggle-label {
  font-size: .72rem;
  font-weight: 600;
  color: #4ade80;
  background: rgba(74,222,128,.12);
  border: 1px solid rgba(74,222,128,.25);
  border-radius: 100px;
  padding: .18rem .65rem;
  white-space: nowrap;
}

/* ── Toggle switch ─────────────────────────────────────── */
.cm-toggle-switch {
  flex-shrink: 0;
  display: inline-flex;
  cursor: pointer;
  position: relative;
  margin-top: .1rem;
}
.cm-toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.cm-slider {
  display: block;
  width: 42px; height: 24px;
  background: rgba(255,255,255,.12);
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,.15);
  transition: background .25s, border-color .25s;
  position: relative;
}
.cm-slider::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .25s cubic-bezier(.22,.68,0,1.2);
}
.cm-toggle-switch input:checked + .cm-slider {
  background: var(--blue);
  border-color: var(--blue);
}
.cm-toggle-switch input:checked + .cm-slider::after {
  transform: translateX(18px);
}
.cm-toggle-switch:hover .cm-slider { border-color: var(--blue); }

/* ── Footer modal ──────────────────────────────────────── */
.cm-footer {
  display: flex;
  justify-content: flex-end;
  gap: .7rem;
  padding: 1rem 1.4rem 1.2rem;
  border-top: 1px solid rgba(255,255,255,.07);
}

/* ── Lien "Gérer les cookies" dans le footer ───────────── */
.footer-cookie-link {
  background: none;
  border: none;
  padding: 0;
  font-size: .75rem;
  color: var(--text-2);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: inherit;
  transition: color .2s;
}
.footer-cookie-link:hover { color: var(--text); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 600px) {
  .cb-inner  { flex-direction: column; align-items: flex-start; gap: .9rem; }
  .cb-actions { width: 100%; }
  .cb-btn--accept, .cb-btn--refuse { flex: 1; justify-content: center; }
  .cm-footer { flex-direction: column; }
  .cm-footer .cb-btn { width: 100%; justify-content: center; }
}
