:root {
  --cc-vert: #007147;
  --cc-foret: #154734;
  --cc-blanc: #ffffff;
  --cc-carbone: #384f59;
  --cc-carbone-50: #9ca7ac;
  --cc-overlay: rgba(0, 0, 0, 0.45);
}

.cookie-banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10000;
  padding: 1rem;
  animation: cookie-slide-up 0.35s ease;
}

@keyframes cookie-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.cookie-banner-inner {
  max-width: 960px;
  margin: 0 auto;
  background: var(--cc-blanc);
  border: 1px solid var(--cc-carbone-50);
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

.cookie-banner h2 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  color: var(--cc-foret);
}

.cookie-banner p {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--cc-carbone);
}

.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.58rem 1rem;
  min-height: 2.35rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid transparent;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.cookie-btn:hover {
  opacity: 0.92;
}

.cookie-btn-primary {
  background: var(--cc-vert);
  color: var(--cc-blanc);
}

.cookie-btn-secondary {
  background: var(--cc-blanc);
  color: var(--cc-carbone);
  border-color: var(--cc-carbone-50);
}

.cookie-btn-ghost {
  background: transparent;
  color: var(--cc-vert);
  border-color: var(--cc-vert);
}

.cookie-banner-link {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--cc-vert);
}

.cookie-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: var(--cc-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cookie-modal {
  width: 100%;
  max-width: 520px;
  max-height: min(90vh, 640px);
  overflow: auto;
  background: var(--cc-blanc);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

.cookie-modal h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  color: var(--cc-foret);
}

.cookie-modal-intro {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--cc-carbone);
  line-height: 1.45;
}

.cookie-category {
  border: 1px solid var(--cc-carbone-50);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
}

.cookie-category-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.cookie-category h3 {
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
  color: var(--cc-foret);
}

.cookie-category p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--cc-carbone);
}

.cookie-toggle {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cookie-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--cc-carbone-50);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cookie-toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: var(--cc-blanc);
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: var(--cc-vert);
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
  transform: translateX(20px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
  opacity: 0.65;
  cursor: not-allowed;
}

.cookie-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--cc-carbone-50);
}

.portal-footer {
  pointer-events: auto;
}

.portal-footer-line {
  pointer-events: auto;
}

.portal-footer a,
.portal-footer-link {
  pointer-events: auto;
  color: inherit;
  font-size: inherit;
  font-style: inherit;
  opacity: 0.85;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.portal-footer a:hover,
.portal-footer-link:hover {
  opacity: 1;
}

.cookie-page-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 1rem 0;
}

.cookie-page-table th,
.cookie-page-table td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--cc-carbone-50);
  vertical-align: top;
}

.cookie-page-table th {
  background: #f8faf9;
  color: var(--cc-foret);
}

@media (max-width: 480px) {
  .cookie-banner-actions,
  .cookie-modal-actions {
    flex-direction: column;
  }

  .cookie-btn {
    width: 100%;
    text-align: center;
  }
}
