@import "../base/020_base.scss";

form.simple_form {
  margin: 0 0 1em 0;

  fieldset.inline-fieldset {
    > label {
      display: block;
      font-weight: bold;
    }

    div.input {
      display: inline;
      margin-right: 2em;
    }
  }

  div.input.boolean {
    label {
      display: inline;
      font-weight: normal;
      vertical-align: middle;
    }

    input {
      margin-right: 0.25em;
    }
  }

  div.input {
    margin-bottom: 1em;

    input[type=text], input[type=file], input[type=password], input[type=email] {
      max-width: 20em;
    }

    .hint {
      @extend .fineprint;
      padding-left: 1em;
    }

    input.validation-error {
      border: 1px solid var(--form-input-validation-error-border-color);
    }

    &.text, &.dtext {
      .hint {
        padding-left: 0;
        display: block;
      }
    }

    textarea {
      width: 70%;
    }

    label {
      display: block;
      font-weight: bold;
      line-height: 1.5em;
    }

    &.radio_buttons {
      span.radio label {
        font-weight: normal;
        display: inline;
        margin: 0 2em 0 0.25em;
        vertical-align: middle;
      }
    }
  }
}

form.inline-form {
  display: table;

  > div.input {
    display: table-row;
    line-height: 2em;

    label {
      text-align: right;
    }

    label, input {
      display: table-cell;
      padding-right: 1em;
      white-space: nowrap;
      line-height: 1em;
    }
  }
}

form.quick-search-form {
  margin: 0;

  input {
    background: var(--quick-search-form-background);
  }
}

form.one-line-form {
  > input, > div.input {
    display: inline;

    label {
      display: inline;
      margin-right: 1em;
    }
  }
}

div.ui-dialog {
  textarea, input[type="text"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  form.simple_form {
    margin-bottom: 0;

    div.input {
      margin-bottom: 0.5em;
    }

    div.input.hidden {
      display: none;
    }
  }

  /* the submit and close buttons */
  .ui-dialog-buttonpane {
    margin-top: 0;
    padding: 1em 1em 1em 0;

    .ui-button {
      margin: 0 0.25em;
    }
  }
}
