/* Gestion NSG — Bannière de confidentialité */
#nsg-cookie-root {
  font-family: Arial, sans-serif;
}

#nsg-cookie-root [hidden] {
  display: none !important;
}

.nsg-cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 999999;
  box-sizing: border-box;
  width: min(440px, calc(100vw - 40px));
  padding: 22px;
  background: #111113;
  color: #fff;
  border: 1px solid #a88943;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
}

.nsg-cookie-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  color: #e9c56c;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .6px;
}

.nsg-cookie-icon {
  font-size: 22px;
  line-height: 1;
}

.nsg-cookie-banner > strong {
  display: block;
  font-size: 16px;
  line-height: 1.4;
}

.nsg-cookie-banner > p {
  margin: 10px 0 18px;
  color: #c6c6c6;
  font-size: 13px;
  line-height: 1.6;
}

.nsg-cookie-actions {
  display: flex;
  gap: 8px;
}

.nsg-cookie-actions button,
.nsg-cookie-settings button {
  flex: 1;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid #d8ad53;
  border-radius: 7px;
  background: transparent;
  color: #e9c56c;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.nsg-cookie-actions button:first-child,
.nsg-cookie-settings button {
  background: #d8ad53;
  color: #171717;
}

.nsg-cookie-actions button:last-child {
  border-color: #777;
  color: #fff;
}

.nsg-cookie-actions button:hover,
.nsg-cookie-settings button:hover {
  filter: brightness(1.12);
}

.nsg-cookie-actions button:focus-visible,
.nsg-cookie-settings button:focus-visible,
.nsg-cookie-reopen:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.nsg-cookie-settings {
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid #51452d;
  border-radius: 9px;
}

.nsg-cookie-settings > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  font-size: 13px;
}

.nsg-cookie-settings small {
  display: block;
  margin-bottom: 12px;
  color: #bcbcbc;
  font-size: 12px;
  line-height: 1.5;
}

.nsg-cookie-settings input {
  accent-color: #d8ad53;
}

.nsg-cookie-settings button {
  width: 100%;
  margin-top: 5px;
}

.nsg-cookie-reopen {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 999998;
  width: 38px;
  height: 38px;
  border: 1px solid #a88943;
  border-radius: 50%;
  background: #111113;
  color: #e9c56c;
  font-size: 20px;
  cursor: pointer;
}

#nsg-cookie-root:has(.nsg-cookie-banner:not([hidden])) .nsg-cookie-reopen {
  display: none;
}

@media (max-width: 600px) {
  .nsg-cookie-banner {
    bottom: 12px;
    left: 12px;
    width: calc(100vw - 24px);
    padding: 17px;
  }

  .nsg-cookie-actions {
    flex-wrap: wrap;
  }

  .nsg-cookie-actions button {
    min-width: 30%;
  }
}

/* Afficher le raccourci seulement après un choix */
#nsg-cookie-root:has(.nsg-cookie-banner:not([hidden])) .nsg-cookie-reopen {
  display: none;
}
#nsg-cookie-root:has(.nsg-cookie-banner[hidden]) .nsg-cookie-reopen {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Masquer le raccourci tant que l'introduction est présente */
body:has(#nsg-intro) .nsg-cookie-reopen {
  display: none !important;
}

/* Ne pas afficher le raccourci avant le premier consentement */
#nsg-cookie-root:has(.nsg-cookie-banner[hidden]) .nsg-cookie-reopen {
  display: none;
}

/* Gestion NSG — affichage final du raccourci cookies */
#nsg-cookie-root .nsg-cookie-reopen {
  display: none;
}

#nsg-cookie-root:has(.nsg-cookie-banner[hidden]) .nsg-cookie-reopen {
  display: flex;
  align-items: center;
  justify-content: center;
}

body:has(#nsg-intro) #nsg-cookie-root .nsg-cookie-reopen {
  display: none !important;
}

/* Icône visible uniquement après un choix enregistré */
#nsg-cookie-root .nsg-cookie-reopen {
  display: none !important;
}

body:not(:has(#nsg-intro)) #nsg-cookie-root:has(.nsg-cookie-banner[hidden]) .nsg-cookie-reopen {
  display: flex !important;
  align-items: center;
  justify-content: center;
}


/* Masquer la bannière pendant toute l'introduction NSG */
body:has(#nsg-intro) #nsg-cookie-root .nsg-cookie-banner,
#nsg-cookie-root[data-waiting-intro="1"] .nsg-cookie-banner {
  display: none !important;
}


/* Lien vers la politique de confidentialité */
#nsg-cookie-root .nsg-cookie-privacy-link {
  display: block;
  width: fit-content;
  margin: 15px auto 0;
  color: #d8b46c;
  font-size: 12px;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color .2s ease;
}

#nsg-cookie-root .nsg-cookie-privacy-link:hover,
#nsg-cookie-root .nsg-cookie-privacy-link:focus-visible {
  color: #fff0c8;
}
