.site-form {
    --form-control-max-width: 42rem;
    max-width: 48rem;
}

.site-form > p,
.site-form .form-field {
    margin-bottom: 1.25rem;
}

.site-form label:not(.form-check-label) {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.site-form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.site-form select,
.site-form textarea {
    display: block;
    width: 100%;
    max-width: var(--form-control-max-width);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    line-height: 1.5;
}

.site-form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.site-form select {
    min-height: 2.5rem;
}

.site-form textarea {
    min-height: 8rem;
    resize: vertical;
}

.site-form input[type="file"] {
    padding: 0.375rem;
}

.site-form input:focus,
.site-form select:focus,
.site-form textarea:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.site-form .helptext,
.site-form .form-text {
    display: block;
    max-width: var(--form-control-max-width);
    margin-top: 0.35rem;
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    line-height: 1.4;
}

.site-form ul.errorlist {
    max-width: var(--form-control-max-width);
    margin: 0.4rem 0 0;
    padding-left: 1.25rem;
    color: var(--bs-danger-text-emphasis);
    font-size: 0.875rem;
}

.site-form > ul.errorlist.nonfield,
.site-form .errornote {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--bs-danger-border-subtle);
    border-radius: var(--bs-border-radius);
    background: var(--bs-danger-bg-subtle);
    color: var(--bs-danger-text-emphasis);
}

.site-form input[type="checkbox"],
.site-form input[type="radio"] {
    width: 1rem;
    height: 1rem;
    margin-right: 0.4rem;
    vertical-align: -0.15em;
}

.site-form .form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.form-page {
    max-width: 48rem;
}

.form-page > h1 {
    margin-bottom: 1.5rem;
}

.form-page .form-intro {
    max-width: 42rem;
    margin-top: -0.75rem;
    margin-bottom: 1.5rem;
    color: var(--bs-secondary-color);
}

@media (max-width: 575.98px) {
    .site-form,
    .form-page {
        max-width: 100%;
    }

    .site-form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
    .site-form select,
    .site-form textarea {
        max-width: 100%;
    }

    .site-form .form-actions .btn {
        flex: 1 1 auto;
    }
}
