/* Inasto – gemeinsame Kontrollfelder.
   Wird nach den jeweiligen Seitenstilen geladen, damit Checkboxen und Radios in
   Kanzlei-Hub, Buchhaltungssoftware, Werkzeugen und Neuaufnahme gleich aussehen. */

:where(input[type="checkbox"]:not(.no-modern),
       input[type="radio"]:not(.no-modern)) {
  -webkit-appearance: none !important;
  appearance: none !important;
  box-sizing: border-box !important;
  display: inline-grid !important;
  place-content: center !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 20px !important;
  position: relative !important;
  vertical-align: -4px !important;
  border: 2px solid color-mix(in srgb, var(--violet, #382D5E) 32%, var(--card, #FFFFFF)) !important;
  background: var(--card, #FFFFFF) !important;
  box-shadow: 0 1px 2px rgba(38,31,64,.08) !important;
  cursor: pointer !important;
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease, transform .08s ease !important;
}

:where(input[type="checkbox"]:not(.no-modern)) {
  border-radius: 6px !important;
}

:where(input[type="radio"]:not(.no-modern)) {
  border-radius: 50% !important;
}

:where(input[type="checkbox"]:not(.no-modern)):hover,
:where(input[type="radio"]:not(.no-modern)):hover {
  border-color: var(--violet, #382D5E) !important;
}

:where(input[type="checkbox"]:not(.no-modern)):focus-visible,
:where(input[type="radio"]:not(.no-modern)):focus-visible {
  outline: none !important;
  box-shadow: var(--focus, 0 0 0 3px rgba(56,45,94,.28)) !important;
}

:where(input[type="checkbox"]:not(.no-modern)):active,
:where(input[type="radio"]:not(.no-modern)):active {
  transform: scale(.94);
}

:where(input[type="checkbox"]:not(.no-modern)):checked {
  background: var(--violet, #382D5E) !important;
  border-color: var(--violet, #382D5E) !important;
}

/* Der Haken wird als zentriertes L aufgebaut. Dadurch bleibt er bei Browserzoom,
   unterschiedlichen Schriftgrößen und auf Mobilgeräten exakt mittig. */
:where(input[type="checkbox"]:not(.no-modern))::before {
  content: "";
  box-sizing: border-box;
  width: 6px;
  height: 10px;
  border: solid #FFFFFF;
  border-width: 0 2.4px 2.4px 0;
  transform: translateY(-1px) rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform .1s ease;
}

:where(input[type="checkbox"]:not(.no-modern)):checked::before {
  transform: translateY(-1px) rotate(45deg) scale(1);
}

:where(input[type="checkbox"]:not(.no-modern))::after {
  content: none !important;
}

:where(input[type="radio"]:not(.no-modern)):checked {
  border-color: var(--violet, #382D5E) !important;
}

:where(input[type="radio"]:not(.no-modern))::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--violet, #382D5E);
  transform: scale(0);
  transition: transform .1s ease;
}

:where(input[type="radio"]:not(.no-modern)):checked::before {
  transform: scale(1);
}

:where(input[type="radio"]:not(.no-modern))::after {
  content: none !important;
}

:where(input[type="checkbox"]:not(.no-modern),
       input[type="radio"]:not(.no-modern)):disabled {
  opacity: .5 !important;
  cursor: not-allowed !important;
}

:where(label.chkline, label.check, .chkline, .check) {
  display: flex !important;
  align-items: center;
  gap: 9px;
}

@media (max-width: 768px) {
  :where(label.chkline, label.check, .chkline, .check) {
    min-height: 44px;
  }
  :where(input[type="checkbox"]:not(.no-modern),
         input[type="radio"]:not(.no-modern)) {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    flex-basis: 22px !important;
  }
}

