//
// Form page
// --------------------------------------------------


//== Form container
//
//**
.form-panel {
  background: @form-panel-bg;
  border: 1px solid @form-panel-border;
  border-radius: @border-radius-large;
  box-shadow: 0px 0px 0px 3px @form-panel-shadow;

  form {
    margin: 0px;
    padding: 0px;
  }
}


//== Form header
//
//**
.form-panel {
  .form-header {
    padding: @form-panel-padding;

    h1, h2 {
      margin: 0px;
    }

    h1 {
      font-size: @font-size-large * 1.6;
    }

    h2 {
      font-size: @font-size-large * 1.2;
    }

    p {
      margin: (@line-height-computed / 2) 0px 0px 0px;
    }
  }
}


//== Form non-field errors
//
//**
.form-panel {
  .form-errors-block {
    background-color: @alert-danger-bg;
    border-top: 1px solid @form-panel-border;
    border-bottom: 6px solid fadeOut(#000, 85%);
    border-radius: 0;
    margin-bottom: 0px;
    padding: (@form-panel-padding-vertical / 2) @form-panel-padding-horizontal;
    overflow: auto;

    color: @alert-danger-text;
    font-size: @font-size-large;
    text-shadow: 0px -1px 0px darken(@alert-danger-bg, 20%);

    .fa {
      position: relative;
      top: 4px;

      float: right;
      font-size: 26px;
    }

    ul {
      margin-right: 56px;
      margin-bottom: 0px;
      padding: 0px;

      li {
        margin: 0px;
        padding: (@line-height-computed / 5) 0px;
      }
    }
  }
}


//== Form alerts
//
//**
.form-panel {
  .misago-alerts {
    margin: 0px @form-panel-padding-vertical;

    .alert.lead {
      font-size: @font-size-large;
    }
  }
}


//== Form body
//
//**
.form-panel {
  .form-body {
    fieldset, &.no-fieldsets {
      margin: 0px;
      padding-bottom: @line-height-computed * .25;

      legend {
        border-top: 1px solid @form-panel-border;
        border-bottom: 0px;
        padding: @form-panel-padding;
        padding-bottom: 0px;
        margin-bottom: @line-height-computed * .6;

        font-size: @font-size-large;
      }

      .form-group {
        margin-left: @form-panel-padding-horizontal;
        margin-right: @form-panel-padding-horizontal;
      }

      .control-checkboxselect, .control-radioselect {
        label.checkbox, label.radio {
          font-weight: normal;

          &:first-child {
            margin-top: 0px;
          }
        }
      }

      .help-block {
        color: @field-help-block-color;
        margin-bottom: 0px;
        padding-bottom: 0px;
      }

      .extra-padding {
        padding: @form-panel-padding;
        padding-top: 0px;
        padding-bottom: 0px;
      }

      .control-errors {
        &, & .help-block {
          color: @state-danger-text;
          font-weight: bold;
        }
      }
    }

    &.no-fieldsets {
      border-top: 1px solid @form-panel-border;
      padding: 0px;
      padding-top: @line-height-computed;
      padding-bottom: @line-height-computed * .25;
    }
  }
}


//== Form table
//
//**
.form-panel {
  .form-table {
    margin-bottom: 0px;

    tr {
      td {
        vertical-align: middle;

        img {
          border-radius: @border-radius-small;
        }

        &.item-name, &.item-name a {
          color: @text-color;
          font-weight: bold;
        }
      }

      td:first-child {
        padding-left: @form-panel-padding-horizontal;
      }

      td:last-child {
        padding-right: @form-panel-padding-horizontal;
      }
    }
  }
}


// Form permissions
//
//**
.form-panel {
  .table-permissions {
    margin: 0px;

    tr {
      label {
        margin: 0px;
      }

      p, .form-group {
        margin-bottom: 0px;
      }

      td:first-child, th:first-child {
        padding-left: @form-panel-padding-vertical;
        vertical-align: middle;
      }
    }
  }
}


//== Form footer
//
//**
.form-panel {
  .form-footer {
    background-color: @form-panel-footer-bg;
    border-radius: 0px 0px (@border-radius-large - 1px) (@border-radius-large - 1px);
    border-top: 1px solid @form-panel-border;
    padding: @form-panel-padding;

    &>.row>div {
      padding: 0px @padding-base-horizontal * 2;
    }

    a.extra, p.extra {
      margin-top: @line-height-computed;
    }

    a.extra {
      display: inline-block;
    }

    div.extra {
      margin-top: @line-height-computed + @form-panel-padding-vertical / 2;
    }
  }
}


/* Big displays */
@media (min-width: @screen-sm-min) {
  .form-panel {
    .form-footer {
      p.extra {
        display: inline-block;
      }

      a.extra, p.extra {
        margin-top: 0px;
        margin-bottom: 0px;
        margin-left: @padding-base-horizontal;
      }
    }
  }
}


//== Form fields
//
//**
textarea {
  resize: vertical;
}

.checkbox {
  label {
    font-weight: bold;

    .help-block {
      font-weight: normal;
    }
  }
}
