/* ----------------------------------
 * CHECKBOXES / RADIOS
 * ---------------------------------- */

label.pack-checkbox,
label.pack-radio,
label.pack-switch {
  display: inline-block;
  vertical-align: middle;
  width: 5rem;
  height: 5rem;
  position: relative;
  background: none;
}

label.pack-checkbox input,
label.pack-radio input,
label.pack-switch input {
  margin: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
}

label.pack-checkbox input + span,
label.pack-radio input + span {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -1.1rem 0 0 -1.1rem;
  width: 2.2rem;
  height: 2.2rem;
  pointer-events: none;
}

label.pack-checkbox input + span {
  background: url(switches/images/check/default.png) no-repeat center top / 2.2rem auto;
}

label.pack-radio input + span {
  background: url(switches/images/radio/default.png) no-repeat center top / 2.2rem auto;
}

label.pack-checkbox input:checked + span,
label.pack-radio input:checked + span,
label.pack-switch input:checked + span {
  background-position: center bottom;
}

/* 'Dangerous' switches */

label.pack-checkbox.danger input + span {
  background-image: url(switches/images/check/danger.png);
}

label.pack-radio.danger input + span {
  background-image: url(switches/images/radio/danger.png);
}


/* ----------------------------------
 * ON/OFF SWITCHES
 * ---------------------------------- */

label.pack-switch input + span {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -1.1rem 0 0 -2.7rem;
  width: 5.1rem;
  height: 2.1rem;
  pointer-events: none;
  border-radius: 1.2rem;
  border: 0.1rem solid #c2c2c2;
  overflow: hidden;
  background: #e6e6e6 url(switches/images/switch/background_off.png) no-repeat -3.2rem 0 / 8.3rem 2.1rem;
  transition: background 0.2s ease, border 0.2s ease;
}

/* switch: 'ON' state */
label.pack-switch input:checked + span {
  background: #e6e6e6 url(switches/images/switch/background.png) no-repeat 0 0 / 8.3rem 2.1rem;
  border-color: #00abcd;
}

/* switch: disabled state */
label.pack-switch input:disabled + span {
  opacity: 0.4;
}

label.pack-switch input.uninit + span {
  transition: none;
}