input.ios-checkbox {
  display: none;
  cursor: pointer;
}

input.ios-checkbox + label {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  background-color: #9c9999;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease-out;
}

input.ios-checkbox + label::before {
  content: '✖';
  font-family: Arial, Helvetica, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  width: 24px;
  height: 24px;
  border-radius: 100%;
  background-color: white;
  position: absolute;
  top: 2px;
  right: 4px;
  transition: all 0.3s ease-out;
  font-size: 16px;
  font-weight: normal;
  color: rgb(189, 3, 3);
  border: 1px solid rgb(214, 3, 3);
  text-align: center;
}

input.ios-checkbox + label::after {
  content: attr(data-deny);
  position: absolute;
  top: 0;
  left: 60px;
  font-size: 18px;
  font-weight: 300;
  transition: all 0.3s ease-out;
}

input.ios-checkbox:checked + label {
  background-color: #28a745;
}

input.ios-checkbox:checked + label::before {
  content: "✔";
  right: 25px;
  color: #28a745;
  border-color: #04d334;
}

input.ios-checkbox:checked + label::after {
  content: attr(data-permit);
  left: 58px;
}

.toggle-switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  direction: rtl;
  width: 100%;
}

.toggle-switch > input.ios-checkbox {
  display: block;
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-switch > .toggle-switch-control {
  flex-shrink: 0;
  margin: 0;
}

.toggle-switch > .toggle-switch-label {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.toggle-switch > input.ios-checkbox:focus-visible + label {
  outline: 2px solid var(--accent-color, #007bff);
  outline-offset: 3px;
}

.toggle-switch > input.ios-checkbox:disabled + label,
.toggle-switch > input.ios-checkbox:disabled ~ .toggle-switch-label {
  opacity: 0.6;
  cursor: not-allowed;
}
