html, body {
    height: 100%;
    margin: 0;
}

body {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background-color: #ffffff;
}

/* ---------- Full-page waving flag ---------- */
/* Sits fixed behind everything else on the page. */
.kenya-flag-decor {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    display: flex;
    overflow: hidden;
    pointer-events: none;
}

.kenya-flag-decor .strip {
    --i: 0; /* overridden inline per strip in the HTML */
    flex: 1 1 0;
    height: 100%;
    margin-left: -1px;
    background-image: linear-gradient(
        to bottom,
        #000000 0%,     #000000 28.33%,
        #ffffff 28.33%, #ffffff 35.83%,
        #bb0000 35.83%, #bb0000 64.17%,
        #ffffff 64.17%, #ffffff 71.67%,
        #006600 71.67%, #006600 100%
    );
    background-size: 100% 100%;
    transform-origin: center;
    will-change: transform;
    animation: flagWave 2.8s ease-in-out infinite;

    animation-delay: calc(var(--i) * -0.045s);
}

@keyframes flagWave {
    0%, 100% { transform: translateY(0)      scaleY(1); }
    50%      { transform: translateY(-1.6%)  scaleY(1.012); }
}

/* Softens the (very slight) overlap seams between strips. */
.kenya-flag-decor {
    filter: blur(0.3px);
}

.kenya-flag-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: radial-gradient(
        ellipse at center,
        rgba(255, 255, 255, 0.55) 0%,
        rgba(255, 255, 255, 0.35) 45%,
        rgba(255, 255, 255, 0.15) 100%
    );
    pointer-events: none;
}

main.d-flex,
.container.d-flex.flex-column {
    position: relative;
    z-index: 2;
}

.messages {
    z-index: 3;
}

/* ---------- Login card polish ---------- */
.card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    position: relative;
    background-color: rgba(255, 255, 255, 0.97);
}

/* Kenyan-flag accent strip along the top of the card */
.card::before {
    content: "";
    display: block;
    height: 6px;
    width: 100%;
    background: linear-gradient(
        to right,
        #000000 0%, #000000 32%,
        #ffffff 32%, #ffffff 36%,
        #bb0000 36%, #bb0000 64%,
        #ffffff 64%, #ffffff 68%,
        #006600 68%, #006600 100%
    );
}

.card-body {
    padding-top: 2rem;
}

/* Buttons themed to sit nicely with the flag colors, scoped to this page */
.card .btn-primary {
    background-color: #bb0000;
    border-color: #bb0000;
}

.card .btn-primary:hover,
.card .btn-primary:focus {
    background-color: #8f0000;
    border-color: #8f0000;
}

.card .btn-success {
    background-color: #006600;
    border-color: #006600;
}

.card .btn-success:hover,
.card .btn-success:focus {
    background-color: #004d00;
    border-color: #004d00;
}

/* Login subtitle */
.login-subtitle {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Mobile: keep subtitle black */
@media (max-width: 575.98px) {
    .login-subtitle {
        color: #000;
        text-shadow: none;
    }
}

/* ---------- Reduced motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
    .kenya-flag-decor .strip {
        animation: none;
    }
}

@media (max-width: 575.98px) {
    .kenya-flag-decor {
        top: 14px;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translateX(-50%);
        width: 120px;
        height: 80px;
        border-radius: 6px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    }

    .kenya-flag-overlay {
        display: none;
    }
}