/* FORM SECTIONS */
.form-section { /* Separate fields into sections */
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-section-row { /* Separate fields into sections */
  display: flex;
  flex-direction: row;
  gap: 1rem;

  @media screen and (max-width
  : 768px) {  /* var(--screen-md) */
    flex-direction: column;
  }
}

section.field-section {
  align-items: flex-start;
  display: flex;
  flex-direction: row;
  gap: 1rem;

  .field {
    flex-direction: row;

    .heading-wrapper {
      flex: 1;
    }

    .form-input {
      max-width: var(--container-s);
      min-width: var(--container-s);
    }
  }

  &.checkbox-toggle { /* Used with JS */
    &:has(input[type="checkbox"]:checked) .form-input {
      opacity: 1;
      user-select: auto;
      cursor: pointer;
      pointer-events: auto;
    }

    .field .form-input {
      max-width: var(--container-s);
      min-width: var(--container-s);
      opacity: 0.25;
      pointer-events: none;
      transition: 0.4s ease-in-out;
      user-select: none;
    }
  }

  &.field-section-v {

    .field {
      flex-direction: column;
      gap: 0.5rem;

      .form-input {
        max-width: unset;
        min-width: unset;
      }

      .other-field.hidden {
        display: contents;
      }
    }
  }
}

/* INLINE FIELDS */
.inline-field {
  align-items: center;
  flex-direction: row;
  gap: 1rem;

  .field {
    max-width: var(--container-s);
    min-width: var(--container-s);
  }

  @media screen and (max-width: 768px) {  /* var(--screen-md) */
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;

    .field {
      max-width: unset;
      min-width: unset;
    }
  }
}

.inline-field-wrapper {
  align-items: center;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 1rem;
  width: 100%;

  .inline-field {
    flex: 1;
  }

  .inline-field--large {
    flex: 2 1 0;
  }

  &:has(.field-count) {
    p.field-count {
      flex: 1;
      max-width: var(--container-xxs);

      &:has(+ .inline-field) + .inline-field {
        border-left: 1px solid var(--light-gray);
        padding-left: 1rem;
      }
    }
  }

  @media screen and (max-width: 768px) {  /* var(--screen-md) */
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;

    .inline-field {
      order: 1;
    }

    .inline-form-actions {
      order: 2;
    }

    &:has(.field-count) {
      p.field-count {
        order: 3;
        max-width: unset;
        min-width: 100%;

        &:has(+ .inline-field) + .inline-field {
          border-left: unset;
          padding-left: 0;
        }
      }
    }
  }
}

/* DRAG AND DROP */
.drag-drop-container .draggable-row {
  &.dragged-ghost, &.dragged-row {
    background-color: var(--theme-tenth-opacity-color);
  }
}

/* Row of 2 links, separated */
.form-links {
  align-items: center;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 1rem;
  justify-content: space-between;
  text-align: center;
  width: 100%;

  @media screen and (max-width: 768px) {  /* var(--screen-md) */
    flex-direction: column;
  }
}

/*RYAL-2818: Review*/
section {
  &.section-border {
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 0.5rem
  }
}

.attribute-form {
  .form-label {
    line-height: 1.5rem;
  }

  .inline-field-wrapper {
    align-items: flex-end;
  }
}
