/* =========================================
   TANZANIA ELSEWHERE — WEBSITE LOADER
   MOBILE FIRST
========================================= */

.site-loader {
    position: fixed;

    inset-inline: 16px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));

    z-index: 900;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 18px;

    width: min(calc(100% - 32px), 320px);

    margin-inline: auto;
    padding: 26px 22px;

    box-sizing: border-box;

    background: #FFFFFF;

    border: 1px solid #E3E8E2;
    border-radius: 18px;

    box-shadow:
        0 8px 32px rgb(0 0 0 / 10%);

    opacity: 1;

    pointer-events: none;

    caret-color: transparent;

    transition:
        opacity 300ms ease,
        transform 300ms ease;
}

/* Keep loader hidden until required */

.site-loader[hidden] {
    display: none !important;
}

/* =========================================
   COMPANY LOGO
========================================= */

.site-loader-brand {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 90px;
}

.site-loader-brand img {
    display: block;

    width: 100%;
    max-width: 220px;
    height: 100%;

    object-fit: contain;
    object-position: center;
}

/* Fallback while the logo is loading */

.site-loader-brand-name {
    color: #065B10;

    font-size: 23px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.03em;

    text-align: center;
}

/* =========================================
   ANIMATED LOADING LINE
========================================= */

.site-loader-progress {
    position: relative;

    width: min(100%, 180px);
    height: 4px;

    overflow: hidden;

    background: #E8EFE5;

    border-radius: 20px;
}

.site-loader-progress::before {
    content: '';

    position: absolute;

    top: 0;
    bottom: 0;
    left: 0;

    width: 36%;

    background: linear-gradient(
        to right,
        #065B10 0%,
        #065B10 78%,
        #F09800 78%,
        #F09800 100%
    );

    border-radius: 20px;

    transform: translateX(-100%);

    animation:
        site-loader-progress
        1.6s
        cubic-bezier(0.45, 0, 0.55, 1)
        infinite;
}

/* =========================================
   LOADING ANIMATION KEYFRAMES
========================================= */

@keyframes site-loader-progress {

    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(280%);
    }
}

/* =========================================
   COMPANY SLOGAN
========================================= */

.site-loader-slogan {
    max-width: 260px;

    margin: 0;

    color: #2D3748;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;

    text-align: center;
    text-wrap: balance;
}

/* =========================================
   SMOOTH DISMISSAL
========================================= */

.site-loader.is-leaving {
    opacity: 0;

    transform: translateY(8px);
}

/* =========================================
   SMALL SMARTPHONES
========================================= */

@media (max-width: 359px) {

    .site-loader {
        gap: 15px;

        padding: 20px 18px;
    }

    .site-loader-brand {
        height: 75px;
    }

    .site-loader-brand-name {
        font-size: 21px;
    }

    .site-loader-slogan {
        font-size: 12px;
    }
}

/* =========================================
   TABLETS AND DESKTOP
========================================= */

@media (min-width: 640px) {

    .site-loader {
        bottom: 30px;

        width: 350px;

        gap: 22px;

        padding: 30px 26px;

        border-radius: 20px;
    }

    .site-loader-brand {
        height: 110px;
    }

    .site-loader-brand img {
        max-width: 250px;
    }

    .site-loader-progress {
        width: 200px;
    }

    .site-loader-slogan {
        font-size: 14px;
    }
}

/* =========================================
   REDUCED MOTION ACCESSIBILITY
========================================= */

@media (prefers-reduced-motion: reduce) {

    .site-loader {
        transition: none;
    }

    .site-loader-progress::before {
        animation: none;

        transform: none;

        width: 100%;
    }

    .site-loader.is-leaving {
        transform: none;
    }
}