/* =========================================================
   UGC Oforikrom Church Management System
   Secure, responsive splash screen
   ========================================================= */

:root {
    --ugc-red: #ce1126;
    --ugc-red-bright: #ef293d;
    --ugc-dark-red: #85000f;
    --ugc-wine: #420007;

    --ugc-gold: #fcd116;
    --ugc-orange: #f97316;

    --white: #ffffff;
    --black: #050505;

    --overlay-top: rgba(5, 3, 3, 0.4);
    --overlay-middle: rgba(19, 3, 6, 0.56);
    --overlay-bottom: rgba(18, 0, 4, 0.78);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100%;
    background: var(--black);
}

body {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;

    margin: 0;
    overflow: hidden;

    color: var(--white);
    background: var(--black);

    font-family:
        "Montserrat",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
}

/* =========================================================
   Main splash wrapper
   ========================================================= */

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: grid;
    place-items: center;

    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;

    padding:
        max(24px, env(safe-area-inset-top))
        max(20px, env(safe-area-inset-right))
        max(88px, env(safe-area-inset-bottom))
        max(20px, env(safe-area-inset-left));

    overflow: hidden;
    isolation: isolate;

    /*
     * Portrait image is the mobile default.
     * splash.css -> ../images/9.png
     */
    background-image:
        url("../images/9.png");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    opacity: 1;
    visibility: visible;

    transition:
        opacity 280ms ease,
        visibility 280ms ease;
}

/*
 * Dark readability overlay.
 */
.splash-screen::after {
    content: "";

    position: absolute;
    inset: 0;
    z-index: 0;

    pointer-events: none;

    background:
        linear-gradient(
            180deg,
            var(--overlay-top) 0%,
            var(--overlay-middle) 52%,
            var(--overlay-bottom) 100%
        ),
        radial-gradient(
            circle at center,
            rgba(0, 0, 0, 0.02) 8%,
            rgba(0, 0, 0, 0.52) 100%
        );
}

/*
 * Subtle texture.
 */
.splash-screen::before {
    content: "";

    position: absolute;
    inset: 0;
    z-index: 1;

    opacity: 0.05;
    pointer-events: none;

    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.13) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.13) 1px,
            transparent 1px
        );

    background-size:
        48px 48px;

    -webkit-mask-image:
        radial-gradient(
            circle at center,
            black,
            transparent 78%
        );

    mask-image:
        radial-gradient(
            circle at center,
            black,
            transparent 78%
        );
}

.splash-screen.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* =========================================================
   Background effects
   ========================================================= */

.background-effects {
    position: absolute;
    inset: 0;
    z-index: 2;

    overflow: hidden;
    pointer-events: none;
}

.glow {
    position: absolute;

    border-radius: 50%;

    filter: blur(85px);
    opacity: 0.2;
}

.glow-one {
    top: 7%;
    left: 10%;

    width: clamp(180px, 25vw, 340px);
    height: clamp(180px, 25vw, 340px);

    background: var(--ugc-red);
}

.glow-two {
    right: 5%;
    bottom: 8%;

    width: clamp(220px, 30vw, 400px);
    height: clamp(220px, 30vw, 400px);

    background: var(--ugc-gold);
    opacity: 0.12;
}

/* =========================================================
   Floating particles
   ========================================================= */

.particle {
    position: absolute;

    width: 4px;
    height: 4px;

    border-radius: 50%;

    background: var(--ugc-gold);

    box-shadow:
        0 0 8px var(--ugc-gold),
        0 0 18px rgba(252, 209, 22, 0.65);

    opacity: 0;

    animation:
        floatParticle 1.7s
        ease-in-out
        infinite;
}

.particle-one {
    top: 24%;
    left: 18%;
    animation-delay: 100ms;
}

.particle-two {
    top: 38%;
    right: 18%;
    animation-delay: 380ms;
}

.particle-three {
    top: 56%;
    left: 24%;
    animation-delay: 650ms;
}

.particle-four {
    top: 18%;
    right: 29%;
    animation-delay: 900ms;
}

.particle-five {
    top: 50%;
    right: 25%;
    animation-delay: 1.15s;
}

/* =========================================================
   Central content
   ========================================================= */

