:root {
    --page-bg: #070914;
    --frame-bg: rgba(9, 10, 22, 0.9);
    --frame-border: rgba(142, 122, 255, 0.58);
    --text-main: #f8f8fc;
    --text-soft: rgba(233, 235, 246, 0.78);
    --text-muted: rgba(205, 209, 228, 0.62);
    --glow-a: #ff4a63;
    --glow-b: #d44fff;
    --glow-c: #5c6cff;
    --accent-gradient: linear-gradient(90deg, var(--glow-a) 0%, var(--glow-b) 48%, var(--glow-c) 100%);
    --font-stack: "Segoe UI", "Trebuchet MS", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.loading-page {
    margin: 0;
    font-family: var(--font-stack);
    font-weight: 700;
    color: var(--text-main);
    background:
        radial-gradient(circle at 15% 14%, rgba(255, 74, 99, 0.2), transparent 24%),
        radial-gradient(circle at 85% 86%, rgba(92, 108, 255, 0.2), transparent 26%),
        linear-gradient(135deg, #05060f 0%, #080b18 46%, #060816 100%);
    overflow-x: hidden;
}

.loading-page.theme-admin {
    --glow-a: #ff5668;
    --glow-b: #c65cff;
    --glow-c: #536eff;
}

.loading-page.theme-hr {
    --glow-a: #ff4a63;
    --glow-b: #d74ff4;
    --glow-c: #5d73ff;
}

.loading-page.theme-employee {
    --glow-a: #47c0ff;
    --glow-b: #7882ff;
    --glow-c: #c45cff;
}

.loading-page.theme-app {
    --glow-a: #ff4964;
    --glow-b: #d355f8;
    --glow-c: #576bff;
}

.loading-shell {
    min-height: 100vh;
    padding: 8px;
    display: grid;
    place-items: center;
}

.loading-frame {
    position: relative;
    width: min(100%, 1540px);
    min-height: calc(100vh - 16px);
    border-radius: 20px;
    border: 1px solid var(--frame-border);
    background:
        radial-gradient(circle at 50% 52%, rgba(255, 255, 255, 0.02), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)),
        var(--frame-bg);
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.48),
        inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.loading-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(90deg, rgba(255, 74, 99, 0.9), rgba(212, 79, 255, 0.65), rgba(92, 108, 255, 0.92));
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.72;
}

.loading-stage {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 16px);
    padding: 0 28px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.brand-top {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 8px;
}

.brand-logo-wrap {
    width: 74px;
    height: 74px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02) 56%),
        rgba(16, 18, 32, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 0 24px rgba(255, 255, 255, 0.03),
        0 0 36px rgba(0, 0, 0, 0.28);
}

.brand-logo {
    width: 70px;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 18px rgba(210, 105, 255, 0.12));
}

.company-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 6px 26px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
        rgba(11, 13, 28, 0.88);
    background-clip: padding-box;
    color: transparent;
    font-size: clamp(3.25rem, 4.2vw, 4.25rem);
    line-height: 1;
    letter-spacing: 0.09em;
    font-weight: 1000;
    font-family: "Arial Black", "Trebuchet MS", "Segoe UI", sans-serif;
    text-transform: uppercase;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
        linear-gradient(90deg, #ff8aa0 0%, #ff5b7f 22%, #d36aff 54%, #7e8cff 78%, #74f0ea 100%);
    -webkit-background-clip: padding-box, text;
    background-clip: padding-box, text;
    -webkit-text-stroke: 0.45px rgba(255, 255, 255, 0.34);
}

.loading-header {
    max-width: 960px;
    margin-top: 16px;
}

.loading-title {
    margin: 2px 0 0;
    font-size: clamp(1.46rem, 2.65vw, 2.5rem);
    line-height: 0.94;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--glow-a) 0%, #ffffff 54%, #ffffff 64%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.loading-tagline {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.loading-tagline span {
    width: clamp(42px, 7vw, 74px);
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 74, 99, 0.95), rgba(92, 108, 255, 0.9));
}

.loading-tagline p {
    margin: 0;
    font-size: clamp(0.82rem, 1.08vw, 0.96rem);
    letter-spacing: 0.13em;
    text-transform: uppercase;
    font-weight: 800;
    color: rgba(186, 150, 255, 0.96);
}

.orb-loader {
    position: relative;
    width: min(100%, 220px);
    aspect-ratio: 1;
    margin-top: 10px;
    display: grid;
    place-items: center;
}

