/* CNIL first-layer banner — Refuser & Accepter equally prominent */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  padding: 1rem max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(10, 6, 20, 0.97), rgba(5, 2, 12, 0.99));
  border-top: 1px solid rgba(240, 208, 96, 0.4);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
}

.cookie-banner[hidden] {
  display: none !important;
}

.cookie-banner__inner {
  width: min(960px, 100%);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
}

.cookie-banner__copy {
  flex: 1 1 280px;
  min-width: 0;
}

.cookie-banner__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.05rem;
  color: #ffe9a8;
}

.cookie-banner__text {
  margin: 0;
  color: #e8dff4;
  font-size: 0.9rem;
  line-height: 1.5;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: flex-end;
  flex: 0 1 auto;
}

.cookie-btn-equal {
  appearance: none;
  min-width: 8.5rem;
  min-height: 2.75rem;
  padding: 0.7rem 1.15rem;
  border-radius: 10px;
  border: 2px solid #ffe08a;
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  touch-action: manipulation;
}

/* CNIL: Refuser et Accepter — même taille, même poids visuel */
.cookie-btn-refuse,
.cookie-btn-accept {
  background: linear-gradient(180deg, #ffe08a, #d4af37 55%, #b8922a);
  color: #1a1005;
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.35);
}

.cookie-btn-refuse:hover,
.cookie-btn-refuse:focus-visible,
.cookie-btn-accept:hover,
.cookie-btn-accept:focus-visible {
  filter: brightness(1.06);
}

.cookie-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(0, 0, 0, 0.25);
  color: #f7f1e4;
  font-weight: 600;
  cursor: pointer;
}

.cookie-toggle input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: #d4af37;
}

body.cookie-banner-open {
  padding-bottom: 9rem;
}

/* Cookie FAB + settings modal (Luxora) */
.cookie-fab {
  position: fixed;
  left: 1.15rem;
  bottom: 1.15rem;
  z-index: 80;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid #fff6c8;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe08a, #d4af37 55%, #b8922a);
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), 0 0 16px rgba(240, 208, 96, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.cookie-fab:hover {
  transform: scale(1.06);
  background: linear-gradient(180deg, #fff4c4, #f0d060 50%, #d4af37);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 22px rgba(240, 208, 96, 0.45);
}

.cookie-fab:focus-visible {
  outline: 2px solid var(--accent-bright, #f0d060);
  outline-offset: 3px;
}

.cookie-fab.is-open {
  background: #fff;
  border-color: rgba(255, 255, 255, 0.95);
  color: #2a2a2a;
}

.cookie-fab svg {
  width: 28px;
  height: 28px;
  display: block;
}

.cookie-fab .icon-close {
  display: none;
}

.cookie-fab.is-open .icon-cookie {
  display: none;
}

.cookie-fab.is-open .icon-close {
  display: block;
}

.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.cookie-modal.is-open {
  display: flex;
}

.cookie-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 2, 12, 0.72);
  backdrop-filter: blur(6px);
}

.cookie-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  max-height: min(86vh, 640px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: linear-gradient(165deg, #1a0f2e 0%, #12081f 55%, #0a0514 100%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 40px rgba(107, 47, 181, 0.25);
  color: var(--text, #f7f1e4);
}

.cookie-modal__header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.22);
  background: rgba(0, 0, 0, 0.2);
}

.cookie-modal__brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.cookie-modal__brand img {
  display: block;
  width: auto;
  height: 48px;
  object-fit: contain;
}

.cookie-modal__title {
  margin: 0;
  text-align: center;
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: #fff;
}

.cookie-modal__x {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cookie-modal__x:hover {
  background: rgba(232, 90, 79, 0.25);
  border-color: rgba(232, 90, 79, 0.5);
}

.cookie-modal__x svg {
  width: 16px;
  height: 16px;
}

.cookie-modal__body {
  display: grid;
  grid-template-columns: minmax(180px, 230px) 1fr;
  min-height: 0;
  overflow: hidden;
}

.cookie-modal__nav {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  border-right: 1px solid rgba(212, 175, 55, 0.18);
  overflow: auto;
  background: rgba(0, 0, 0, 0.18);
}

.cookie-modal__nav button {
  width: 100%;
  appearance: none;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--text-muted, #a89bb8);
  text-align: left;
  padding: 0.85rem 1rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cookie-modal__nav button:hover {
  color: #fff;
  background: rgba(107, 47, 181, 0.15);
}

.cookie-modal__nav button.is-active {
  color: #fff;
  border-left-color: #a855f7;
  background: rgba(107, 47, 181, 0.22);
}

.cookie-modal__panel {
  padding: 1.15rem 1.25rem 1.35rem;
  overflow: auto;
}

.cookie-modal__panel h3 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.2rem;
  color: var(--accent-bright, #f0d060);
}

.cookie-modal__panel p {
  margin: 0 0 0.85rem;
  color: #d4c8e4;
  font-size: 0.95rem;
  line-height: 1.55;
}

.cookie-modal__panel a {
  color: #c4a0ff;
  text-decoration: underline;
}

.cookie-modal__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
  padding: 0.95rem 1.1rem;
  border-top: 1px solid rgba(212, 175, 55, 0.22);
  background: rgba(0, 0, 0, 0.25);
}

.cookie-modal__footer .btn {
  min-width: 140px;
}

.cookie-btn-primary {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(180deg, #9b5cff, #6b2fb5);
  color: #fff;
  box-shadow: 0 6px 18px rgba(107, 47, 181, 0.45);
}

.cookie-btn-primary:hover {
  filter: brightness(1.08);
}

.cookie-btn-ghost {
  appearance: none;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 10px;
  min-height: 2.75rem;
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: var(--accent-bright, #f0d060);
  touch-action: manipulation;
}

.cookie-btn-ghost:hover {
  background: rgba(212, 175, 55, 0.1);
}

.cookie-btn-equal:focus-visible,
.cookie-btn-ghost:focus-visible,
.cookie-modal__nav button:focus-visible,
.cookie-modal__x:focus-visible {
  outline: 3px solid #f0d060;
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .cookie-banner__actions {
    width: 100%;
  }

  .cookie-banner__actions .cookie-btn-equal,
  .cookie-banner__actions .cookie-btn-ghost {
    flex: 1 1 calc(50% - 0.4rem);
    min-width: 0;
  }

  .cookie-banner__actions .cookie-btn-ghost {
    order: 3;
    flex-basis: 100%;
  }

  body.cookie-banner-open {
    padding-bottom: 14rem;
  }

  .cookie-modal__body {
    grid-template-columns: 1fr;
  }

  .cookie-modal__nav {
    display: flex;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
    padding: 0.35rem;
    gap: 0.25rem;
  }

  .cookie-modal__nav button {
    flex: 0 0 auto;
    border-left: 0;
    border-bottom: 0;
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    white-space: nowrap;
  }

  .cookie-modal__nav button.is-active {
    border-left-color: transparent;
    background: rgba(168, 85, 247, 0.35);
  }

  .cookie-modal__footer {
    justify-content: stretch;
  }

  .cookie-modal__footer .btn,
  .cookie-btn-primary,
  .cookie-btn-ghost {
    flex: 1 1 auto;
    min-width: 0;
  }

  .cookie-fab {
    left: max(0.85rem, env(safe-area-inset-left));
    bottom: max(0.85rem, env(safe-area-inset-bottom));
  }

  .cookie-modal {
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  }
}
