/* Keep the form bounded; long steps scroll inside the open wrapper. */
/* The theme's overflow-x:hidden also computes overflow-y:auto. Clip the
   horizontal overflow without making body/#page additional scroll containers. */
@supports (overflow: clip) {
  body.koncepta-application-page,
  body.koncepta-application-page #page {
    overflow-x: clip;
    overflow-y: visible;
  }
}

#ansokan .ansokningsformular-form.is-open,
#ansokan .ansokningsformular-form.visadirekt {
  max-height: 1000px !important;
  max-height: min(1000px, max(160px, calc(100vh - var(--ansokan-header-clearance, 96px) - 16px))) !important;
  max-height: min(1000px, max(160px, calc(100dvh - var(--ansokan-header-clearance, 96px) - 16px))) !important;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  opacity: 1;
}

#ansokan .ansokningsformular-form__form {
  position: relative;
  height: auto !important;
}

#ansokan .ansokningsformular-form__status {
  padding: 1rem;
  margin-bottom: 1rem;
  border: 2px solid #198754;
  background: #fff;
  color: #212529;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scroll-margin-top: calc(6rem + var(--wp-admin--admin-bar--height, 0px));
}

#ansokan .ansokningsformular-form__status.is-error {
  border-color: #b02a37;
}

#ansokan .ansokningsformular-form.is-submitted > .fs-1,
#ansokan .ansokningsformular-form.is-submitted > .row.align-items-center,
#ansokan .ansokningsformular-form.is-submitted .ansokningsformular-form__panel {
  display: none;
}

#ansokan .ansokningsformular-form.is-submitted .ansokningsformular-form__status {
  padding: 2rem;
  font-size: 1.25rem;
}

#ansokan .ansokningsformular-form__panel {
  display: none;
  position: static;
  height: auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

#ansokan .ansokningsformular-form__panel.js-active {
  display: flow-root;
  visibility: visible;
  opacity: 1;
}

#ansokan .ansokningsformular-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

#ansokan .ansokningsformular-form__actions .btn {
  float: none !important;
  max-width: 100%;
  white-space: normal;
}

#ansokan .ansokningsformular-form__actions .js-btn-next,
#ansokan .ansokningsformular-form__actions #ansokansubmit {
  margin-left: auto;
}

@media (max-width: 575.98px) {
  #ansokan .ansokningsformular-form > .row > .p-5 {
    padding: 1rem !important;
  }

  #ansokan .ansokningsformular-form__progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  #ansokan .ansokningsformular-topp-knapp {
    white-space: normal;
    overflow-wrap: break-word;
  }
}
