/* Shared presentation for native fields in the public and customer forms. */
form :is(input:not([type]), input[type="text"], input[type="email"], input[type="password"],
         input[type="tel"], input[type="url"], input[type="number"], input[type="search"],
         input[type="date"], input[type="time"], input[type="datetime-local"], input[type="file"],
         select, textarea):not(:where(.cke *, .select2-container *, .select2-hidden-accessible)) {
    border-radius: 8px;
    max-width: 100%;
}

/* Keep validation colours, disabled states and embedded icons under the site's control. */
form:not(.was-validated) :is(input.form-control, select, textarea, input[type="text"],
                             input[type="email"], input[type="password"], input[type="tel"]):not(:where(
    :disabled, [readonly], [aria-invalid="true"], .is-invalid, .is-valid, .error,
    .cke *, .select2-container *, .select2-hidden-accessible, .input-group *)) {
    border: 1px solid #aab7c7;
    box-shadow: none;
}

form :is(.form-control, .form-select, select, textarea, input[type="text"],
         input[type="email"], input[type="password"], input[type="tel"]):focus-visible {
    /* main.css suppresses the native input/select outline with !important. */
    outline: 2px solid #203965 !important;
    outline-offset: 1px;
}

form input[type="file"]::file-selector-button {
    background-color: #e8eff9;
    color: #203965;
    font: inherit;
}

/* Full-size fields only. Compact search bars and grouped controls retain their sizing. */
form.needs-validation :is(.form-control, .form-select, select, input[type="text"],
                          input[type="email"], input[type="password"], input[type="tel"]):not(:where(
    [type="hidden"], .form-control-sm, .input-group *, .cke *, .select2-container *,
    .select2-hidden-accessible, .searchInput)) {
    min-height: 44px;
    font-size: 1rem;
}

@media (max-width: 767px) {
    form.needs-validation :is(input.form-control, select, textarea, input[type="text"],
                              input[type="email"], input[type="password"], input[type="tel"]):not(:where(
        .cke *, .select2-container *, .select2-hidden-accessible)) {
        font-size: 16px;
    }
}
