/* Shared cookie-consent component — aligned with the POOOL design-system kit. */
#cookie-consent-banner,
#cookie-preferences-modal,
#cookie-consent-banner *,
#cookie-preferences-modal * {
  box-sizing: border-box;
}

.cookie-banner {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99999;
  width: min(488px, calc(100vw - 48px));
  overflow: hidden;
  color: var(--fg-body);
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card-lg, 16px);
  box-shadow: var(--shadow-elevated);
  font-family: var(--font-family, "TT Norms Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px) scale(0.98);
  transition: opacity var(--dur-slow, 240ms) var(--ease-out, ease), transform var(--dur-slow, 240ms) var(--ease-out, ease);
}

.cookie-banner.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.cookie-banner__accent {
  height: 4px;
  background: linear-gradient(90deg, var(--brand-blue) 0 72%, var(--brand-green-neon) 72% 100%);
}

.cookie-banner__content {
  padding: 22px 22px 18px;
}

.cookie-banner__intro {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cookie-banner__icon,
.cookie-modal__icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--brand-green-mint);
  background: var(--brand-blue);
  border-radius: 12px;
  box-shadow: var(--shadow-elevated);
}

.cookie-banner__icon svg,
.cookie-modal__icon svg {
  width: 24px;
  height: 24px;
}

