.preloader {
    margin-top: 20px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;    
}

.preloader .loader {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    position: absolute;
    animation: rotate 1s linear infinite alternate, loaderClip 2s linear infinite alternate;
}

.preloader .loader::before {
    content: "";
    box-sizing: border-box;
    position: absolute;
    inset: 0px;
    border-radius: 50%;
    border: 5px solid var(--bs-theme);
    animation: loaderClip 2s linear infinite alternate;
}

button .preloader {
    min-width: 100px;
    min-height: 21px;
    margin-top: 0px;
    margin-bottom: 0px;
}

button .preloader .loader {
    width: 20px !important;
    height: 20px !important;
}

button .preloader .loader::before {   
    border: 4px solid #fff;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes loaderClip {
    0% {
        clip-path: polygon(50% 50%, 0 0, 0 0, 0 0, 0 0, 0 0);
    }

    25% {
        clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 0, 100% 0, 100% 0);
    }

    50% {
        clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 100% 100%, 100% 100%);
    }

    75% {
        clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 0 100%, 0 100%);
    }

    100% {
        clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 0 100%, 0 0);
    }
}