/* CSS related to forms and form fields */

.asteriskField {
  color: var(--bs-link-color);
  transform: scale(2) translateY(0.1em) translateX(0.1em);
  display: inline-flex;
  margin-left: 0.2em;
}
.hide-required-field-hints .asteriskField {
  display: none;
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.form-check-label {
  font-weight: 400;
  cursor: pointer;
}
.form-text {
  font-weight: 400;
}

legend.form-label {
  font-size: inherit;
}

.form-control,
.form-select {
  padding: 0.6rem 0.75rem;
}
.form-select {
  /* Needs extra right padding to make room for dropdown arrow */
  padding-right: 2.5rem;
}

input[disabled] { cursor: not-allowed; }

label:has(input[type="checkbox"]),
label:has(input[type="radio"]) {
  cursor: pointer;
}

.form-check-input,
.form-control,
.form-select {
  --bs-border-color: var(--color-border-strong);
  cursor: pointer;
}

.form-check-input,
.form-check-label,
.form-check {
  cursor: pointer;
}

.form-check-input:checked {
  background-color: var(--color-highlight);
  border-color: var(--color-highlight);
}
.form-check-input:focus {
  box-shadow: inherit;
}
.form-check-input:not(:checked):focus {
  border-color: var(--bs-border-color);
}

.form-check-input-lg {
  width: 1.5em;
  height: 1.5em;
  margin-top: 0.1em;
}
.form-check-label .form-check-input {
  margin-top: 0.22em;
  margin-right: 0.24em;
}

.form-submitting {
  transition: opacity 0.2s ease-in-out;
  opacity: 0.5;
}

main form > button[type="submit"]:last-child {
  margin-top: 3rem;
}

/* Org.countries multiselect widget */
#div_id_countries > fieldset > div {
  overflow: scroll;
  max-height: 16em;
  padding: 0.375rem 2.25rem 0.375rem 0.75rem;
  border: var(--bs-border-width) solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
}

/* Participants form date widget */
.customselectdatewidget.form-control {
  width: 16ch;
  display: inline-flex;
}
.customselectdatewidget.form-control + .customselectdatewidget.form-control {
  margin: 0 0 0 0.5rem;
}
@media (max-width: 576px) {
  .customselectdatewidget.form-control {
    width: 100%;
  }
  .customselectdatewidget.form-control + .customselectdatewidget.form-control {
    margin: 0.25rem 0 0 0;
  }
}

/* To reduce clutter, only show LastPass icon and dropdown for form fields where it's useful. */
/* Doing this with CSS might be brittle but simple for now compared to figuring out how to */
/* get LastPass to ignore fields by adding attributes to all the form fields. */
:not(
    #div_id_password,
    #div_id_login,
    #div_id_oldpassword,
    #div_id_password1,
    #div_id_password2
  )
  > :is(div[data-lastpass-icon-root], div[data-lastpass-root]) {
  display: none;
}
