/*
 * R&M Industrial Loading Splash
 * Designed for R&M Distribution Ltd
 */

html.rm-loader-active,
html.rm-loader-active body {
    overflow: hidden !important;
}

html.rm-loader-skip #rm-industrial-loader {
    display: none !important;
}

.rm-industrial-loader {
    --rm-navy: #06182f;
    --rm-blue: #0b2d57;
    --rm-green: #16c451;
    --rm-cyan: #18a9e5;
    --rm-steel: #b7c2ce;
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    place-items: center start;
    min-height: 100dvh;
    overflow: hidden;
    isolation: isolate;
    background:
        linear-gradient(90deg, rgba(3, 13, 28, .98) 0%, rgba(5, 23, 47, .92) 34%, rgba(4, 19, 39, .48) 62%, rgba(2, 10, 22, .22) 100%),
        linear-gradient(180deg, rgba(2, 12, 27, .15), rgba(2, 12, 27, .60)),
        var(--rm-loader-bg) center / cover no-repeat;
    color: #fff;
    font-family: "Segoe UI", Inter, Roboto, Arial, sans-serif;
    opacity: 1;
    visibility: visible;
    transition: opacity .58s ease, visibility .58s ease;
}

.rm-industrial-loader::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(53, 178, 230, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(53, 178, 230, .055) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(90deg, #000, transparent 72%);
    pointer-events: none;
}

.rm-industrial-loader::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: min(70vw, 1120px);
    width: 3px;
    background: linear-gradient(180deg, transparent, rgba(25, 203, 83, .85), transparent);
    box-shadow: 0 0 28px rgba(25, 203, 83, .55);
    transform: skewX(-12deg);
    opacity: .55;
    pointer-events: none;
}

.rm-industrial-loader.rmil-is-closing {
    opacity: 0;
    visibility: hidden;
}

.rmil-noise {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: .055;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.84' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
}

.rmil-scan {
    position: absolute;
    inset: -30% 0 auto;
    height: 38%;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(27, 197, 86, .08), transparent);
    animation: rmil-scan 4.8s linear infinite;
}

.rmil-rail {
    position: absolute;
    left: 0;
    right: 0;
    height: 7px;
    z-index: 2;
    background:
        repeating-linear-gradient(90deg, rgba(255,255,255,.22) 0 18px, transparent 18px 26px),
        linear-gradient(90deg, var(--rm-green), var(--rm-cyan), transparent 70%);
    opacity: .72;
}

.rmil-rail-top { top: 0; }
.rmil-rail-bottom { bottom: 0; transform: rotate(180deg); }

.rmil-panel {
    position: relative;
    z-index: 5;
    width: min(710px, calc(100vw - 80px));
    margin-left: clamp(34px, 6vw, 118px);
    padding: 1px;
    filter: drop-shadow(0 28px 55px rgba(0, 0, 0, .46));
    clip-path: polygon(0 0, calc(100% - 32px) 0, 100% 32px, 100% 100%, 32px 100%, 0 calc(100% - 32px));
    background: linear-gradient(135deg, rgba(255,255,255,.5), rgba(28,201,83,.8) 34%, rgba(24,169,229,.45), rgba(255,255,255,.15));
}

.rmil-panel-inner {
    position: relative;
    padding: clamp(26px, 4vw, 54px);
    overflow: hidden;
    clip-path: inherit;
    background:
        linear-gradient(135deg, rgba(12, 35, 61, .95), rgba(3, 17, 35, .96)),
        repeating-linear-gradient(135deg, transparent 0 16px, rgba(255,255,255,.03) 16px 17px);
    backdrop-filter: blur(14px);
}

.rmil-panel-inner::before {
    content: "R&M";
    position: absolute;
    right: -24px;
    bottom: -60px;
    font-size: 190px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -.1em;
    color: rgba(255,255,255,.025);
    pointer-events: none;
}

.rmil-panel-inner::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 9px;
    height: 38%;
    background: var(--rm-green);
    box-shadow: 0 0 25px rgba(22,196,81,.55);
}

.rmil-system-row,
.rmil-footer-row,
.rmil-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.rmil-system-row {
    margin-bottom: 22px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    color: #c7d3de;
}

.rmil-live-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-right: -6px;
    border-radius: 50%;
    background: var(--rm-green);
    box-shadow: 0 0 0 5px rgba(22,196,81,.12), 0 0 15px rgba(22,196,81,.85);
    animation: rmil-pulse 1.2s ease-in-out infinite;
}

.rmil-code {
    margin-left: auto;
    color: #6f879e;
}

.rmil-logo-plate {
    position: relative;
    width: min(470px, 82%);
    margin: 0 0 28px;
    padding: 18px 24px 14px;
    overflow: hidden;
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
    background:
        linear-gradient(145deg, rgba(255,255,255,.98), rgba(224,231,237,.93));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.65), 0 12px 34px rgba(0,0,0,.28);
}

.rmil-logo-plate::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--rm-green), var(--rm-cyan), #24268f);
}

