/* Koster Consent — overrides loaded after the Silktide stylesheet. */

/* 1) Hide the "Get this banner for free" credit link (allowed by the MIT licence). */
#stcm-wrapper #stcm-modal footer a.stcm-credit-link {
  display: none !important;
}

/* 2) Shield the toggles from theme styles for checkboxes, labels and spans. */
#stcm-wrapper #stcm-modal .stcm-toggle {
  box-sizing: border-box !important;
  position: relative !important;
  display: inline-block !important;
  flex: 0 0 auto !important;
  width: 52px !important;
  height: 30px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  line-height: 1 !important;
  font-size: 0 !important;
  cursor: pointer;
}

#stcm-wrapper #stcm-modal .stcm-toggle::before,
#stcm-wrapper #stcm-modal .stcm-toggle::after,
#stcm-wrapper #stcm-modal .stcm-toggle input::before,
#stcm-wrapper #stcm-modal .stcm-toggle input::after {
  content: none !important;
  display: none !important;
}

/* The real checkbox: invisible, but covers the whole switch so clicks and keyboard work. */
#stcm-wrapper #stcm-modal .stcm-toggle input[type="checkbox"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  opacity: 0 !important;
  z-index: 2 !important;
  cursor: pointer;
}

#stcm-wrapper #stcm-modal .stcm-toggle input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

#stcm-wrapper #stcm-modal .stcm-toggle-track {
  box-sizing: border-box !important;
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #B8B6B8 !important;
  transition: background-color 150ms ease-out;
}

#stcm-wrapper #stcm-modal .stcm-toggle-thumb {
  box-sizing: border-box !important;
  position: absolute !important;
  top: 3px !important;
  left: 3px !important;
  display: block !important;
  width: 24px !important;
  height: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #FFFFFF !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
  transition: left 150ms ease-out;
  z-index: 1 !important;
}

#stcm-wrapper #stcm-modal .stcm-toggle input:checked + .stcm-toggle-track {
  background: var(--primaryColor) !important;
}

#stcm-wrapper #stcm-modal .stcm-toggle input:checked ~ .stcm-toggle-thumb {
  left: calc(100% - 27px) !important;
}

#stcm-wrapper #stcm-modal .stcm-toggle input:disabled + .stcm-toggle-track {
  opacity: 0.55 !important;
  filter: none !important;
}

/* The built-in "On / Off" words are English-only and crowd the switch — hide them;
   the colour and thumb position show the state, and screen readers use the checkbox. */
#stcm-wrapper #stcm-modal .stcm-toggle-on,
#stcm-wrapper #stcm-modal .stcm-toggle-off {
  display: none !important;
}

/* Keyboard focus ring */
#stcm-wrapper #stcm-modal .stcm-toggle:focus-within {
  border-radius: 999px !important;
  box-shadow: 0 0 0 2px var(--backgroundColor), 0 0 0 4px var(--primaryColor) !important;
}

/* 3) Light reset for theme fieldset/legend styles inside the preferences window. */
#stcm-wrapper #stcm-modal fieldset {
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
}

#stcm-wrapper #stcm-modal fieldset + fieldset {
  margin-top: 24px !important;
}

#stcm-wrapper #stcm-modal legend {
  margin-bottom: 8px !important;
  padding: 0 !important;
}

#stcm-wrapper #stcm-modal .stcm-consent-row {
  align-items: center !important;
}
