/* Shared native form controls. Inputs remain the source of truth. */
html.has-scripts:not([data-form-fields-ready]) .field-tooltip,
html.has-scripts:not([data-form-fields-ready]) .org-tooltip { display: none; }
html:not(.has-scripts):not([data-form-fields-ready]) .field-help-toggle,
html:not(.has-scripts):not([data-form-fields-ready]) .org-help-toggle { display: none; }
.musician-draft-form input[type="file"]::file-selector-button { margin-right: 14px; padding: 9px 14px; border: 1px solid var(--page-input-line); border-radius: 7px; background: var(--page-soft); color: var(--page-text); font: inherit; font-size: 13px; cursor: pointer; }
.musician-draft-form input[type="file"]::file-selector-button:hover { border-color: var(--page-accent-text); }
.org-field-invalid input:not([type="checkbox"]):not([type="radio"]),
.org-field-invalid textarea,
.org-field-invalid select { border-color: var(--page-error, #a43b32); }
.reference-choices label,
.org-choices:not(:has(.org-gallery-choice)) label,
.single-checkbox,
.org-check {
  min-height: 44px;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--page-input-line);
  border-radius: 9px;
  background: var(--page-surface);
  color: var(--page-text);
  transition: border-color .14s ease, background-color .14s ease, box-shadow .14s ease, opacity .14s ease;
}

.reference-choices label:hover,
.org-choices:not(:has(.org-gallery-choice)) label:hover,
.single-checkbox:hover,
.org-check:hover {
  border-color: var(--page-accent-text);
}

.reference-choices label:has(input:checked),
.org-choices:not(:has(.org-gallery-choice)) label:has(input:checked),
.single-checkbox:has(input:checked),
.org-check:has(input:checked) {
  border-color: var(--page-accent-text);
  background: color-mix(in srgb, var(--page-accent-text) 11%, var(--page-surface));
  box-shadow: inset 0 0 0 1px var(--page-accent-text);
  color: var(--page-accent-text);
}

.reference-choices label:has(input:focus-visible),
.org-choices:not(:has(.org-gallery-choice)) label:has(input:focus-visible),
.single-checkbox:has(input:focus-visible),
.org-check:has(input:focus-visible) {
  outline: 2px solid var(--page-focus);
  outline-offset: 3px;
}

.reference-choices input:focus-visible,
.org-choices:not(:has(.org-gallery-choice)) input:focus-visible,
.single-checkbox input:focus-visible,
.org-check input:focus-visible {
  outline: 0;
}

.org-field-heading > label:has(.org-field-label-icon) {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.org-field-label-icon {
  flex: 0 0 18px;
  filter: var(--icon-filter);
}

.reference-choices input[type="checkbox"],
.org-choices:not(:has(.org-gallery-choice)) input[type="checkbox"],
.single-checkbox input[type="checkbox"],
.org-check input[type="checkbox"],
.org-choices:not(:has(.org-gallery-choice)) input[type="radio"] {
  appearance: none;
  position: relative;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--page-input-line);
  background: var(--page-surface);
  color: var(--page-accent-text);
}

.reference-choices input[type="checkbox"],
.org-choices:not(:has(.org-gallery-choice)) input[type="checkbox"],
.single-checkbox input[type="checkbox"],
.org-check input[type="checkbox"] {
  border-radius: 5px;
}

.org-choices:not(:has(.org-gallery-choice)) input[type="radio"] {
  border-radius: 50%;
}

.reference-choices input[type="checkbox"]::after,
.org-choices:not(:has(.org-gallery-choice)) input[type="checkbox"]::after,
.single-checkbox input[type="checkbox"]::after,
.org-check input[type="checkbox"]::after {
  width: 14px;
  height: 14px;
  background: currentColor;
  mask: url("icons/check.82cc024e9e1f.svg") center / contain no-repeat;
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  opacity: 0;
  transform: scale(.8);
  transition: opacity .14s ease, transform .14s ease;
}

.org-choices:not(:has(.org-gallery-choice)) input[type="radio"]::after {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .14s ease, transform .14s ease;
}

.reference-choices input:checked,
.org-choices:not(:has(.org-gallery-choice)) input:checked,
.single-checkbox input:checked,
.org-check input:checked {
  border-color: currentColor;
}

.reference-choices input:checked::after,
.org-choices:not(:has(.org-gallery-choice)) input:checked::after,
.single-checkbox input:checked::after,
.org-check input:checked::after {
  opacity: 1;
  transform: scale(1);
}

.org-choices:not(:has(.org-gallery-choice)) input[type="radio"]:checked::after {
  transform: scale(1);
}

.reference-choices label:has(input:disabled),
.org-choices:not(:has(.org-gallery-choice)) label:has(input:disabled),
.single-checkbox:has(input:disabled),
.org-check:has(input:disabled) {
  cursor: not-allowed;
  opacity: .52;
}

.field-invalid .reference-choices label,
.field-invalid .single-checkbox,
.org-field-invalid .org-choices:not(:has(.org-gallery-choice)) label,
.org-field-invalid .org-check {
  border-color: var(--page-accent-text);
}

.field-help-control,
.org-help-control { position: relative; display: inline-flex; }

.field-help-toggle,
.org-help-toggle {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--page-muted);
  cursor: pointer;
}

.field-help-toggle:hover,
.org-help-toggle:hover { background: var(--page-soft); color: var(--page-text); }
.field-help-toggle:focus-visible,
.org-help-toggle:focus-visible { outline: 2px solid var(--page-focus); outline-offset: 2px; }
.field-help-toggle img,
.org-help-toggle img { width: 18px; height: 18px; filter: var(--icon-filter); }

.field-tooltip,
.org-tooltip { color: var(--page-muted); font-size: 13px; font-weight: 400; line-height: 1.5; }

html:not([data-form-fields-ready]) .musician-draft-form .field-tooltip,
html:not([data-form-fields-ready]) .org-tooltip {
  position: static;
  z-index: auto;
  display: block;
  width: auto;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

html[data-form-fields-ready] .field-tooltip,
html[data-form-fields-ready] .org-tooltip {
  position: fixed;
  inset: auto;
  z-index: 1000;
  width: min(260px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--page-input-line, var(--center-input-line, #a59f98));
  border-radius: 8px;
  background: var(--page-surface, var(--center-surface, #fff));
  color: var(--page-body, var(--center-text, #242321));
  box-shadow: 0 10px 26px rgb(0 0 0 / .14);
  font-size: 13px;
  line-height: 1.5;
  opacity: 1;
  animation: form-tooltip-in .14s ease both;
}

@keyframes form-tooltip-in { from { opacity: 0; } to { opacity: 1; } }

@media (pointer: coarse) {
  .field-help-toggle,
  .org-help-toggle { width: 44px; height: 44px; margin: -6px; }
}

@media (prefers-reduced-motion: reduce) {
  .reference-choices label,
  .org-choices:not(:has(.org-gallery-choice)) label,
  .single-checkbox,
  .org-check,
  .reference-choices input::after,
  .org-choices:not(:has(.org-gallery-choice)) input::after,
  .field-tooltip,
  .org-tooltip { transition: none; animation: none; }
}