.orb-ring,
.orb-ring::before {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.orb-ring--track {
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.orb-ring--track::before {
    content: "";
    inset: 11px;
    border-radius: 50%;
    border: 10px solid rgba(255, 255, 255, 0.08);
}

.orb-ring--glow::before {
    content: "";
    inset: 11px;
    border-radius: 50%;
    border: 10px solid transparent;
    border-top-color: #fff4f5;
    border-right-color: var(--glow-c);
    border-bottom-color: rgba(255, 74, 99, 0.85);
    transform: rotate(-24deg);
    filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.16));
    animation: spin 3.8s linear infinite;
}

.orb-ring--pulse {
    inset: 16px;
    border: 1px dashed rgba(255, 74, 99, 0.28);
    animation: pulse-ring 2.8s ease-in-out infinite;
}

.orb-core {
    position: relative;
    z-index: 1;
    width: 116px;
    height: 116px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #ea63ff;
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 74, 99, 0.16), transparent 28%),
        radial-gradient(circle at 75% 28%, rgba(92, 108, 255, 0.18), transparent 30%),
        linear-gradient(180deg, rgba(18, 20, 36, 0.96), rgba(12, 14, 27, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 0 40px rgba(255, 255, 255, 0.03),
        0 0 42px rgba(0, 0, 0, 0.34);
}

.orb-core svg {
    width: 46px;
    height: 46px;
    stroke: currentColor;
    filter: drop-shadow(0 0 16px rgba(234, 99, 255, 0.18));
}

.status-copy {
    max-width: 860px;
    margin-top: 10px;
}

.status-copy h2 {
    margin: 0;
    font-size: clamp(1.52rem, 2.35vw, 2.3rem);
    line-height: 1.18;
    padding-bottom: 0.08em;
    font-weight: 800;
    background: linear-gradient(90deg, #ff8aa0 0%, #c755ff 32%, #5f7bff 64%, #67e0da 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.status-copy p {
    margin: 6px auto 0;
    max-width: 620px;
    font-size: clamp(0.9rem, 1.02vw, 1rem);
    line-height: 1.35;
    font-weight: 700;
    color: var(--text-soft);
}

.progress-block {
    width: min(100%, 700px);
    margin-top: 14px;
}

.progress-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.progress-track {
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.progress-fill {
    width: 8%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent-gradient);
    box-shadow: 0 0 22px rgba(214, 79, 245, 0.34);
    transition: width 0.85s ease;
}

.progress-value {
    min-width: 50px;
    font-size: clamp(1.08rem, 1.3vw, 1.36rem);
    font-weight: 900;
    color: #7280ff;
}

.feature-strip {
    width: 100%;
    margin-top: 18px;
    padding-top: 2px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
}

.feature-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px;
    padding: 4px 10px;
    align-items: start;
    text-align: left;
    position: relative;
}

.feature-item:not(:first-child)::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 1px;
    background: rgba(255, 255, 255, 0.12);
}

.feature-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.02);
}

.feature-icon svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.feature-item--secure .feature-icon,
.feature-item--secure .feature-icon svg {
    color: #ff5471;
}

.feature-item--approval .feature-icon,
.feature-item--approval .feature-icon svg {
    color: #c755ff;
}

.feature-item--manage .feature-icon,
.feature-item--manage .feature-icon svg {
    color: #5f7bff;
}

.feature-item--reports .feature-icon,
.feature-item--reports .feature-icon svg {
    color: #67e0da;
}

.feature-item--alerts .feature-icon,
.feature-item--alerts .feature-icon svg {
    color: #ffad49;
}

.feature-copy strong {
    display: block;
    font-size: 0.86rem;
    line-height: 1.2;
    font-weight: 800;
    color: #ffffff;
}

