/*
 * ZAJEDNIČKI CHECKBOX SUSTAV
 * -------------------------
 * Standardizira klasične checkbox kontrole. Namjenski prekidači i kartične
 * kontrole ostaju u vlasništvu svojih komponenti, ali dijele isti fokusni
 * obrazac i tematske tokene.
 */

:where(label) :where(input[type="checkbox"]) {
  font: inherit;
}

:where(label):not(.admin-community-toggle):not(.admin-navigation-toggle):not(.admin-location-program-toggle):not(.admin-offering-choice):not(.admin-tool-toggle):not(.author-tool-card):not(.competition-school-choice):not(.my-teaching-schedule-shift-toggle):not(.profile-reminders-toggle):not(.school-teaching-combination-toggle):not(.school-teaching-notice-switch):not(.students-setting-toggle):not(.upload-attestation):not(.admin-weekend-switch):has(input[type="checkbox"]) {
  min-height: 44px;
  box-sizing: border-box;
  cursor: pointer;
}

:where(label):not(.admin-community-toggle):not(.admin-navigation-toggle):not(.admin-location-program-toggle):not(.admin-offering-choice):not(.admin-tool-toggle):not(.author-tool-card):not(.competition-school-choice):not(.my-teaching-schedule-shift-toggle):not(.profile-reminders-toggle):not(.school-teaching-combination-toggle):not(.school-teaching-notice-switch):not(.students-setting-toggle):not(.upload-attestation):not(.admin-weekend-switch) input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 22px !important;
  min-width: 22px !important;
  height: 22px !important;
  min-height: 22px !important;
  flex: 0 0 22px;
  margin: 0;
  padding: 0 !important;
  border: 1px solid var(--uis-line-strong, rgba(132, 201, 190, .48)) !important;
  border-radius: 7px !important;
  outline: 0;
  color: var(--uis-head, #071d31);
  background-color: var(--uis-inset, #173d3a) !important;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 14px 14px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--uis-text, #f3f7f3) 5%, transparent);
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease, opacity .16s ease;
}

:where(label):not(.admin-community-toggle):not(.admin-navigation-toggle):not(.admin-location-program-toggle):not(.admin-offering-choice):not(.admin-tool-toggle):not(.author-tool-card):not(.competition-school-choice):not(.my-teaching-schedule-shift-toggle):not(.profile-reminders-toggle):not(.school-teaching-combination-toggle):not(.school-teaching-notice-switch):not(.students-setting-toggle):not(.upload-attestation):not(.admin-weekend-switch) input[type="checkbox"]:hover {
  border-color: var(--uis-accent, #79d9c2) !important;
}

:where(label):not(.admin-community-toggle):not(.admin-navigation-toggle):not(.admin-location-program-toggle):not(.admin-offering-choice):not(.admin-tool-toggle):not(.author-tool-card):not(.competition-school-choice):not(.my-teaching-schedule-shift-toggle):not(.profile-reminders-toggle):not(.school-teaching-combination-toggle):not(.school-teaching-notice-switch):not(.students-setting-toggle):not(.upload-attestation):not(.admin-weekend-switch) input[type="checkbox"]:checked {
  border-color: var(--uis-accent, #79d9c2) !important;
  background-color: var(--uis-accent, #79d9c2) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8.2 3.1 3.1L13 4.7' fill='none' stroke='%23071d31' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--uis-accent, #79d9c2) 15%, transparent);
}

/* Modalne površine imaju starija !important background pravila za sva polja. */
body[data-interface-theme] :is(#adminPortalModal,#adminPortalChildModal) > .admin-modal :where(label):not(.admin-community-toggle):not(.admin-navigation-toggle):not(.admin-location-program-toggle):not(.admin-offering-choice):not(.admin-tool-toggle):not(.author-tool-card):not(.competition-school-choice):not(.my-teaching-schedule-shift-toggle):not(.profile-reminders-toggle):not(.school-teaching-combination-toggle):not(.school-teaching-notice-switch):not(.students-setting-toggle):not(.upload-attestation):not(.admin-weekend-switch) input[type="checkbox"]:checked {
  background: var(--uis-accent, #79d9c2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8.2 3.1 3.1L13 4.7' fill='none' stroke='%23071d31' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px 14px no-repeat !important;
}

:where(label):not(.admin-community-toggle):not(.admin-navigation-toggle):not(.admin-location-program-toggle):not(.admin-offering-choice):not(.admin-tool-toggle):not(.author-tool-card):not(.competition-school-choice):not(.my-teaching-schedule-shift-toggle):not(.profile-reminders-toggle):not(.school-teaching-combination-toggle):not(.school-teaching-notice-switch):not(.students-setting-toggle):not(.upload-attestation):not(.admin-weekend-switch) input[type="checkbox"]:disabled {
  opacity: .45;
  cursor: not-allowed;
}

:where(label):not(.admin-community-toggle):not(.admin-navigation-toggle):not(.admin-location-program-toggle):not(.admin-offering-choice):not(.admin-tool-toggle):not(.author-tool-card):not(.competition-school-choice):not(.my-teaching-schedule-shift-toggle):not(.profile-reminders-toggle):not(.school-teaching-combination-toggle):not(.school-teaching-notice-switch):not(.students-setting-toggle):not(.upload-attestation):not(.admin-weekend-switch):has(input[type="checkbox"]:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--uis-accent, #79d9c2) 36%, transparent);
  outline-offset: 3px;
}

:where(label):has(input[type="checkbox"]:disabled) {
  cursor: not-allowed;
}

/* Stari tekstualni redovi sada su stvarne kartične kontrole. */
.author-ai-legal label,
.admin-board-check,
.management-required,
.travel-order-check {
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--uis-line, rgba(132, 201, 190, .26));
  border-radius: 11px;
  color: var(--uis-text, #f3f7f3);
  background: var(--uis-inset, #173d3a);
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.author-ai-legal label:hover,
.admin-board-check:hover,
.management-required:hover,
.travel-order-check:hover,
.author-ai-legal label:has(input:checked),
.admin-board-check:has(input:checked),
.management-required:has(input:checked),
.travel-order-check:has(input:checked) {
  border-color: color-mix(in srgb, var(--uis-accent, #79d9c2) 60%, var(--uis-line, transparent));
  background: color-mix(in srgb, var(--uis-accent, #79d9c2) 10%, var(--uis-inset, #173d3a));
}

/* Namjenske skrivene kontrole dobivaju fokus oko cijele kartice. */
:where(.admin-community-toggle,.admin-navigation-toggle,.admin-location-program-toggle,.admin-offering-choice,.admin-tool-toggle,.author-tool-card,.competition-school-choice,.my-teaching-schedule-shift-toggle,.profile-reminders-toggle,.school-teaching-combination-toggle,.school-teaching-notice-switch,.students-setting-toggle,.upload-attestation,.admin-weekend-switch):has(input[type="checkbox"]:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--uis-accent, #79d9c2) 36%, transparent);
  outline-offset: 3px;
}

body[data-interface-surface="glass"] :where(label):not(.admin-community-toggle):not(.admin-navigation-toggle):not(.admin-location-program-toggle):not(.admin-offering-choice):not(.admin-tool-toggle):not(.author-tool-card):not(.competition-school-choice):not(.my-teaching-schedule-shift-toggle):not(.profile-reminders-toggle):not(.school-teaching-combination-toggle):not(.school-teaching-notice-switch):not(.students-setting-toggle):not(.upload-attestation):not(.admin-weekend-switch) input[type="checkbox"] {
  border-color: var(--uig-line, var(--uis-line-strong)) !important;
  background-color: var(--uig-inset, var(--uis-inset)) !important;
}

body[data-interface-surface="glass"] :where(label):not(.admin-community-toggle):not(.admin-navigation-toggle):not(.admin-location-program-toggle):not(.admin-offering-choice):not(.admin-tool-toggle):not(.author-tool-card):not(.competition-school-choice):not(.my-teaching-schedule-shift-toggle):not(.profile-reminders-toggle):not(.school-teaching-combination-toggle):not(.school-teaching-notice-switch):not(.students-setting-toggle):not(.upload-attestation):not(.admin-weekend-switch) input[type="checkbox"]:checked {
  border-color: var(--uis-accent) !important;
  background-color: var(--uis-accent) !important;
}

@media (max-width: 620px) {
  :where(label):has(input[type="checkbox"]) {
    min-width: 0;
  }
}
