/*
    kentico-forms.atpe.css
    ---------------------------------------------------------------
    Styles for the Kentico XbyK form widget output.
    Targets the out-of-the-box CSS class names assigned by Kentico
    and applies Bootstrap 5 theme-consistent styling to match the
    look and feel of the custom React forms on the ATPE site.
*/

/* --- Field spacing ----------------------------------------- */
.form-field {
    margin-bottom: 1rem;
}

/* --- Labels ----------------------------------------------- */
.control-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9375rem;
}

/* --- Validation messages ---------------------------------- */
.field-validation-valid {
    display: none;
}

.field-validation-error {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--bs-danger, #dc3545);
}

/* --- Checkbox fields: inline layout ----------------------- */
/*
    Kentico outputs the descriptive label text in .control-label
    BEFORE the .editing-form-control-nested-control that contains
    the actual <input type="checkbox">. We use flexbox + order to
    visually place the checkbox to the LEFT of the label text,
    matching the standard checkbox UX pattern.
*/
.form-field:has(.ktc-checkbox) {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.form-field:has(.ktc-checkbox) .control-label {
    order: 1;
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 400;
}

.form-field:has(.ktc-checkbox) .editing-form-control-nested-control {
    order: 0;
    flex-shrink: 0;
}

/* Hide the blank &nbsp; label Kentico renders inside .ktc-checkbox */
.ktc-checkbox > label {
    display: none;
}

/* --- Submit button: btn btn-primary, full width ------------ */
/*
    Kentico renders <input type="submit" value="Submit"> with no
    class. We target it as the general sibling of .ktc-default-section
    and style it to match Bootstrap's btn btn-primary.
*/
.ktc-default-section ~ input[type="submit"] {
    display: block;
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: var(--bs-border-radius, 0.375rem);
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
                border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    color: #fff;
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.ktc-default-section ~ input[type="submit"]:hover {
    filter: brightness(0.9);
}

.ktc-default-section ~ input[type="submit"]:focus,
.ktc-default-section ~ input[type="submit"]:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.ktc-default-section ~ input[type="submit"]:active {
    filter: brightness(0.85);
}
