/* Afaq v7.8.8 — Switch Spring: shared binary on/off controls across both portals.
   Inspired by the Kinetics Switch Spring effect; adapted to native checkbox
   inputs so existing WordPress forms, nonce checks and validation are untouched. */
.afaq-layout input.afaq-spring-switch[type="checkbox"] {
  --afaq-spring-width: 52px;
  --afaq-spring-height: 30px;
  --afaq-spring-travel: 22px;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-sizing: border-box !important;
  display: inline-block !important;
  position: relative !important;
  vertical-align: middle !important;
  flex: 0 0 var(--afaq-spring-width) !important;
  width: var(--afaq-spring-width) !important;
  min-width: var(--afaq-spring-width) !important;
  max-width: var(--afaq-spring-width) !important;
  height: var(--afaq-spring-height) !important;
  min-height: var(--afaq-spring-height) !important;
  max-height: var(--afaq-spring-height) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #c6d4d2 !important;
  border-radius: 999px !important;
  background: #dce6e4 !important;
  box-shadow: inset 0 1px 3px rgba(23, 51, 46, .09) !important;
  cursor: pointer;
  direction: ltr;
  transform: none !important;
  transition: background-color .28s ease, border-color .28s ease, box-shadow .28s ease !important;
  -webkit-tap-highlight-color: transparent;
}
.afaq-layout input.afaq-spring-switch[type="checkbox"]::before {
  content: "";
  display: block;
  position: absolute;
  inset: 3px auto auto 3px;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(22, 51, 44, .2), 0 1px 2px rgba(22, 51, 44, .12);
  transform: translateX(0);
  transition: transform .48s cubic-bezier(.22, 1.55, .42, 1), box-shadow .24s ease;
}
.afaq-layout input.afaq-spring-switch[type="checkbox"]:checked {
  background: #168c85 !important;
  border-color: #168c85 !important;
  box-shadow: inset 0 1px 3px rgba(3, 79, 71, .15) !important;
}
.afaq-layout input.afaq-spring-switch[type="checkbox"]:checked::before { transform: translateX(var(--afaq-spring-travel)); }
.afaq-layout input.afaq-spring-switch[type="checkbox"]:active::before { width: 22px; }
.afaq-layout input.afaq-spring-switch[type="checkbox"]:checked:active::before { transform: translateX(var(--afaq-spring-travel)); }
.afaq-layout input.afaq-spring-switch[type="checkbox"]:focus-visible {
  outline: 3px solid #86d9cc !important;
  outline-offset: 3px !important;
}
.afaq-layout input.afaq-spring-switch[type="checkbox"]:disabled {
  opacity: .48 !important;
  cursor: not-allowed !important;
  filter: grayscale(.4);
}
.afaq-layout label.afaq-spring-switch-label { cursor: pointer; }
.afaq-layout label.afaq-spring-switch-label:has(input:disabled) { cursor: not-allowed; }
/* Respect the established SaaS card layout and do not stretch switches. */
.afaq-layout .afaq-switch-row:has(.afaq-spring-switch),
.afaq-layout .afaq-feature-toggle:has(.afaq-spring-switch),
.afaq-layout .afaq-channel-toggle:has(.afaq-spring-switch),
.afaq-layout .afaq-preference-option:has(.afaq-spring-switch) { align-items: center !important; }
.afaq-layout .afaq-content-switches label:has(.afaq-spring-switch),
.afaq-layout .afaq-permissions label:has(.afaq-spring-switch),
.afaq-layout .afaq-form-grid label:has(.afaq-spring-switch) { display: inline-flex; align-items: center; gap: 10px; }
.afaq-layout .afaq-preference-option .afaq-spring-switch { margin-inline-start: auto !important; }
.afaq-layout .afaq-channel-toggle .afaq-spring-switch { margin-inline-start: auto !important; }
/* POST-backed toggles: display the persisted state and retain the existing action. */
.afaq-layout button.afaq-spring-action[role="switch"] {
  position: relative;
  box-sizing: border-box;
  display: inline-block;
  width: 52px;
  min-width: 52px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid #c6d4d2;
  border-radius: 999px;
  background: #dce6e4;
  cursor: pointer;
  vertical-align: middle;
  box-shadow: inset 0 1px 3px rgba(23,51,46,.09);
  transition: background-color .28s ease, border-color .28s ease;
}
.afaq-layout button.afaq-spring-action[role="switch"]::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(22,51,44,.2);
  transition: transform .48s cubic-bezier(.22,1.55,.42,1);
}
.afaq-layout button.afaq-spring-action[role="switch"][aria-checked="true"] { background:#168c85; border-color:#168c85; }
.afaq-layout button.afaq-spring-action[role="switch"][aria-checked="true"]::before { transform:translateX(22px); }
.afaq-layout button.afaq-spring-action[role="switch"]:focus-visible { outline:3px solid #86d9cc; outline-offset:3px; }
.afaq-layout button.afaq-spring-action[role="switch"]:disabled { opacity:.48; cursor:not-allowed; }
@media (prefers-reduced-motion: reduce) {
  .afaq-layout input.afaq-spring-switch[type="checkbox"],
  .afaq-layout input.afaq-spring-switch[type="checkbox"]::before,
  .afaq-layout button.afaq-spring-action[role="switch"],
  .afaq-layout button.afaq-spring-action[role="switch"]::before { transition:none !important; animation:none !important; }
}
/* Standalone binary fields should not inherit a vertical form-label grid. */
.afaq-layout label.afaq-spring-switch-label:not(.afaq-switch-row):not(.afaq-feature-toggle):not(.afaq-channel-toggle):not(.afaq-preference-option) {
  display: inline-flex !important;
  align-items: center !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 100%;
}
.afaq-layout .afaq-spring-action .screen-reader-text {
  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;
}

/* v7.16.55: compact spring switches inside table rows (Kinetics-inspired).
   Only persisted server state controls the visual check; submission does not fake success. */
.afaq-layout .afaq-saas-table .afaq-spring-action,
.afaq-layout .afaq-record-action-form .afaq-spring-action {
  touch-action: manipulation;
  vertical-align: middle;
}
.afaq-layout button.afaq-spring-action[role="switch"] {
  -webkit-tap-highlight-color: transparent;
  transform: translateZ(0);
  transition: background-color .24s ease, border-color .24s ease, box-shadow .24s ease;
}
.afaq-layout button.afaq-spring-action[role="switch"]::before {
  transition: transform .44s cubic-bezier(.22,1.5,.42,1),box-shadow .18s ease;
}
.afaq-layout button.afaq-spring-action[role="switch"]:active:not(:disabled)::before { width: 22px; }
.afaq-layout button.afaq-spring-action[role="switch"][aria-checked="true"]:active:not(:disabled)::before { transform: translateX(22px); }
.afaq-layout button.afaq-spring-action[role="switch"][aria-busy="true"] { cursor: progress; opacity: .65; }
.afaq-layout button.afaq-spring-action[role="switch"]:hover:not(:disabled) { box-shadow: 0 0 0 3px rgba(22,140,133,.12),inset 0 1px 3px rgba(23,51,46,.09); }
@media (prefers-reduced-motion: reduce) {
  .afaq-layout button.afaq-spring-action[role="switch"],
  .afaq-layout button.afaq-spring-action[role="switch"]::before { transition:none !important; }
}

/* v7.16.57 — geometry lock: the switch track stays 52x30px and the thumb
   remains 22x22px in all states; no width stretching on press or in tables.
   Spring easing affects only movement, never dimensions. */
.afaq-layout input.afaq-spring-switch[type="checkbox"],
.afaq-layout button.afaq-spring-action[role="switch"] {
  width: 52px !important; min-width: 52px !important; max-width: 52px !important;
  height: 30px !important; min-height: 30px !important; max-height: 30px !important;
  padding: 0 !important; flex: 0 0 52px !important;
  box-sizing: border-box !important;
  line-height: normal !important; font-size: 0 !important;
  direction: ltr !important; overflow: visible;
}
.afaq-layout input.afaq-spring-switch[type="checkbox"]::before,
.afaq-layout button.afaq-spring-action[role="switch"]::before {
  width: 22px !important; min-width: 22px !important; max-width: 22px !important;
  height: 22px !important; min-height: 22px !important; max-height: 22px !important;
  top: 3px !important; left: 3px !important; right: auto !important; bottom: auto !important;
  margin: 0 !important; padding: 0 !important;
  box-sizing: border-box !important;
}
.afaq-layout input.afaq-spring-switch[type="checkbox"]:active::before,
.afaq-layout button.afaq-spring-action[role="switch"]:active:not(:disabled)::before {
  width: 22px !important;
}
.afaq-layout input.afaq-spring-switch[type="checkbox"]:checked:active::before {
  transform: translateX(22px) !important;
}
.afaq-layout button.afaq-spring-action[role="switch"][aria-checked="true"]:active:not(:disabled)::before {
  transform: translateX(22px) !important;
}