.cookie-banner__eyebrow,
.cookie-modal__eyebrow {
  margin: 0 0 2px;
  color: var(--brand-blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.cookie-banner__title {
  margin: 0;
  color: var(--fg-heading-2);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.cookie-banner__copy {
  margin: 14px 0 18px;
  color: var(--fg-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.cookie-consent-error {
  min-height: 1.25rem;
  margin: 0 0 12px;
  color: #d92d20;
  font-size: 0.875rem;
  line-height: 1.4;
}

.cookie-consent-error:empty {
  display: none;
}

.cookie-banner a,
.cookie-modal a {
  color: var(--brand-blue);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.cookie-banner a:hover,
.cookie-modal a:hover {
  color: var(--brand-blue-hover);
}

#cookie-consent-banner.cookie-banner .cookie-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cookie-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-input, 8px);
  font: 700 14px/1 var(--font-family, "TT Norms Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  cursor: pointer;
  transition: color var(--dur-fast, 120ms) ease, background var(--dur-fast, 120ms) ease, border-color var(--dur-fast, 120ms) ease, box-shadow var(--dur-fast, 120ms) ease, transform var(--dur-fast, 120ms) ease;
}

.cookie-button:active {
  transform: scale(var(--press-scale, 0.97));
}

.cookie-button:focus-visible,
.cookie-modal__close:focus-visible,
.cookie-toggle__input:focus-visible + .cookie-toggle__track {
  outline: 0;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-blue) 20%, transparent);
}

.cookie-button--primary {
  color: var(--brand-green-mint);
  background: var(--brand-blue);
}

.cookie-button--primary:hover {
  background: var(--brand-blue-hover);
  box-shadow: var(--shadow-elevated);
}

.cookie-button--secondary {
  color: var(--brand-blue);
  background: var(--brand-green-mint);
}

.cookie-button--secondary:hover {
  background: color-mix(in srgb, var(--brand-green-mint) 82%, var(--brand-blue));
}

.cookie-button--manage {
  grid-column: 1 / -1;
  gap: 4px;
  min-height: 34px;
  color: var(--fg-secondary);
  background: transparent;
}

.cookie-button--manage:hover {
  color: var(--brand-blue);
  background: var(--bg-hover);
}

.cookie-button--manage svg {
  width: 17px;
  height: 17px;
  transition: transform var(--dur-fast, 120ms) ease;
}

.cookie-button--manage:hover svg {
  transform: translateX(2px);
}

.cookie-modal-open {
  overflow: hidden;
}

.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  background: color-mix(in srgb, var(--fg-heading-2) 58%, transparent);
  opacity: 0;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: opacity var(--dur-slow, 240ms) ease, visibility var(--dur-slow, 240ms) ease;
}

.cookie-modal.is-open {
  visibility: visible;
  opacity: 1;
}

.cookie-modal__panel {
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  max-height: min(760px, calc(100dvh - 48px));
  overflow-y: auto;
  padding: 28px;
  color: var(--fg-body);
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  box-shadow: var(--shadow-elevated);
  font-family: var(--font-family, "TT Norms Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity var(--dur-slow, 240ms) var(--ease-out, ease), transform var(--dur-slow, 240ms) var(--ease-out, ease);
}

.cookie-modal.is-open .cookie-modal__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.cookie-modal__header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cookie-modal__heading {
  min-width: 0;
  flex: 1;
}

.cookie-modal__heading h2 {
  margin: 0;
  color: var(--fg-heading-2);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.cookie-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--fg-muted);
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.cookie-modal__close:hover {
  color: var(--fg-heading-2);
  background: var(--bg-hover);
}

.cookie-modal__close svg {
  width: 22px;
  height: 22px;
}

.cookie-modal__description {
  margin: 18px 0 20px;
  color: var(--fg-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.cookie-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  margin-top: 10px;
  padding: 16px;
  color: inherit;
  background: var(--bg-subtle);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color var(--dur-fast, 120ms) ease, background var(--dur-fast, 120ms) ease;
}

.cookie-category:hover {
  background: color-mix(in srgb, var(--brand-blue) 4%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--brand-blue) 22%, var(--border-soft));
}

.cookie-category--required {
  cursor: default;
}

.cookie-category--required:hover {
  background: var(--bg-subtle);
  border-color: var(--border-soft);
}

.cookie-category__content {
  display: block;
  min-width: 0;
  flex: 1;
}

.cookie-category__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-category h3,
.cookie-category strong {
  margin: 0;
  color: var(--fg-heading-2);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.cookie-category p,
.cookie-category__description {
  display: block;
  margin: 5px 0 0;
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.45;
}

.cookie-category__badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  color: var(--success-fg);
  background: var(--success-bg);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.cookie-toggle {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.cookie-toggle__input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.cookie-toggle__track {
  display: flex;
  align-items: center;
  width: 44px;
  height: 26px;
  padding: 3px;
  background: var(--border-strong);
  border-radius: 999px;
  transition: background var(--dur-base, 160ms) ease, box-shadow var(--dur-base, 160ms) ease;
}

.cookie-toggle__thumb {
  width: 20px;
  height: 20px;
  background: var(--bg-surface);
  border-radius: 50%;
  box-shadow: var(--shadow-card);
  transform: translateX(0);
  transition: transform var(--dur-base, 160ms) var(--ease-out, ease);
}

.cookie-toggle__input:checked + .cookie-toggle__track {
  background: var(--brand-blue);
}

.cookie-toggle__input:checked + .cookie-toggle__track .cookie-toggle__thumb {
  transform: translateX(18px);
}

.cookie-modal__notice {
  margin: 16px 2px 0;
  color: var(--fg-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.cookie-modal__footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}

@media (max-width: 640px) {
  .cookie-banner {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    border-radius: 16px;
  }

  .cookie-banner__content {
    padding: 18px 18px 14px;
  }

  #cookie-consent-banner.cookie-banner .cookie-actions,
  .cookie-modal__footer {
    grid-template-columns: 1fr;
  }

  .cookie-button--manage {
    grid-column: auto;
  }

  .cookie-modal {
    align-items: flex-end;
    padding: 0;
  }

  .cookie-modal__panel {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    padding: 22px 18px calc(20px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }

  .cookie-modal__icon {
    width: 40px;
    height: 40px;
  }

  .cookie-category {
    padding: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner,
  .cookie-modal,
  .cookie-modal__panel,
  .cookie-button,
  .cookie-button--manage svg,
  .cookie-toggle__track,
  .cookie-toggle__thumb {
    transition: none;
  }
}
