/* Nexo shared on/off-switch motion.
   Existing and future switches using role=switch or .nexo-switch-* inherit
   the approved 280ms slow-in / slow-out movement. No geometry or colors here. */
:root {
 --nexo-switch-duration:280ms;
 --nexo-switch-easing:cubic-bezier(.42,0,.58,1);
}

/* Track fill and border glide. Affects only true on/off switches, not plain
   checkboxes, action buttons, chips or segmented month selectors. */
input[type="checkbox"][role="switch"],
button[role="switch"],
.nexo-switch-track,
.debt-payment-switch,
.tx-sheet-recurring input[type="checkbox"] {
 transition-property:background-color,border-color!important;
 transition-duration:var(--nexo-switch-duration)!important;
 transition-timing-function:var(--nexo-switch-easing)!important;
}

/* The knob never changes size: it only moves along the track. */
input[type="checkbox"][role="switch"]::before,
.tx-sheet-recurring input[type="checkbox"]::before,
.debt-payment-switch > .debt-payment-knob,
.visitor-switch-knob,
.nexo-switch-knob {
 transition-property:transform!important;
 transition-duration:var(--nexo-switch-duration)!important;
 transition-timing-function:var(--nexo-switch-easing)!important;
}

/* Match the more specific debt form rules in older CSS files. This keeps
   both debt switches synchronised without changing their functional inputs. */
html body #modal#modal #form#form[data-finance-type="contribution"] .debt-payment-switch,
html body #modal#modal #form#form[data-finance-type="debt"] .debt-payment-switch {
 transition:background-color var(--nexo-switch-duration) var(--nexo-switch-easing)!important;
}
html body #modal#modal #form#form[data-finance-type="contribution"] .debt-payment-switch > .debt-payment-knob,
html body #modal#modal #form#form[data-finance-type="debt"] .debt-payment-switch > .debt-payment-knob {
 transition:transform var(--nexo-switch-duration) var(--nexo-switch-easing)!important;
}

/* Accessibility is global, not limited to the phone viewport. */
@media(prefers-reduced-motion:reduce) {
 input[type="checkbox"][role="switch"],
 button[role="switch"],
 .nexo-switch-track,
 .debt-payment-switch,
 .tx-sheet-recurring input[type="checkbox"],
 input[type="checkbox"][role="switch"]::before,
 .tx-sheet-recurring input[type="checkbox"]::before,
 .debt-payment-switch > .debt-payment-knob,
 .visitor-switch-knob,
 .nexo-switch-knob,
 html body #modal#modal #form#form[data-finance-type="contribution"] .debt-payment-switch,
 html body #modal#modal #form#form[data-finance-type="debt"] .debt-payment-switch,
 html body #modal#modal #form#form[data-finance-type="contribution"] .debt-payment-switch > .debt-payment-knob,
 html body #modal#modal #form#form[data-finance-type="debt"] .debt-payment-switch > .debt-payment-knob {
  transition:none!important;
 }
}
