/********************************************************************************************************************************
 * Forms
********************************************************************************************************************************/

/**
 * General form styling
 */
.form-composite .fieldset-legend,
.form-type-select label,
.form-type-textfield label,
.form-type-textarea label,
.form-type-tel label,
.form-type-email label,
.form-type-number label {
  display: block;
  font-weight: 500;
}
.form-textarea-wrapper {
  margin-top: 0.333rem;
}
.form-textarea-wrapper textarea {
  padding: 0.333rem;
}
.button:first-child,
.form-actions .button:first-child {
  margin-right: 1rem;
  margin-left: 0;
}
.form-checkboxes input.form-checkbox,
.form-radios input.form-radio {
  margin-right: 0.25rem;
}
.inline-submit .form-item.form-type-textfield,
.inline-submit .form-actions,
.inline-fields .form-item,
.inline-fields .form-actions,
.inline-field.form-item {
  display: inline-block;
  margin: 0 1rem 0 0;
}

/**
 * Fieldsets & fieldgroups
 */
fieldset {
  border: 1px solid #ccc;
  padding-top: 0;
}
fieldset > .fieldset-wrapper > fieldset {
  border: none;
  border-bottom: 1px dotted #ddd;
  padding-left: 0;
  padding-right: 0;
}
fieldset > .fieldset-wrapper > fieldset:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
fieldset.large-heading > legend {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 1.1rem;
}
fieldset.large-heading > .fieldset-wrapper > fieldset > legend {
  text-transform: uppercase;
  letter-spacing: 1px;
}

/**
 * Bold labels for groups of checkboxes/radios
 */
.bold-group-label .section-label,
.bold-group-label > legend .fieldset-legend {
  font-weight: bold;
}

/**
 * Checkbox & radio styles with descriptions attached to each element
 */
label.option .label-title.with-description {
  margin-bottom: 0.25rem;
}
.form-type-checkbox span.description,
.form-type-radio span.description {
  display: block;
  margin-left: 0;
  padding-left: 1rem;
  font-size: 0.9rem;
}
.form-type-radio span.description img.pm-img {
  width: 20px;
}

/**
 * Checkbox & radio styles that have a grid layout for each element
 */
.grid-label .form-type-checkbox,
.grid-label .form-type-radio {
  display: grid;
  grid-template-columns: 14px auto;
  grid-column-gap: 5px;
  align-items: start;
}
.grid-label .form-type-checkbox .form-checkbox,
.grid-label .form-type-radio .form-radio {
  margin-top: 3px;
  margin-right: 0;
}
.grid-label label.option {
  line-height: 120%;
}
.grid-label label.option span.label-title,
.grid-label label.option span.description {
  display: block;
  padding-left: 0;
}

/**
 * Checkbox & radio options with labels that are 'inline-block' style
 */
.form-composite.inline-block-label .form-radios label.option,
.form-radios.inline-block-label label.option,
.form-radios input.inline-block-label + label {
  display: inline-block;
}
.form-composite.inline-block-label .form-radios label.option img.pm-img,
.form-radios.inline-block-label label.option img.pm-img,
.form-radios input.inline-block-label + label img.pm-img {
  float: left;
}

.form-type-radio,
.form-type-checkboxes {
  margin-block: 0.4rem;
  margin-inline-start: 1.25rem;
}

/**
 * Radio and checkbox items that are the child of a form item.
 */
.form-type-radio input.form-radio,
.form-type-checkboxes input.form-checkbox {
  position: relative;
  inset-block-start: 0.5rem;
  float: left; /* LTR */
  margin-inline-start: -1.25rem;
  transform: translateY(-50%);
}

/**
 * Styling for checkbox/radio descriptions.
 */
.form-checkboxes .congruent-label,
.form-checkboxes .congruent-description,
.form-radios .congruent-label,
.form-radios .congruent-description {
  display: block;
}
.form-checkboxes .congruent-description.description,
.form-radios .congruent-description.description {
  font-size: 0.95em;
  padding-left: 0;
}
.form-type-checkbox .congruent-description p,
.form-checkboxes .congruent-description p,
.form-radios .congruent-description p {
  margin-bottom: 0;
}

/**
 * Styling for checkboxes/radios that get darker if hovered or clicked
 */
label.option,
.form-type-checkbox label.option,
.form-radios label.option {
  font-weight: 300;
  opacity: 0.7;
}
.form-type-checkbox label:hover,
.form-radios label:hover,
.form-type-checkbox input[type="checkbox"]:checked + label,
.form-radios input[type="radio"]:checked + label {
  opacity: 1;
  font-weight: 400;
}
.form-composite .fieldset-legend,
.form-item.bold-label label,
.bold-label > .form-item label {
  font-weight: 400;
}
.form-type-checkbox input[type="checkbox"]:checked + label strong,
.form-radios input[type="radio"]:checked + label strong {
  font-weight: 600;
}
.form-type-checkbox label.option strong,
.form-radios label.option strong {
  font-weight: 500;
}
.form-composite .fieldset-legend {
  font-weight: 500;
}

/**
 * Styles where the radio button itself is hidden (showing only a button as label)
 */
input.hide-radio.form-radio,
.hide-radio.form-radio input[type="radio"] {
  opacity: 0;
  position: fixed;
  width: 0;
}
