form,
.form-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xxlarge);
  > * {
    margin: 0;
  }
}

.form-wrapper.form-items-inline {
  flex-direction: row;
}

.form-actions {
  display: flex;
  gap: var(--spacing-large);
  flex-direction: row;
  flex-wrap: wrap;
  & > * {
    margin: 0 !important;
  }
}

.form-actions .form-item-faqs {
  width: 100%;
}

.form-item .form-item {
  /* margin-bottom: var(--spacing); */
}

.form-item--error,
.form-composite.error {
  position: relative;
  margin-left: var(--spacing);
  &:before {
    content: "";
    position: absolute;
    top: 0;
    left: calc(-1 * var(--spacing));
    width: 3px;
    bottom: 0;
    background-color: var(--color-alert);
  }
}

.form-item--error-message {
  color: var(--color-alert);
  margin-top: var(--spacing-small);
}

input.error {
  border: 2px solid var(--color-alert);
}

label {
  font-weight: 700;
  color: var(--color-primary-b);
  display: block;
  font-size: 1.125rem;
}

label ol,
label ul {
  font-weight: 400;
  color: var(--color-text);
}

.form-item__label--optional {
  font-weight: 400;
  color: var(--color-text);
}
.form-disabled .form-item__label--optional {
  display: none;
}

/* Hide the optional marker when the field is required */
.form-item__label.form-required .form-item__label--optional {
  display: none;
}

/* Hide the optional marker when the field is required */
fieldset.form-required .form-item__label--optional {
  display: none;
}

select.error:disabled {
  border: 2px solid var(--color-text);
}

select.error {
  border: 2px solid var(--color-alert);
}

.form-item > label {
  margin-bottom: var(--spacing-small);
}

fieldset.fieldgroup {
  position: relative;
}

.form-item > legend {
  margin-bottom: var(--spacing-small);
}

input[type="search"],
.form-email,
.form-text,
.form-select,
.facets-dropdown,
.form-textarea,
.form-number,
.form-tel,
.form-search,
.form-date,
.form-time,
.form-url {
  border: 2px solid var(--color-text);
  padding: 14px;
  border-radius: var(--border-radius);
  background-color: var(--color-white);
  font-size: 1rem;
  height: 3rem;
  max-width: 100%;
  font-family: var(--font-primary);
  &:is(:disabled) {
    background-color: var(--color-grey-light-aa);
    color: var(--color-text);
    cursor: not-allowed;
  }
}

.form-textarea {
  height: 10rem;
}

.form-submit.button--reset,
.form-submit[name="reset"] {
  background-color: var(--color-white);
  border-color: var(--color-text);
  color: var(--color-text);
}

.form-submit.button--reset:hover,
.form-submit.button--reset:focus,
.form-submit.button--reset:active,
.form-submit[name="reset"]:hover,
.form-submit[name="reset"]:focus,
.form-submit[name="reset"]:active {
  border-color: var(--full-hero-2, var(--color-secondary-c));
  color: var(--full-hero-2, var(--color-secondary-c));
}

.form-item .description {
  font-size: 0.9rem;
  font-style: italic;
  font-weight: 300;
  margin-top: var(--spacing-small);
}

select {
  -webkit-appearance: none;
  appearance: none;
  background: url(../../../assets/icons/chevron-down.svg) no-repeat center right
    10px white;
  background-size: 1rem auto;
}

.form-select {
  padding: 0.5rem 2rem 0.5rem 1rem;
}

select:active {
  background-image: url("../../assets/icons/chevron-up.svg");
}

/* Checkboxes */
.form-type-checkbox {
  position: relative;
  display: block;
  min-height: 40px;
  padding-left: 40px;
}

.form-checkbox {
  cursor: pointer;
  position: absolute;
  z-index: 1;
  top: -2px;
  left: -2px;
  width: 44px;
  height: 44px;
  margin: 0;
  opacity: 0;
}

.form-type-checkbox label {
  display: inline-block;
  margin-bottom: 0;
  padding: 8px 15px 5px;
  cursor: pointer;
  touch-action: manipulation;
  font-size: 1.125rem;
  font-weight: 600;
}

.form-type-checkbox label:before {
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 2px solid var(--color-text);
}

.form-type-checkbox label:after,
.form-type-checkbox label:before {
  content: "";
  box-sizing: border-box;
  position: absolute;
  background: rgba(0, 0, 0, 0);
}

