:root {
    --bs-border-color: var(--secondary-100);
    --bs-secondary-bg: var(--lavender-mist);
}

label, legend {
    display: inline-block;
    margin-bottom: .5rem;
    padding-bottom: 0;
}
.form-check,
.form-floating {
    label,
    legend {
        margin-bottom: 0;
    }
}

.bold-form-labels {
    label,
    legend {
        font-weight: bold;
    }
    /* Keep labels for checkboxes/radios and floating labels normal */
    .form-check,
    .form-floating {
        label,
        legend {
            font-weight: normal;
        }
    }
}

/**
 * Smaller spacing for Bootstrap's floating form fields
 */
.small-spacing-form .form-floating {
    > .form-control,
    > .form-control-plaintext,
    > .form-select {
        height: calc(2.5rem + calc(var(--bs-border-width) * 2));
        min-height: calc(2.5rem + calc(var(--bs-border-width) * 2));
        line-height: 1.25
    }

    > label,
    > .form-control,
    > .form-control-plaintext {
        padding-top: .5rem;
        padding-bottom: .5rem;
    }

    > .form-control-plaintext:focus,
    > .form-control-plaintext:not(:placeholder-shown),
    > .form-control:focus,
    > .form-control:not(:placeholder-shown),
    > .form-control-plaintext:-webkit-autofill,
    > .form-control:-webkit-autofill,
    > .form-select {
        padding-top: 1rem;
        padding-bottom: .25rem;
    }

    > .form-control-plaintext ~ label,
    > .form-control:focus ~ label,
    > .form-control:not(:placeholder-shown) ~ label,
    > .form-select ~ label,
    > .form-control:-webkit-autofill ~ label {
        transform: scale(.8) translateY(-.6rem) translateX(.15rem)
    }

    > textarea:focus ~ label::after,
    > textarea:not(:placeholder-shown) ~ label::after {
        inset: calc(.5rem + calc(var(--bs-border-width) * 2)) 0.375rem;
        height: 1.25em;
    }
}

.char-input {
    padding-left: 1ch;
    padding-right: 1ch;
    width: auto;
    text-align: center;
}

/*
 * Generic "hidden" indicator: a red overlay with an eye-slash icon that marks content which is
 * present/editable but will NOT be visible in the output (e.g. a field excluded from the report PDF,
 * a photo left off the report, ...). Recreated from the legacy `.hidden-on-report` using Bootstrap 5
 * variables. The overlay is purely visual: `pointer-events: none` keeps the underlying content usable.
 */
.hidden-overlay {
    position: relative;
}

.hidden-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(var(--bs-danger-rgb), .5);
    border-radius: var(--bs-border-radius);
    pointer-events: none;
    transition: background-color .15s ease-in-out;
}

.hidden-overlay:hover::after {
    background-color: rgba(var(--bs-danger-rgb), .35);
}

.hidden-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 3.5rem;
    height: 3.5rem;
    z-index: 2;
    pointer-events: none;
    background-color: var(--bs-white);
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, .5));
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z'/%3E%3Cpath d='M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z'/%3E%3Cpath d='M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12-.708.708z'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z'/%3E%3Cpath d='M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z'/%3E%3Cpath d='M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12-.708.708z'/%3E%3C/svg%3E") no-repeat center / contain;
}