.rmil-logo {
    display: block;
    width: 100%;
    height: auto;
    max-height: 190px;
    object-fit: contain;
}

.rmil-eyebrow {
    margin: 0 0 11px;
    color: var(--rm-green);
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .22em;
}

.rmil-headline {
    max-width: 610px;
    margin: 0;
    color: #fff;
    font-size: clamp(28px, 3.3vw, 46px);
    line-height: 1.04;
    font-weight: 850;
    letter-spacing: -.035em;
    text-wrap: balance;
}

.rmil-subheadline {
    max-width: 610px;
    margin: 17px 0 28px;
    color: #c4d0dc;
    font-size: clamp(14px, 1.15vw, 17px);
    line-height: 1.6;
}

.rmil-progress-wrap {
    margin-top: 16px;
}

.rmil-progress-head {
    margin-bottom: 9px;
    color: #aebfce;
    font-family: Consolas, "Courier New", monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

#rmil-percent {
    color: var(--rm-green);
}

.rmil-progress-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
    height: 13px;
    padding: 2px;
    overflow: hidden;
    border: 1px solid rgba(197,214,228,.24);
    background: rgba(0,0,0,.35);
}

.rmil-progress-track i {
    border-right: 1px solid rgba(255,255,255,.09);
    z-index: 2;
}

#rmil-progress-bar {
    position: absolute;
    inset: 2px auto 2px 2px;
    width: 0%;
    z-index: 1;
    background:
        repeating-linear-gradient(135deg, rgba(255,255,255,.17) 0 6px, transparent 6px 12px),
        linear-gradient(90deg, #0ea841, #18c953 65%, #57e787);
    box-shadow: 0 0 18px rgba(22,196,81,.45);
    transition: width .18s linear;
}

.rmil-service-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 22px;
}

.rmil-service-grid span {
    position: relative;
    min-height: 34px;
    padding: 9px 9px 8px 13px;
    border: 1px solid rgba(188,207,222,.16);
    background: rgba(255,255,255,.025);
    color: #9fb0c0;
    font-family: Consolas, "Courier New", monospace;
    font-size: 9px;
    line-height: 1.25;
    text-transform: uppercase;
}

.rmil-service-grid span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--rm-green);
    opacity: .75;
}

.rmil-footer-row {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(195,211,224,.13);
    font-family: Consolas, "Courier New", monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
}

.rmil-eot { color: #b7c5d2; }
.rmil-url { color: var(--rm-green); }

.rmil-skip {
    position: absolute;
    right: clamp(24px, 4vw, 68px);
    bottom: clamp(24px, 4vw, 58px);
    z-index: 7;
    display: inline-flex;
    align-items: center;
    gap: 16px;
    min-height: 46px;
    padding: 0 18px 0 21px;
    border: 1px solid rgba(255,255,255,.34);
    border-radius: 0;
    background: rgba(4,19,38,.72);
    color: #fff;
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease, background .2s ease, border-color .2s ease;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.rmil-skip.rmil-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.rmil-skip:hover,
.rmil-skip:focus-visible {
    outline: none;
    border-color: var(--rm-green);
    background: rgba(11,45,87,.95);
    box-shadow: 0 0 0 3px rgba(22,196,81,.18), 0 0 28px rgba(22,196,81,.2);
}

.rmil-skip span {
    color: var(--rm-green);
    font-size: 18px;
}

@keyframes rmil-scan {
    to { transform: translateY(360%); }
}

@keyframes rmil-pulse {
    50% { opacity: .45; transform: scale(.86); }
}

@media (max-width: 900px) {
    .rm-industrial-loader {
        place-items: center;
        background-position: 68% center;
    }

    .rm-industrial-loader::after {
        display: none;
    }

    .rmil-panel {
        width: min(680px, calc(100vw - 34px));
        margin: 0;
    }

    .rmil-panel-inner {
        padding: 30px 27px;
    }

    .rmil-skip {
        right: 18px;
        bottom: 18px;
    }
}

@media (max-width: 600px) {
    .rm-industrial-loader {
        align-items: stretch;
        background-position: 72% center;
    }

    .rm-industrial-loader::before {
        background-size: 30px 30px;
    }

    .rmil-panel {
        align-self: center;
        width: calc(100vw - 22px);
        max-height: calc(100dvh - 42px);
        overflow: auto;
        clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
    }

    .rmil-panel-inner {
        padding: 25px 20px 78px;
    }

    .rmil-system-row {
        font-size: 9px;
    }

    .rmil-logo-plate {
        width: 88%;
        margin-bottom: 22px;
        padding: 12px 17px 10px;
    }

    .rmil-headline {
        font-size: 29px;
    }

    .rmil-subheadline {
        margin-bottom: 22px;
        font-size: 13px;
    }

    .rmil-service-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rmil-footer-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .rmil-skip {
        right: 28px;
        bottom: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rmil-scan,
    .rmil-live-dot {
        animation: none !important;
    }

    .rm-industrial-loader,
    #rmil-progress-bar,
    .rmil-skip {
        transition-duration: .01ms !important;
    }
}