.form-type-checkbox label:after {
  top: 11px;
  left: 9px;
  width: 23px;
  height: 12px;
  transform: rotate(-45deg);
  border: solid;
  border-width: 0 0 5px 5px;
  border-top-color: rgba(0, 0, 0, 0);
  opacity: 0;
}

.form-checkbox:focus + label:before {
  border-width: 2px;
  outline: var(--focus-outline);
  box-shadow: var(--focus-shadow);
}

@media (-ms-high-contrast: active), screen and (forced-colors: active) {
  .form-checkbox:focus + label:before {
    outline-color: Highlight;
  }
}

.form-checkbox:checked + label:after {
  opacity: 1;
}

.form-checkbox:disabled,
.form-checkbox:disabled + label {
  cursor: default;
}

.form-checkbox:disabled + label,
.form-checkbox:disabled ~ .description {
  opacity: 0.5;
}

.form-type-checkbox .description,
.form-type-checkbox .form-item--error-message {
  padding-left: 15px;
}

/* Radios */

.form-type-radio {
  font-family: Lato, arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.25;
  display: block;
  position: relative;
  min-height: 40px;
  margin-bottom: 10px;
  padding-left: 40px;
  clear: left;
}

@media print {
  .form-type-radio {
    font-family: sans-serif;
  }
}

@media (min-width: 40.0625em) {
  .form-type-radio {
    font-size: 19px;
    line-height: 1.3157894737;
  }
}

@media print {
  .form-type-radio {
    font-size: 14pt;
    line-height: 1.15;
  }
}

.form-type-radio:last-child,
.form-type-radio:last-of-type {
  margin-bottom: 0;
}

.form-radio {
  cursor: pointer;
  position: absolute;
  z-index: 1;
  top: -2px;
  left: -2px;
  width: 44px;
  height: 44px;
  margin: 0;
  opacity: 0;
}

.form-type-radio label {
  display: inline-block;
  margin-bottom: 0;
  padding: 8px 15px 5px;
  cursor: pointer;
  -ms-touch-action: manipulation;
  touch-action: manipulation;
  font-size: 1.125rem;
  font-weight: 600;
}

.form-type-radio label:before {
  content: "";
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 2px solid;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0);
}

.form-type-radio label:after {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 0;
  height: 0;
  border: 10px solid;
  border-radius: 50%;
  opacity: 0;
  background: currentcolor;
}

.form-type-radio .description {
  display: block;
  padding-right: 15px;
  padding-left: 15px;
}

.form-radio:focus + label:before {
  border-width: 4px;
  outline: 3px solid rgba(0, 0, 0, 0);
  outline-offset: 1px;
  box-shadow: 0 0 0 4px var(--govie-focus-colour);
}

@media (-ms-high-contrast: active), screen and (forced-colors: active) {
  .form-radio:focus + label:before {
    outline-color: Highlight;
  }
}

.form-radio:checked + label:after {
  opacity: 1;
}

.form-radio:disabled,
.form-radio:disabled + label {
  cursor: default;
}

.form-radio:disabled + label,
.form-radio:disabled ~ .description {
  opacity: 0.5;
}

/* fieldsets */
form > fieldset.form-wrapper {
  border: 0;
  padding: 0;
  margin: 0 0 var(--spacing-xxlarge);
}

/* act as label */
.form-wrapper > legend .fieldset-legend {
  font-weight: 800;
  color: var(--color-primary-b);
  display: block;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.form-wrapper.fieldgroup > legend .fieldset-legend {
  font-size: 1.125rem;
  font-weight: 700;
}

fieldset.form-wrapper {
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  padding-inline: 0;
  margin: 0 0 var(--spacing-large);
}

fieldset.form-wrapper:last-child {
  margin-bottom: 0;
}

fieldset.form-wrapper.fieldset-without-legend {
  border-top: 0;
}

.fieldset-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--spacing);
  & > * {
    margin: 0;
  }
}

/* files */
.form-type-managed-file {
  display: flex;
  flex-direction: column;
}

.form-type-managed-file > label {
  order: -2;
}

.form-type-managed-file > .description {
  order: -1;
  margin-top: 0;
  margin-bottom: var(--spacing-small);
}

.form-managed-file {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-large);
}

.form-file {
  font-size: var(--font-size-large);
}

