/**
 * @file
 * Visual styles for form components.
 */

form .field-multiple-table {
  margin: 0;
}
form .field-multiple-table .field-multiple-drag {
  width: 30px;
  padding-inline-end: 0;
}
form .field-multiple-table .field-multiple-drag .tabledrag-handle {
  padding-inline-end: 0.5em;
}
form .field-add-more-submit {
  margin: var(--spc-sm) 0 0;
}

/**
 * Markup generated by Form API.
 */
.form-item,
.form-actions {
  margin-block: var(--spc);
  display: grid;
  justify-content: start;
}
tr.odd .form-item,
tr.even .form-item {
  margin-block: 0;
}
.form-item .form-item {
  margin-block: unset;
}

/* Form input widths are a bit challenging because of the variety of situations, especially in webform */

/* initially make all .form-item direct children 100% in the flexbox */
.form-item > * {
  width: 100%;
}
/* but nested .form-item divs need to not be 100%, as well as some other elements */
.form-item .form-item > *,
.form-item .form-date,
.form-item .form-time {
  width: unset;
}

/* except for comment forms */
.comment-comment-form .form-item .form-item > * {
  width: 100%;
}

/* if an input has prefix and/or suffix, it needs to not be 100% either, but the label does */
.form-item.webform-has-field-prefix > *,
.form-item.webform-has-field-suffix > * {
  width: unset;
}
.form-item.webform-has-field-prefix,
.form-item.webform-has-field-suffix {
  justify-content: flex-start;
  column-gap: var(--spc-xsm);
}
.form-item.webform-has-field-prefix label,
.form-item.webform-has-field-suffix label,
.form-item.webform-has-field-prefix .description,
.form-item.webform-has-field-suffix .description {
  flex: 0 0 100%;
}
.form-item .field-prefix,
.form-item .field-suffix {
  padding: var(--spc-sm);
  line-height: var(--lh-form);
}

.form-item label:not(.option) {
  margin-block-end: var(--spc-sm);
  font-weight: 600;
}

.form-item input,
.form-item textarea,
.form-item select {
  padding: var(--spc-sm);
}

input:focus {
  outline-width: 2px;
  outline-style: auto;
  outline-color: Highlight;
  outline-color: var(--steelblue);
}

/* Webform Fieldsets  */
fieldset.webform-type-fieldset {
  border: 1px solid var(--grey-xlt);
  border-radius: var(--spc-xsm);
}
fieldset.webform-type-fieldset legend {
  padding-inline: var(--spc-sm);
  font-weight: 500;
  font-size: var(--fs-bitlg);
}



/* Form composite  */

.form-composite > .fieldset-wrapper > .description,
.form-item .description {
  font-size: 0.85em;
}


label.option {
  display: inline;
  font-weight: normal;
}
.form-composite > legend,
.label {
  display: inline;
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-weight: 600;
}

/* Checkboxes */
.form-item.form-type-checkbox > * {
  width: auto;
}

input[type=checkbox] {
    transform: scale(1.33);
    margin-inline-end: var(--spc-sm);
    margin-inline-start: var(--spc-xsm);
}

.webform-options-display-one-column .form-item {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: var(--spc-sm);
  grid-template-areas: 
  "box label"
  "space desc";
  justify-items: start;
  
}
.webform-options-display-one-column input {
  grid-area: box;
}
.webform-options-display-one-column label {
  grid-area: label;
  margin-block: 0;
}
.webform-options-display-one-column .description {
  grid-area: desc;
}

.form-checkboxes .form-item {
  margin-block: var(--spc-sm);
  margin-inline-end: var(--spc-lg);
}

/* Radios */
.form-radios .form-item {
  margin-block: var(--spc-sm);
}

.form-item.form-item-radios > * {
  width: auto;
}
.form-item .form-item.form-item-webform-scale > * {
  width: 36px;
}

/* Radios in a table (likert) */
.webform-likert-table .form-type-radio {
  justify-content: center;
}


.marker {
  color: #e00;
}
.form-required:after {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 0.3em;
  content: "";
  vertical-align: super;
  /* Use a background image to prevent screen readers from announcing the text. */
  background-image: url(../../images/icons/required.svg);
  background-repeat: no-repeat;
  background-size: 6px 6px;
}
abbr.tabledrag-changed,
abbr.ajax-changed {
  border-bottom: none;
}
.form-item input.error,
.form-item textarea.error,
.form-item select.error {
  border: 2px solid red;
}

/* Inline error messages. */
.form-item--error-message:before {
  display: inline-block;
  width: 14px;
  height: 14px;
  content: "";
  vertical-align: sub;
  background: url(../../images/icons/error.svg) no-repeat;
  background-size: contain;
}

.form-actions .button {
  padding: var(--spc-sm) var(--spc);
  font-weight: 500;
  font-size: var(--fs-bitlg);
}

/* Comment form buttons */
.comment-form .form-actions {
  grid-template-columns: auto 1fr;
  justify-items: start;
}