/* static/klaro-overrides.css
   Goal:
   - Fix white-on-white text caused by global site styles bleeding into Klaro
   - Hide checkbox inputs (use ONLY sliders)
   - Prevent overlap when services are expanded
   - Keep modal clean and compact
*/

/* Ensure Klaro area doesn't inherit weird global typography/colors */
#klaro, .klaro {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif !important;
}

/* Modal shell */
.klaro .cm-modal,
.klaro .cm-modal.cm-modal-visible {
  background: #ffffff !important;
  border: 1px solid #e6e6e6 !important;
  border-radius: 14px !important;
  box-shadow: 0 6px 40px rgba(44, 62, 80, 0.12) !important;
  max-width: 560px !important;
}

/* Kill global "opacity: 0.x" or weird text effects inside the modal */
.klaro .cm-modal * {
  opacity: 1 !important;
  text-shadow: none !important;
}

/* HEADER */
.klaro .cm-header {
  background: #f6f7f9 !important;
  border-bottom: 1px solid #e8e8e8 !important;
  border-radius: 14px 14px 0 0 !important;
  padding: 18px 22px 12px 22px !important;
}

/* Force readable text even if your site has global h1/h2/label color rules */
.klaro .cm-modal h1,
.klaro .cm-modal h2,
.klaro .cm-modal h3,
.klaro .cm-modal p,
.klaro .cm-modal span,
.klaro .cm-modal strong,
.klaro .cm-modal label,
.klaro .cm-modal li,
.klaro .cm-modal div {
  color: #1f2d3d !important;
}

/* Klaro title/description */
.klaro .cm-title {
  color: #1f2d3d !important;
  font-weight: 800 !important;
  font-size: 1.35rem !important;
  line-height: 1.2 !important;
  margin: 0 !important;
}

.klaro .cm-description {
  color: #2c3e50 !important;
  font-weight: 500 !important;
  font-size: 1rem !important;
  line-height: 1.35 !important;
  margin-top: 10px !important;
}

/* Body / footer */
.klaro .cm-body {
  padding: 10px 22px 0 22px !important;
  background: #fff !important;
}

.klaro .cm-footer {
  background: #f8f9fb !important;
  border-top: 1px solid #e8e8e8 !important;
  border-radius: 0 0 14px 14px !important;
  padding: 14px 22px !important;
}

/* Links */
.klaro .cm-modal a,
.klaro .cm-link {
  color: #217dbb !important;
  text-decoration: underline !important;
}

/* Buttons */
.klaro .cm-btn {
  border-radius: 8px !important;
  border: none !important;
  font-weight: 700 !important;
  padding: 10px 18px !important;
  font-size: 1rem !important;
  line-height: 1 !important;
}

.klaro .cm-btn.cm-btn-save,
.klaro .cm-btn.cm-btn-accept {
  background: #3498db !important;
  color: #ffffff !important;
}

.klaro .cm-btn.cm-btn-decline {
  background: #e7e7e7 !important;
  color: #1f2d3d !important;
}

/* =========================
   SERVICES + SWITCHES (FIX)
   ========================= */

/* Service rows: keep stable layout when expanded */
.klaro .cm-modal .cm-service {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  grid-auto-rows: auto !important;
  column-gap: 14px !important;
  row-gap: 6px !important;

  padding: 12px 0 !important;
  border-bottom: 1px solid #ededed !important;

  /* IMPORTANT: do not let children stretch vertically */
  align-items: start !important;
}

.klaro .cm-modal .cm-service:last-child {
  border-bottom: none !important;
}

/* Left content always left */
.klaro .cm-modal .cm-service .cm-list-label {
  grid-column: 1 !important;
  grid-row: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Description stays under label, left column */
.klaro .cm-modal .cm-service .cm-service-description {
  grid-column: 1 !important;
  grid-row: 2 !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #4b5563 !important;
  font-size: 0.95rem !important;
  line-height: 1.35 !important;
}

/* Switch sits right, DOES NOT span rows (prevents tall slider) */
.klaro .cm-modal .cm-service .cm-switch {
  grid-column: 2 !important;
  grid-row: 1 !important;

  justify-self: end !important;
  align-self: start !important;

  /* prevent stretch */
  height: 24px !important;
  max-height: 24px !important;

  margin: 0 !important;
  padding: 0 !important;

  display: flex !important;
  align-items: center !important;
}

/* HARD FORCE slider size so it can never become “ultra high” */
.klaro .cm-modal .cm-switch .cm-slider {
  display: block !important;
  width: 44px !important;
  height: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
  border-radius: 999px !important;
}

/* Knob */
.klaro .cm-modal .cm-switch .cm-slider:before {
  width: 20px !important;
  height: 20px !important;
  left: 2px !important;
  top: 2px !important;
  background: #fff !important;
}

/* Checked state */
.klaro .cm-modal .cm-switch input:checked + .cm-slider {
  background: #3498db !important;
}
.klaro .cm-modal .cm-switch input:checked + .cm-slider:before {
  transform: translateX(20px) !important;
}

/* =========================
   HIDE CHECKBOXES (BUT KEEP FUNCTIONAL)
   ========================= */
/* Some Klaro builds render inputs in more than one place.
   Hide all checkbox/radio inputs inside Klaro modal without breaking toggling. */
.klaro .cm-modal input[type="checkbox"],
.klaro .cm-modal input[type="radio"] {
  position: absolute !important;
  opacity: 0 !important;

  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;

  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;

  /* IMPORTANT: do NOT disable pointer-events, label toggles should still work */
  pointer-events: auto !important;

  appearance: none !important;
  -webkit-appearance: none !important;
}

/* Global “All services” row: keep switch from stretching too */
.klaro .cm-modal .cm-switch-container {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  align-items: start !important;
  padding: 12px 0 !important;
  border-top: 1px solid #ededed !important;
}

.klaro .cm-modal .cm-switch-container .cm-switch {
  height: 24px !important;
  max-height: 24px !important;
  align-self: start !important;
}