.feature-item--secure .feature-copy strong {
    background: linear-gradient(90deg, #ff8aa0 0%, #ff5471 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.feature-item--approval .feature-copy strong {
    background: linear-gradient(90deg, #e18dff 0%, #c755ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.feature-item--manage .feature-copy strong {
    background: linear-gradient(90deg, #92a8ff 0%, #5f7bff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.feature-item--reports .feature-copy strong {
    background: linear-gradient(90deg, #9af2ed 0%, #67e0da 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.feature-item--alerts .feature-copy strong {
    background: linear-gradient(90deg, #ffd089 0%, #ffad49 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.feature-copy span {
    display: block;
    margin-top: 2px;
    font-size: 0.79rem;
    line-height: 1.28;
    font-weight: 700;
    color: var(--text-soft);
}

.loading-footer {
    margin-top: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: clamp(0.88rem, 0.98vw, 1rem);
    font-weight: 800;
}

.loading-footer p {
    margin: 0;
    background: linear-gradient(90deg, #ff8aa0 0%, #c755ff 38%, #5f7bff 72%, #67e0da 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.footer-spinner {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.14);
    border-top-color: var(--glow-b);
    border-right-color: var(--glow-a);
    animation: spin 1.1s linear infinite;
}

.skip-toast {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 8;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--text-main);
    text-decoration: none;
    background: rgba(10, 12, 24, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 38px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(12px);
}

.skip-toast__label,
.skip-toast__count {
    font-size: 0.88rem;
    font-weight: 700;
}

.skip-toast__count {
    min-width: 42px;
    padding: 4px 8px;
    border-radius: 999px;
    text-align: center;
    color: #f4dcff;
    background: rgba(255, 255, 255, 0.08);
}

.frame-glow,
.dot-grid,
.curve-lines {
    position: absolute;
    pointer-events: none;
}

.frame-glow {
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.55;
}

.frame-glow--left {
    top: -40px;
    left: -60px;
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(255, 74, 99, 0.22) 0%, transparent 70%);
}

.frame-glow--right {
    right: -60px;
    bottom: -40px;
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(92, 108, 255, 0.22) 0%, transparent 70%);
}

.dot-grid--top {
    top: 22px;
    left: 20px;
    display: grid;
    grid-template-columns: repeat(5, 12px);
    gap: 10px 12px;
}

.dot-grid--top span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 88, 110, 0.94);
    box-shadow: 0 0 10px rgba(255, 88, 110, 0.16);
}

.curve-lines {
    opacity: 0.9;
}

.curve-lines--left {
    left: -140px;
    bottom: -150px;
    width: 420px;
    height: 700px;
    background:
        repeating-radial-gradient(circle at 0% 100%, transparent 0 28px, rgba(255, 74, 99, 0.22) 28px 30px);
    mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.3) 65%, transparent);
}

.curve-lines--right {
    right: -140px;
    bottom: -170px;
    width: 520px;
    height: 520px;
    background:
        repeating-radial-gradient(circle at 100% 100%, transparent 0 18px, rgba(92, 108, 255, 0.26) 18px 20px);
    mask-image: linear-gradient(270deg, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.25) 62%, transparent);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse-ring {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.03);
        opacity: 0.85;
    }
}

@media (max-width: 1240px) {
    .loading-stage {
        padding: 0 20px 22px;
    }

    .feature-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: 20px;
    }

    .feature-item:nth-child(4)::before,
    .feature-item:nth-child(5)::before {
        display: none;
    }
}

@media (min-width: 901px) {
    .loading-footer {
        margin-top: 56px;
    }
}

@media (max-width: 900px) {
    .loading-shell {
        padding: 0;
    }

    .loading-frame {
        min-height: 100vh;
        border-radius: 16px;
    }

    .loading-stage {
        min-height: 100vh;
        padding: 0 16px 22px;
    }

    .brand-top {
        gap: 14px;
    }

    .brand-logo-wrap {
        width: 66px;
        height: 66px;
    }

    .brand-logo {
        width: 62px;
    }

    .company-chip {
        min-height: 52px;
        padding: 6px 22px;
        font-size: 2.32rem;
        font-weight: 1000;
    }

    .loading-header {
        margin-top: 14px;
    }

    .orb-loader {
        width: 188px;
    }

    .orb-core {
        width: 100px;
        height: 100px;
    }

    .status-copy h2 {
        font-size: 1.56rem;
    }

    .progress-track {
        height: 11px;
    }

    .feature-strip {
        grid-template-columns: 1fr 1fr;
    }

    .feature-item:nth-child(3)::before,
    .feature-item:nth-child(5)::before {
        display: none;
    }

    .curve-lines--left,
    .curve-lines--right {
        opacity: 0.6;
    }
}