.splash-content {
    position: relative;
    z-index: 5;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    width: min(92vw, 760px);
    min-height: min(82vh, 720px);

    text-align: center;

    transform: translateY(-2vh);
}

/* =========================================================
   Orbit
   ========================================================= */

.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: -1;

    width: clamp(320px, 58vw, 560px);
    aspect-ratio: 1;

    border:
        1px solid
        rgba(252, 209, 22, 0.28);

    border-radius: 50%;

    transform:
        translate(-50%, -50%);

    pointer-events: none;

    animation:
        orbitAppear 700ms
        ease-out
        both;
}

.orbit::before,
.orbit::after {
    content: "";

    position: absolute;

    border-radius: inherit;
}

.orbit::before {
    inset: 8%;

    border:
        1px solid
        rgba(255, 255, 255, 0.1);
}

.orbit::after {
    inset: -8%;

    border:
        1px dashed
        rgba(206, 17, 38, 0.24);
}

.orbit-light {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--ugc-gold);

    box-shadow:
        0 0 10px var(--ugc-gold),
        0 0 24px var(--ugc-orange);

    animation:
        orbitLight 1.8s
        linear
        infinite;
}

/* =========================================================
   Logo
   ========================================================= */

.logo-stage {
    position: relative;

    display: grid;
    place-items: center;

    width: clamp(165px, 25vw, 265px);
    aspect-ratio: 1;

    margin-bottom:
        clamp(8px, 1.7vh, 18px);
}

.logo-halo {
    position: absolute;
    inset: 6%;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(252, 209, 22, 0.2),
            rgba(249, 115, 22, 0.08) 42%,
            transparent 72%
        );

    filter: blur(10px);

    animation:
        haloPulse 1.1s
        ease-in-out
        infinite
        alternate;
}

.logo-container {
    position: relative;
    z-index: 2;

    display: grid;
    place-items: center;

    width: 88%;
    aspect-ratio: 1;

    border-radius: 50%;

    background:
        rgba(0, 0, 0, 0.06);

    /*
     * UGC white ring and subtle white shadow.
     */
    box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.95),
    0 0 14px rgba(255, 255, 255, 0.65),
    0 0 30px rgba(255, 255, 255, 0.35),
    0 14px 34px rgba(0, 0, 0, 0.45);

    animation:
        logoEntrance 800ms
        cubic-bezier(0.16, 1, 0.3, 1)
        both;
}

.logo-container::before {
    content: "";

    position: absolute;
    inset: -5%;

    border:
        1px solid
        rgba(252, 209, 22, 0.38);

    border-radius: 50%;

    animation:
        ringPulse 1.45s
        ease-out
        infinite;
}

.church-logo {
    position: relative;
    z-index: 2;

    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    opacity: 1;

    filter:
        drop-shadow(
            0 0 6px
            rgba(255, 255, 255, 0.55)
        )
        drop-shadow(
            0 0 16px
            rgba(255, 255, 255, 0.36)
        );

    animation:
        logoFloat 1.7s
        ease-in-out
        infinite;
}

.logo-light {
    position: absolute;
    bottom: 7%;
    left: 50%;
    z-index: 3;

    width: 78px;
    height: 5px;

    border-radius: 999px;

    background: var(--ugc-gold);

    filter: blur(8px);

    transform:
        translateX(-50%);

    opacity: 0.65;

    animation:
        logoLightPulse 900ms
        ease-in-out
        infinite
        alternate;
}

/* =========================================================
   Welcome text
   ========================================================= */

.welcome-copy {
    width: min(100%, 650px);

    opacity: 0;

    transform:
        translateY(15px);

    animation:
        textEntrance 550ms
        ease-out
        320ms
        forwards;
}

.eyebrow {
    margin: 0 0 8px;

    color: var(--ugc-gold);

    font-size:
        clamp(
            0.68rem,
            1.7vw,
            0.88rem
        );

    font-weight: 800;

    letter-spacing:
        clamp(
            0.24rem,
            0.8vw,
            0.48rem
        );

    text-transform: uppercase;

    text-shadow:
        0 2px 4px
            rgba(0, 0, 0, 0.95),
        0 0 14px
            rgba(0, 0, 0, 0.72),
        0 0 18px
            rgba(252, 209, 22, 0.25);
}

