:root {
  --epcg-bg: #fff;
  --epcg-text: #1d2327;
  --epcg-border: #c3c4c7;
  --epcg-primary: #135e96;
  --epcg-primary-text: #fff;
  --epcg-shadow: 0 8px 30px rgba(0, 0, 0, .22);
}

.epcg-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.epcg-banner {
  position: fixed;
  z-index: 2147483640;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px;
  color: var(--epcg-text);
  background: var(--epcg-bg);
  border: 1px solid var(--epcg-border);
  border-radius: 8px;
  box-shadow: var(--epcg-shadow);
  font: 16px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.epcg-banner[hidden], .epcg-modal[hidden], .epcg-preferences-button[hidden] { display: none !important; }
.epcg-copy { flex: 1 1 620px; }
.epcg-copy h2, .epcg-modal h2 { margin: 0 0 8px; color: var(--epcg-text); font-size: 21px; line-height: 1.25; }
.epcg-copy p, .epcg-modal p { margin: 0 0 8px; }
.epcg-links { margin-top: 8px; }
.epcg-link { color: var(--epcg-primary); text-decoration: underline; }
.epcg-actions, .epcg-modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.epcg-actions { flex: 0 1 480px; }

.epcg-button, .epcg-preferences-button, .epcg-inline-preferences {
  appearance: none;
  min-height: 42px;
  padding: 9px 15px;
  border: 2px solid var(--epcg-primary);
  border-radius: 5px;
  font: 600 15px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
}
.epcg-primary { color: var(--epcg-primary-text); background: var(--epcg-primary); }
.epcg-secondary, .epcg-inline-preferences { color: var(--epcg-primary); background: #fff; }
.epcg-button:focus-visible, .epcg-preferences-button:focus-visible, .epcg-inline-preferences:focus-visible, .epcg-close:focus-visible { outline: 3px solid #72aee6; outline-offset: 2px; }

.epcg-modal {
  position: fixed;
  z-index: 2147483646;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .62);
  font: 16px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.epcg-modal-card {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px;
  color: var(--epcg-text);
  background: var(--epcg-bg);
  border-radius: 8px;
  box-shadow: var(--epcg-shadow);
}
.epcg-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.epcg-close { border: 0; background: transparent; color: var(--epcg-text); font-size: 32px; line-height: 1; cursor: pointer; }
.epcg-modal-open { overflow: hidden; }

.epcg-category {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-top: 1px solid var(--epcg-border);
  cursor: pointer;
}
.epcg-category small { display: block; margin-top: 3px; font-size: 13px; font-weight: 400; }
.epcg-category input { position: absolute; opacity: 0; pointer-events: none; }
.epcg-switch { position: relative; flex: 0 0 48px; width: 48px; height: 26px; border-radius: 999px; background: #757575; transition: .15s ease; }
.epcg-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .15s ease; }
.epcg-category input:checked + .epcg-switch { background: var(--epcg-primary); }
.epcg-category input:checked + .epcg-switch::after { transform: translateX(22px); }
.epcg-category input:focus-visible + .epcg-switch { outline: 3px solid #72aee6; outline-offset: 2px; }
.epcg-category input:disabled + .epcg-switch { opacity: .65; }
.epcg-note { padding: 10px 12px; background: #f0f6fc; border-left: 4px solid #2271b1; }
.epcg-modal-actions { margin-top: 20px; }

.epcg-preferences-button {
  position: fixed;
  z-index: 2147483639;
  left: 14px;
  bottom: 14px;
  min-height: 36px;
  padding: 7px 11px;
  color: var(--epcg-primary);
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}

@media (max-width: 800px) {
  .epcg-banner { display: block; max-height: calc(100vh - 32px); overflow: auto; }
  .epcg-actions { margin-top: 16px; justify-content: stretch; }
  .epcg-actions .epcg-button { flex: 1 1 180px; }
}

@media (prefers-reduced-motion: reduce) {
  .epcg-switch, .epcg-switch::after { transition: none; }
}

/* EthicsPro brand overrides. High specificity and !important prevent theme button rules from replacing consent styles. */
#epcg-root {
  --epcg-brand-blue: #295a8e;
  --epcg-brand-blue-hover: #214a76;
  --epcg-brand-green: #8ea95f;
  --epcg-brand-green-hover: #758e4d;
  --epcg-brand-focus: #71a1d6;
}

#epcg-root .epcg-banner .epcg-button.epcg-secondary,
#epcg-root .epcg-modal .epcg-button.epcg-secondary,
#epcg-root .epcg-preferences-button,
.epcg-inline-preferences {
  color: var(--epcg-brand-blue) !important;
  background-color: #fff !important;
  border-color: var(--epcg-brand-blue) !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

#epcg-root .epcg-banner .epcg-button.epcg-secondary:hover,
#epcg-root .epcg-modal .epcg-button.epcg-secondary:hover,
#epcg-root .epcg-preferences-button:hover,
.epcg-inline-preferences:hover {
  color: #fff !important;
  background-color: var(--epcg-brand-blue) !important;
  border-color: var(--epcg-brand-blue) !important;
}

#epcg-root .epcg-banner .epcg-button[data-epcg-action="accept"],
#epcg-root .epcg-modal .epcg-button[data-epcg-action="save"] {
  color: #fff !important;
  background-color: var(--epcg-brand-green) !important;
  border-color: var(--epcg-brand-green) !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .18) !important;
  text-decoration: none !important;
}

#epcg-root .epcg-banner .epcg-button[data-epcg-action="accept"]:hover,
#epcg-root .epcg-modal .epcg-button[data-epcg-action="save"]:hover {
  color: #fff !important;
  background-color: var(--epcg-brand-green-hover) !important;
  border-color: var(--epcg-brand-green-hover) !important;
}

#epcg-root .epcg-link {
  color: var(--epcg-brand-blue) !important;
}

#epcg-root .epcg-link:hover {
  color: var(--epcg-brand-blue-hover) !important;
}

#epcg-root .epcg-category input:checked + .epcg-switch {
  background-color: var(--epcg-brand-green) !important;
}

#epcg-root .epcg-modal .epcg-close,
#epcg-root .epcg-close {
  min-width: 40px;
  min-height: 40px;
  padding: 4px 10px;
  color: #fff !important;
  background-color: var(--epcg-brand-blue) !important;
  border: 1px solid var(--epcg-brand-blue) !important;
  border-radius: 4px;
  box-shadow: none !important;
  text-decoration: none !important;
}

#epcg-root .epcg-modal .epcg-close:hover,
#epcg-root .epcg-close:hover {
  color: #fff !important;
  background-color: var(--epcg-brand-blue-hover) !important;
  border-color: var(--epcg-brand-blue-hover) !important;
}

#epcg-root .epcg-button:focus-visible,
#epcg-root .epcg-preferences-button:focus-visible,
.epcg-inline-preferences:focus-visible,
#epcg-root .epcg-close:focus-visible,
#epcg-root .epcg-category input:focus-visible + .epcg-switch {
  outline: 3px solid var(--epcg-brand-focus) !important;
  outline-offset: 3px !important;
}