@media (max-width: 640px) {
    .loading-shell {
        padding: 0;
        min-height: 100dvh;
    }

    .skip-toast {
        top: 8px;
        right: 8px;
        padding: 7px 10px;
        gap: 8px;
    }

    .loading-frame {
        width: 100%;
        min-height: 100dvh;
        border-radius: 0;
    }

    .loading-stage {
        min-height: 100dvh;
        padding: 0 12px 10px;
    }

    .brand-top {
        flex-direction: column;
        gap: 10px;
        margin-top: 18px;
    }

    .brand-logo-wrap {
        width: 84px;
        height: 84px;
    }

    .brand-logo {
        width: 78px;
    }

    .company-chip {
        min-height: 58px;
        padding: 10px 26px;
        font-size: 2.04rem;
        letter-spacing: 0.09em;
        font-weight: 1000;
    }

    .loading-header {
        margin-top: 12px;
    }

    .loading-title {
        font-size: 1.5rem;
    }

    .loading-tagline {
        margin-top: 12px;
        gap: 6px;
        width: 100%;
    }

    .loading-tagline p {
        max-width: none;
        white-space: nowrap;
        line-height: 1.25;
        letter-spacing: 0.14em;
        font-size: 0.78rem;
    }

    .loading-tagline span {
        width: 14px;
    }

    .orb-loader {
        width: 160px;
        margin-top: 12px;
        margin-bottom: 6px;
    }

    .orb-ring--track::before,
    .orb-ring--glow::before {
        inset: 9px;
        border-width: 8px;
    }

    .orb-core {
        width: 84px;
        height: 84px;
    }

    .orb-core svg {
        width: 36px;
        height: 36px;
    }

    .status-copy {
        margin-top: 10px;
    }

    .status-copy h2 {
        font-size: 1.28rem;
        line-height: 1.16;
    }

    .status-copy p {
        font-size: 0.82rem;
        line-height: 1.32;
    }

    .progress-row {
        gap: 10px;
        grid-template-columns: minmax(0, 1fr) 42px;
    }

    .progress-track {
        height: 10px;
    }

    .progress-value {
        min-width: 42px;
        font-size: 0.96rem;
    }

    .feature-strip {
        grid-template-columns: 1fr;
        margin-top: 20px;
    }

    .feature-item {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 8px;
        padding: 7px 0;
        align-items: center;
    }

    .feature-item::before {
        display: none;
    }

    .feature-item,
    .feature-copy,
    .loading-footer {
        text-align: left;
    }

    .loading-footer {
        width: 100%;
        justify-content: center;
        margin-top: 28px;
        font-size: 0.8rem;
        line-height: 1.3;
        text-align: center;
    }

    .curve-lines--left,
    .curve-lines--right {
        opacity: 0.35;
    }

    .dot-grid--top {
        top: 18px;
        left: 12px;
        grid-template-columns: repeat(5, 8px);
        gap: 6px 8px;
    }

    .dot-grid--top span {
        width: 4px;
        height: 4px;
    }

    .curve-lines--left {
        width: 280px;
        height: 480px;
        left: -120px;
        bottom: -120px;
    }

    .curve-lines--right {
        width: 320px;
        height: 320px;
        right: -120px;
        bottom: -120px;
    }
}

@media (max-width: 420px) {
    .skip-toast {
        top: 6px;
        right: 6px;
        padding: 6px 8px;
    }

    .skip-toast__label,
    .skip-toast__count {
        font-size: 0.76rem;
    }

    .loading-stage {
        padding: 0 10px 8px;
    }

    .brand-top {
        margin-top: 18px;
        gap: 10px;
    }

    .brand-logo-wrap {
        width: 76px;
        height: 76px;
    }

    .brand-logo {
        width: 70px;
    }

    .company-chip {
        min-height: 54px;
        padding: 8px 20px;
        font-size: 1.76rem;
        letter-spacing: 0.08em;
        font-weight: 1000;
    }

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

    .loading-title {
        font-size: 1.34rem;
    }

    .loading-tagline {
        margin-top: 10px;
        gap: 4px;
    }

    .loading-tagline p {
        max-width: none;
        font-size: 0.64rem;
        letter-spacing: 0.08em;
        white-space: nowrap;
    }

    .loading-tagline span {
        width: 10px;
    }

    .orb-loader {
        width: 142px;
        margin-top: 10px;
        margin-bottom: 6px;
    }

    .orb-ring--track::before,
    .orb-ring--glow::before {
        inset: 8px;
        border-width: 7px;
    }

    .orb-ring--pulse {
        inset: 14px;
    }

    .orb-core {
        width: 76px;
        height: 76px;
    }

    .orb-core svg {
        width: 31px;
        height: 31px;
    }

    .status-copy {
        margin-top: 8px;
    }

    .status-copy h2 {
        font-size: 1.12rem;
    }

    .status-copy p {
        margin-top: 5px;
        max-width: 290px;
        font-size: 0.75rem;
    }

    .progress-block {
        width: 100%;
        margin-top: 12px;
    }

    .progress-row {
        gap: 8px;
        grid-template-columns: minmax(0, 1fr) 36px;
    }

    .progress-track {
        height: 9px;
    }

    .progress-value {
        min-width: 36px;
        font-size: 0.86rem;
    }

    .feature-strip {
        margin-top: 16px;
    }

    .feature-item {
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 7px;
        padding: 6px 0;
    }

    .feature-icon {
        width: 30px;
        height: 30px;
    }

    .feature-icon svg {
        width: 13px;
        height: 13px;
    }

    .feature-copy strong {
        font-size: 0.79rem;
    }

    .feature-copy span {
        font-size: 0.72rem;
        line-height: 1.24;
    }

    .loading-footer {
        margin-top: 22px;
        gap: 7px;
        font-size: 0.72rem;
        justify-content: center;
        text-align: center;
    }

    .footer-spinner {
        width: 15px;
        height: 15px;
        border-width: 2px;
    }

    .frame-glow,
    .curve-lines,
    .dot-grid--top {
        opacity: 0.22;
    }
}