.welcome-copy h1 {
    margin: 0;

    color: var(--white);

    font-size:
        clamp(
            1.45rem,
            5vw,
            2.75rem
        );

    font-weight: 850;
    line-height: 1.08;
    letter-spacing: -0.04em;

    overflow-wrap: anywhere;

    text-shadow:
        0 3px 5px
            rgba(0, 0, 0, 0.98),
        0 8px 20px
            rgba(0, 0, 0, 0.78),
        0 0 30px
            rgba(0, 0, 0, 0.62);
}

.welcome-copy h2 {
    margin: 5px 0 0;

    color: var(--ugc-gold);

    font-size:
        clamp(
            1.35rem,
            5vw,
            2.55rem
        );

    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.03em;

    overflow-wrap: anywhere;

    text-shadow:
        0 2px 3px
            rgba(0, 0, 0, 0.98),
        0 6px 16px
            rgba(0, 0, 0, 0.82),
        0 0 22px
            rgba(206, 17, 38, 0.48);
}

.system-name {
    margin: 10px 0 0;

    color:
        rgba(255, 255, 255, 0.95);

    font-size:
        clamp(
            0.82rem,
            2.5vw,
            1.12rem
        );

    font-weight: 550;

    overflow-wrap: anywhere;

    text-shadow:
        0 2px 3px
            rgba(0, 0, 0, 0.98),
        0 5px 14px
            rgba(0, 0, 0, 0.78);
}

/* =========================================================
   Loader
   ========================================================= */

.loader {
    width: min(90vw, 580px);

    margin-top:
        clamp(
            24px,
            4vh,
            40px
        );

    opacity: 0;

    transform:
        translateY(14px);

    animation:
        textEntrance 450ms
        ease-out
        500ms
        forwards;
}

.progress-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.progress-track {
    position: relative;

    flex: 1;

    height: 9px;

    overflow: hidden;

    border:
        1px solid
        rgba(255, 255, 255, 0.38);

    border-radius: 999px;

    background:
        rgba(0, 0, 0, 0.48);

    box-shadow:
        inset 0 1px 4px
            rgba(0, 0, 0, 0.8),
        0 4px 16px
            rgba(0, 0, 0, 0.5);
}

.progress-fill {
    position: relative;

    width: 0;
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            #fff 0%,
            #fff 52%,
            #fff 100%
        );

    box-shadow:
        0 0 10px
            rgba(249, 115, 22, 0.65),
        0 0 22px
            rgba(252, 209, 22, 0.28);

    transition:
        width 70ms linear;
}

.progress-shine {
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            110deg,
            transparent 10%,
            rgba(255, 255, 255, 0.72) 45%,
            transparent 72%
        );

    transform:
        translateX(-110%);

    animation:
        progressShine 850ms
        ease-in-out
        infinite;
}

.progress-dot {
    position: absolute;
    top: 50%;
    right: 0;

    width: 14px;
    height: 14px;

    border:
        3px solid
        rgba(255, 255, 255, 0.82);

    border-radius: 50%;

    background: var(--white);

    box-shadow:
        0 0 8px var(--white),
        0 0 18px var(--ugc-gold);

    transform:
        translate(40%, -50%);
}

.progress-value {
    flex: 0 0 50px;

    color: var(--white);

    font-size: 0.92rem;
    font-weight: 800;

    text-align: right;

    font-variant-numeric:
        tabular-nums;

    text-shadow:
        0 2px 3px
            rgba(0, 0, 0, 0.98),
        0 4px 11px
            rgba(0, 0, 0, 0.78);
}

