/* Cookie consent banner in the NWS look (markup + logic from the template script, unchanged:
   designesia.js "NextWeb Cookie Consent", key nw_cookie_consent_v3). Light / dark, toggle switches,
   gradient primary button; phones: bottom sheet. Like the template: no blur on the dimmed page (performance). */
.nw-cookie-overlay {
  padding: 22px;
  background: rgba(10, 11, 32, 0.42);
}
[data-theme='dark'] .nw-cookie-overlay {
  background: rgba(0, 0, 0, 0.6);
}
.nw-cookie-box {
  width: min(480px, 100%);
  max-height: calc(100vh - 44px);
  max-height: calc(100svh - 44px);
  border: 1px solid var(--nws-header-line);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 30px 80px rgba(18, 19, 44, 0.28);
  color: var(--nws-header-fg-2);
  font-family: var(--nws-font-body);
}
[data-theme='dark'] .nw-cookie-box {
  background: #12132c;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
/* No opening animation: an animated transform puts the dialog on its own layer in Safari, and the
   text flickers when the layer is dropped again. */

/* Header with an icon tile */
.nw-cookie-header {
  position: relative;
  padding: 26px 26px 6px 88px;
}
.nw-cookie-header::before {
  content: '';
  position: absolute;
  left: 26px;
  top: 24px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a9 9 0 1 0 9 9 4 4 0 0 1-4.5-4A4 4 0 0 1 12 3z'/%3E%3Cpath d='M8.5 11.5h.01M12 16h.01M15.5 13.5h.01M9 15.5h.01'/%3E%3C/svg%3E") center / 24px no-repeat,
    var(--nws-grad-brand);
  box-shadow: 0 10px 24px rgba(74, 129, 211, 0.35);
}
.nw-cookie-header h3 {
  margin: 0 0 6px;
  color: var(--nws-header-fg);
  font-family: var(--nws-font-heading);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.nw-cookie-header p {
  margin: 0;
  color: var(--nws-header-fg-2);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Options as small cards with a toggle switch (still the same checkbox inputs) */
.nw-cookie-body {
  display: grid;
  gap: 10px;
  padding: 18px 26px 4px;
}
.nw-cookie-option,
.nw-cookie-option:first-child {
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--nws-header-line);
  border-radius: 14px;
  background: rgba(var(--nws-c-primary-rgb), 0.05);
  cursor: pointer;
}
.nw-cookie-option input {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  margin: 2px 0 0;
  border-radius: 999px;
  background: rgba(127, 128, 150, 0.35);
  cursor: pointer;
  transition: background var(--nws-dur-fast) ease;
}
.nw-cookie-option input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  /* the knob moves via `left` (no transform → no extra layer → no flicker in Safari) */
  transition: left 200ms ease;
}
.nw-cookie-option input:checked {
  background: var(--nws-grad-brand);
}
.nw-cookie-option input:checked::after {
  left: 21px;
}
.nw-cookie-option input:disabled {
  cursor: default;
  opacity: 0.75;
}
.nw-cookie-option input:focus-visible {
  outline: 3px solid var(--nws-c-focus);
  outline-offset: 2px;
}
.nw-cookie-option span {
  color: var(--nws-header-fg-2);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.nw-cookie-option strong {
  margin-bottom: 3px;
  color: var(--nws-header-fg);
  font-size: 0.9375rem;
}

/* Buttons: primary gradient, two quiet outline buttons side by side */
.nw-cookie-actions {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 18px 26px 18px;
}
.nw-cookie-actions button {
  min-height: 46px;
  padding: 11px 16px;
  border-radius: var(--nws-radius-btn);
  font-family: var(--nws-font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.25;
}
.nw-cookie-actions .nw-cookie-accept {
  grid-column: 1 / -1;
  background: var(--nws-grad-button);
  box-shadow: 0 10px 26px rgba(74, 129, 211, 0.32);
  color: #fff;
}
.nw-cookie-actions .nw-cookie-save,
.nw-cookie-actions .nw-cookie-essential {
  border: 1px solid var(--nws-header-line) !important;
  background: transparent;
  color: var(--nws-header-fg);
}
.nw-cookie-actions .nw-cookie-save:hover,
.nw-cookie-actions .nw-cookie-essential:hover {
  border-color: var(--nws-c-primary) !important;
  background: rgba(var(--nws-c-primary-rgb), 0.08);
}
.nw-cookie-actions button:focus-visible {
  outline: 3px solid var(--nws-c-focus);
  outline-offset: 2px;
}
.nw-cookie-links {
  padding: 0 26px 24px;
  color: var(--nws-header-fg-2);
  font-size: 0.8125rem;
}
.nw-cookie-links a {
  color: var(--nws-c-brand);
  font-weight: 600;
}
[data-theme='dark'] .nw-cookie-links a {
  color: #8db0ee;
}

/* Phones: bottom sheet, buttons stacked */
@media (max-width: 560px) {
  .nw-cookie-overlay {
    padding: 0;
  }
  .nw-cookie-box {
    width: 100%;
    max-height: 92svh;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .nw-cookie-header {
    padding: 22px 20px 6px 80px;
  }
  .nw-cookie-header::before {
    left: 20px;
    top: 20px;
  }
  .nw-cookie-body {
    padding: 16px 20px 4px;
  }
  .nw-cookie-actions {
    grid-template-columns: 1fr;
    padding: 16px 20px 14px;
  }
  .nw-cookie-links {
    padding: 0 20px 20px;
  }
}

/* No movement on hover: the template lifted the buttons by 1 px (transform) – in Safari that briefly
   puts them on their own layer and the whole dialog and the dimmed page behind it shimmer. Only a calm
   colour change remains. */
.nw-cookie-actions button,
.nw-cookie-actions button:hover,
.nw-cookie-actions button:active {
  transform: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.nw-cookie-actions .nw-cookie-accept:hover {
  box-shadow: 0 12px 30px rgba(74, 129, 211, 0.45);
}
