
.form-layout {
  background-color: #F6F7F8;
  border: 1px solid #D6D9DC;
  border-radius: 10px;
  margin-top: 10px;
  margin-left: auto;
  margin-right: auto;
  padding: 10px;
  width: 100%;
}
@media (min-width: 570px) {
  .form-layout {
    padding-top: 30px;
  }
}

/*----------------------------------------------------------------------------------------------------
 * Form Field
 *----------------------------------------------------------------------------------------------------*/
.form-layout .form-field {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-bottom: 20px;
}
@media (min-width: 570px) {
  .form-layout .form-field {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: nowrap;
  }
}

/*----------------------------------------------------------------------------------------------------
 * Form Labels
 *----------------------------------------------------------------------------------------------------*/
.form-layout .form-field label:first-child,
.form-layout .form-field .form-label:first-child {
  color: #777;
  margin-bottom: 10px;
  margin-right: 0;
  min-width: auto;
  text-align: left;
  width: auto;
}
@media (min-width: 570px) {
  .form-layout .form-field label:first-child,
  .form-layout .form-field .form-label:first-child {
    margin-bottom: 0;
    margin-right: 20px;
    min-width: 150px;
    text-align: right;
    width: 150px;
  }
}

/*----------------------------------------------------------------------------------------------------
 * Input, Selection, and Textarea
 *----------------------------------------------------------------------------------------------------*/
.form-layout .form-field input,
.form-layout .form-field select,
.form-layout .form-field textarea,
.form-layout .form-field div[data-field] {
  background-color: white;
  border: 1px solid #D6D9DC;
  border-radius: 3px;
  padding: 5px 5px 5px 5px;
  width: 100%;
}
.form-layout .form-field select {
  padding: 4px 2px 4px 2px;
}
.form-layout .form-field div[data-field] {
  min-height: 30px; /* Fine-tuning, but assumes base font size */
}
.form-layout .form-field textarea {
  min-height: 200px;
}
.form-layout .form-field input[type='radio'],
.form-layout .form-field input[type='checkbox'] {
  margin: 8px 17px 7px 7px;
  min-width: auto;
  transform: scale(2);
  width: auto;
}
.form-layout .form-field input[type='checkbox'] {
  float: left;
  margin-top: 10px;
  text-align: left;
}
.form-layout .form-field input[type='radio'] + label,
.form-layout .form-field input[type='checkbox'] + label {
  display: inline-block;
  margin-bottom: 10px;
  margin-right: 30px;
}
.form-layout .form-field div[data-field] {
  background-color: inherit;
}
@media (min-width: 570px) {
  .form-layout .form-field input,
  .form-layout .form-field select,
  .form-layout .form-field textarea,
  .form-layout .form-field div[data-field] {
    margin-top: -6px;
  }
  .form-layout .form-field input[type='radio'],
  .form-layout .form-field input[type='checkbox'] {
    margin: 0 5px 0 0;
    transform: none;
  }
  .form-layout .form-field input[type='checkbox'] {
    margin-top: 3px; /* vertical-align doesn't work, so approximate baseline */
  }
  .form-layout .form-field div[data-field] {
    margin-left: 0;
  }
}

/*----------------------------------------------------------------------------------------------------
 * Button, Submit, and Reset
 *----------------------------------------------------------------------------------------------------*/
.form-layout .form-field button,
.form-layout .form-field input[type='button'],
.form-layout .form-field input[type='reset'],
.form-layout .form-field input[type='submit'] {
  background-color: #5995DA;
  border: none;
  border-radius: 3px;
  color: white;
  cursor: pointer;
  font-size: 125%;
  font-weight: bold;
  margin: 0 auto;
  padding: 7px 50px;
  width: 100%;
}
.form-layout .form-field button:hover,
.form-layout .form-field input[type='button']:hover,
.form-layout .form-field input[type='reset']:hover,
.form-layout .form-field input[type='submit']:hover {
  background-color: #76AEED;
}
.form-layout .form-field button:active,
.form-layout .form-field input[type='button']:active,
.form-layout .form-field input[type='reset']:active,
.form-layout .form-field input[type='submit']:active {
  background-color: #407FC7;
}
@media (min-width: 570px) {
  .form-layout .form-field button,
  .form-layout .form-field input[type='button'],
  .form-layout .form-field input[type='reset'],
  .form-layout .form-field input[type='submit'] {
    width: auto;
  }
}

/*----------------------------------------------------------------------------------------------------
 * Groups
 *----------------------------------------------------------------------------------------------------*/
.form-layout .form-block {
  align-items: flex-start;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.form-layout .form-flow {
	display: inline;
}
.form-layout .form-block p {
  margin-top: 0;
}

/*----------------------------------------------------------------------------------------------------
 * Extra information
 *----------------------------------------------------------------------------------------------------*/
.form-layout .form-info {
  color: #555;
  font-size: 90%;
  width: 100%;
}
.form-layout div.form-info {
  margin-top: 10px;
}

/*----------------------------------------------------------------------------------------------------
 * Errors
 *----------------------------------------------------------------------------------------------------*/
.form-layout .form-error {
  margin-left: 0;
  padding-left: 0;
  padding-bottom: 10px;
}
@media (min-width: 570px) {
  .form-layout .form-error {
    margin-left: 150px;
    padding-left: 20px;
  }
}