.loading-message {
    display: flex;
    justify-content: center;
    align-items: center;

    gap: 9px;

    min-height: 20px;
    margin-top: 17px;

    color:
        rgba(255, 255, 255, 0.94);

    font-size: 0.66rem;
    font-weight: 650;

    letter-spacing: 0.24rem;

    text-transform: uppercase;

    text-shadow:
        0 2px 3px
            rgba(0, 0, 0, 0.98),
        0 5px 12px
            rgba(0, 0, 0, 0.78);
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots i {
    display: block;

    width: 3px;
    height: 3px;

    border-radius: 50%;

    background: var(--ugc-gold);

    box-shadow:
        0 0 6px
        rgba(252, 209, 22, 0.7);

    animation:
        dotBounce 700ms
        ease-in-out
        infinite
        alternate;
}

.loading-dots i:nth-child(2) {
    animation-delay: 140ms;
}

.loading-dots i:nth-child(3) {
    animation-delay: 280ms;
}


/* =========================================================
   No-JavaScript fallback
   ========================================================= */

.noscript-message {
    position: fixed;
    right: 20px;
    bottom: 20px;
    left: 20px;
    z-index: 20;

    padding: 14px 18px;

    border-left:
        4px solid
        var(--ugc-gold);

    color: var(--white);

    background:
        rgba(0, 0, 0, 0.88);

    font-size: 0.8rem;
    font-weight: 650;

    text-align: center;
}

/* =========================================================
   Animations
   ========================================================= */

@keyframes logoEntrance {
    0% {
        opacity: 0;

        transform:
            scale(0.45)
            rotate(-12deg);

        filter:
            blur(10px);
    }

    65% {
        opacity: 1;

        transform:
            scale(1.06)
            rotate(2deg);

        filter:
            blur(0);
    }

    100% {
        opacity: 1;

        transform:
            scale(1)
            rotate(0);
    }
}

@keyframes logoFloat {
    0%,
    100% {
        transform:
            translateY(0)
            scale(1);
    }

    50% {
        transform:
            translateY(-7px)
            scale(1.015);
    }
}

@keyframes haloPulse {
    from {
        opacity: 0.35;

        transform:
            scale(0.92);
    }

    to {
        opacity: 0.92;

        transform:
            scale(1.08);
    }
}

@keyframes ringPulse {
    0% {
        opacity: 0.6;

        transform:
            scale(0.88);
    }

    100% {
        opacity: 0;

        transform:
            scale(1.18);
    }
}

@keyframes logoLightPulse {
    from {
        opacity: 0.3;

        transform:
            translateX(-50%)
            scaleX(0.72);
    }

    to {
        opacity: 0.9;

        transform:
            translateX(-50%)
            scaleX(1.24);
    }
}

@keyframes textEntrance {
    to {
        opacity: 1;

        transform:
            translateY(0);
    }
}

@keyframes progressShine {
    to {
        transform:
            translateX(125%);
    }
}

@keyframes dotBounce {
    from {
        opacity: 0.25;

        transform:
            translateY(2px);
    }

    to {
        opacity: 1;

        transform:
            translateY(-3px);
    }
}

@keyframes orbitAppear {
    from {
        opacity: 0;

        transform:
            translate(-50%, -50%)
            scale(0.75);
    }

    to {
        opacity: 1;

        transform:
            translate(-50%, -50%)
            scale(1);
    }
}

@keyframes orbitLight {
    from {
        transform:
            translate(-50%, -50%)
            rotate(0deg)
            translateX(
                calc(
                    min(72vw, 490px) /
                    2
                )
            );
    }

    to {
        transform:
            translate(-50%, -50%)
            rotate(360deg)
            translateX(
                calc(
                    min(72vw, 490px) /
                    2
                )
            );
    }
}

@keyframes floatParticle {
    0% {
        opacity: 0;

        transform:
            translateY(12px)
            scale(0.4);
    }

    45% {
        opacity: 0.9;
    }

    100% {
        opacity: 0;

        transform:
            translateY(-26px)
            scale(1);
    }
}

@keyframes waveMove {
    from {
        transform:
            translateX(-2%)
            rotate(-2deg);
    }

    to {
        transform:
            translateX(2%)
            rotate(1deg);
    }
}

@keyframes waveMoveTwo {
    from {
        transform:
            translateX(2%)
            rotate(3deg);
    }

    to {
        transform:
            translateX(-2%)
            rotate(-1deg);
    }
}

/* =========================================================
   Tablet and desktop landscape background
   ========================================================= */

@media (min-width: 768px) {
    .splash-screen {
        background-image:
            url("../images/8.png");

        background-position:
            center;
    }
}

@media (min-width: 1400px) {
    .splash-screen {
        background-position:
            center 42%;
    }
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 600px) {
    .splash-screen {
        padding:
            max(
                18px,
                env(safe-area-inset-top)
            )
            max(
                16px,
                env(safe-area-inset-right)
            )
            max(
                72px,
                env(safe-area-inset-bottom)
            )
            max(
                16px,
                env(safe-area-inset-left)
            );

        background-position:
            center top;
    }

    .splash-content {
        width:
            min(
                94vw,
                520px
            );

        min-height: 76vh;

        transform:
            translateY(-1vh);
    }

    .orbit {
        width:
            clamp(
                285px,
                94vw,
                430px
            );
    }

    .logo-stage {
        width:
            clamp(
                160px,
                47vw,
                215px
            );
    }

    .welcome-copy {
        width:
            min(
                90vw,
                430px
            );
    }

    .welcome-copy h1 {
        font-size:
            clamp(
                1.4rem,
                7vw,
                2rem
            );
    }

    .welcome-copy h2 {
        font-size:
            clamp(
                1.3rem,
                6.8vw,
                1.9rem
            );
    }

    .system-name {
        font-size:
            clamp(
                0.78rem,
                3.8vw,
                1rem
            );
    }

    .loader {
        width:
            min(
                88vw,
                430px
            );

        margin-top: 23px;
    }

    .loading-message {
        letter-spacing:
            0.18rem;
    }
}

/* =========================================================
   Short displays
   ========================================================= */

@media (max-height: 700px) {
    .splash-screen {
        padding-top: 14px;
        padding-bottom: 58px;
    }

    .splash-content {
        min-height: 88vh;
    }

    .logo-stage {
        width:
            clamp(
                145px,
                29vh,
                220px
            );

        margin-bottom: 4px;
    }

    .loader {
        margin-top: 17px;
    }

    .loading-message {
        margin-top: 10px;
    }

    .bottom-wave {
        height: 62px;
    }
}

/* =========================================================
   Very small phones
   ========================================================= */

@media (max-width: 380px) {
    .splash-screen {
        padding-inline: 15px;
    }

    .logo-stage {
        width: 170px;
    }

    .welcome-copy h1 {
        font-size: 1.32rem;
    }

    .welcome-copy h2 {
        font-size: 1.34rem;
    }

    .system-name {
        font-size: 0.8rem;
    }

    .progress-row {
        gap: 9px;
    }

    .progress-value {
        flex-basis: 43px;
        font-size: 0.82rem;
    }

    .loading-message {
        font-size: 0.56rem;
        letter-spacing: 0.14rem;
    }
}

/* =========================================================
   Landscape phones
   ========================================================= */

@media (
    max-height: 520px
) and (
    orientation: landscape
) {
    .splash-screen {
        padding:
            10px
            max(
                24px,
                env(safe-area-inset-right)
            )
            42px
            max(
                24px,
                env(safe-area-inset-left)
            );
    }

    .splash-content {
        width:
            min(
                94vw,
                720px
            );


        transform: none;
    }

    .orbit {
        width:
            clamp(
                260px,
                58vh,
                370px
            );
    }

    .logo-stage {
        width:
            clamp(
                105px,
                26vh,
                155px
            );

        margin-bottom: 2px;
    }

    .welcome-copy {
        width:
            min(
                92vw,
                520px
            );
    }

    .eyebrow {
        margin-bottom: 2px;

        font-size: 0.54rem;

        letter-spacing:
            0.25rem;
            
    }

    .welcome-copy h1 {
        font-size:
            clamp(
                1rem,
                4.4vh,
                1.48rem
            );
    }

    .welcome-copy h2 {
        margin-top: 1px;

        font-size:
            clamp(
                0.98rem,
                4.2vh,
                1.4rem
            );
    }

    .system-name {
        margin-top: 3px;

        font-size:
            clamp(
                0.64rem,
                2.7vh,
                0.84rem
            );
    }

    .loader {
        width:
            min(
                78vw,
                470px
            );

        margin-top: 8px;
    }

    .loading-message {
        margin-top: 6px;

        font-size: 0.49rem;

        letter-spacing:
            0.13rem;
    }

    .bottom-wave {
        height: 38px;
    }
}

/* =========================================================
   Accessibility
   ========================================================= */

@media (
    prefers-reduced-motion: reduce
) {
    *,
    *::before,
    *::after {
        scroll-behavior:
            auto !important;

        animation-duration:
            1ms !important;

        animation-delay:
            0ms !important;

        animation-iteration-count:
            1 !important;

        transition-duration:
            1ms !important;
    }
}