/* @define FormFieldset */
.FormFieldset {
    position: relative;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 17px 9px 9px; /* Ensures consistent 24px padding around FormGroups */
    margin: 28px 0;
    background-color: var(--surface-default);
}

.FormFieldset-legend {
    position: absolute;
    left: 0;
    top: calc(-1 * (var(--padding-md) + var(--padding-xs)));
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-h3);
    line-height: 1;
    margin: 0 0 var(--padding-xs);
    padding-left: 0;
    white-space: nowrap;
}

.FormFieldset-content {
    display: flex;
    flex-direction: column;
}

/* Ideally we would not style the FormGroup component here, but this is safest until we retire vanilla fieldsets in favour of FormFieldset */
/* stylelint-disable plugin/selector-bem-pattern */
.FormFieldset .FormGroup {
    margin-bottom: 0;
}
/* stylelint-enable plugin/selector-bem-pattern */