.form-managed-file > .form-wrapper {
  align-items: center;
  flex-wrap: wrap;
  & > * {
    max-width: 33%;
  }
  & > .form-type-checkbox {
    flex: 0;
  }
}

.form-managed-file .form-submit {
  align-self: flex-start;
  padding: 0;
  background: none;
  color: var(--color-alert) !important;
  border: 0;
  font-size: var(--base-font-size);
  &:hover,
  &:focus {
    text-decoration: underline;
  }
}

.form-managed-file .form-type-checkbox label {
  padding-top: 0;
  & .form-item__label--optional {
    display: none;
  }
}

.form-wrapper .messages-wrap {
  display: none;
}

details.form-wrapper {
  padding: var(--spacing-large) !important;
}

details .fieldset-legend {
  font-weight: 700;
  font-size: 1.2rem;
}

details fieldset fieldset .fieldset-legend {
  font-size: 1.1rem;
  font-weight: 700;
}

.form-wrapper.fieldgroup
  .fieldset-wrapper.form-not-required
  .form-item__label--optional {
  display: none;
}

.form-wrapper {
  max-width: var(--width-large);
}

details .form-wrapper {
  max-width: 100%;
}

/* Form tabs */
.horizontal-tabs {
  border: 0 !important;
}

ul.horizontal-tabs-list li a {
  padding: 1rem 1.5rem !important;
}

.horizontal-tabs .horizontal-tabs-list {
  background: #fff;
  border: 0;
}

.horizontal-tabs-list .horizontal-tab-button {
  border: 0;
  position: relative;
  top: 5px;
  border: 1px solid #fff;
  z-index: 1;
}
.horizontal-tabs .horizontal-tab-button a {
  color: #000 !important;
  text-decoration: underline !important;
}
.horizontal-tabs .horizontal-tab-button a:hover,
.horizontal-tabs .horizontal-tab-button a:focus {
  background-color: #cbcbcb;
}

.horizontal-tabs-list .horizontal-tab-button.selected {
  border: 1px solid #ccc;
  border-bottom-color: #fff;
  top: 6px;
}
.horizontal-tabs-list .horizontal-tab-button.selected a {
  background-color: #fff;
  color: #000 !important;
  text-decoration: none !important;
}
.horizontal-tabs-pane {
  border: 1px solid #ccc !important;
  max-width: 100%;
}

/* Password */
.password-strength__indicator.is-weak {
  background-color: var(--color-alert);
}
.password-strength__indicator.is-fair {
  background-color: var(--color-warning);
}
.password-strength__indicator.is-good,
.password-strength__indicator.is-strong {
  background-color: var(--color-status);
}

.password-confirm {
  margin-bottom: 0.5em;
}
.form-type-password span.error {
  color: var(--color-alert);
  font-weight: 700;
}
.form-type-password span.ok {
  color: var(--color-status);
  font-weight: 700;
}

.password-suggestions {
  margin-top: 0.5em;
}

.form-type-password.confirm-parent {
  margin-top: 1rem;
}

/* standarise widths */
.form-type-text,
.form-type-textfield,
.form-type-email,
.form-type-textarea.form-type-email,
.form-type-select,
.form-type-password,
.form-type-number {
  width: 100%;
  max-width: var(--width-small);
}

.fieldset-legend,
.form-item__label,
.form-item .description,
.help-block {
  max-width: var(--width-small);
}

.form-type-checkbox .description,
.form-type-radio .description {
  max-width: calc(var(--width-small) - 40px);
}

.form-textrea,
.form-select,
.form-text,
.form-email {
  width: 100%;
}

.form-number {
  width: 50%;
}

fieldset.form-actions .fieldset-wrapper,
.form-actions{
  display:flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  flex-direction: row;
}

#div-application-notice {
  margin: 0 1rem 2rem 1rem;
  background-color: #fcf8e3;
  border-color: #ebccd1;
  padding: 1rem;
  border-radius: 5px;
  box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.35);
}

#div-application-notice > ul {
  margin: 0 0 2rem 0;
}

#div-application-notice .warning {
  color: red;
}

/* Application navigation section */
#edit-application-navigation li {
  list-style-type: none;
}

/* Residential mix styling on large screens */
@media (min-width:800px) {
  #edit-residential-mix table {
    max-width: var(--width-medium);
  }
}
