﻿.loader {
    width: 48px;
    height: 48px;
    border: 5px solid;
    border-color: var(--primary) transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#waiting {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
}

#waitingcontent {
    display: table;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

#waitingspinner {
    display: table-cell;
    vertical-align: middle;
    width: 100%;
    text-align: center;
    font-size: larger;
    padding-top: 80px;
    color: #352F4E;
    font-weight: bold;
}

.demo-loader-page {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top, rgba(116, 213, 233, 0.22), transparent 28%),
        linear-gradient(180deg, #eef3f6 0%, #e5ebf0 100%);
    color: #112235;
    font-family: "Space Grotesk", "Montserrat", sans-serif;
}

.ai-loader-stage,
.demo-loader-showcase {
    position: relative;
    overflow: hidden;
}

.ai-loader-stage--fullscreen {
    min-height: 100vh;
}

.ai-loader-shell {
    --ai-loader-size: min(70vw, 33rem);
    --ai-loader-accent: #4aa9c8;
    --ai-loader-accent-strong: #167ca4;
    --ai-loader-secondary: #76d7c1;
    --ai-loader-ink: #143148;
    --ai-loader-panel: rgba(247, 250, 252, 0.92);
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    gap: clamp(1.75rem, 3vw, 2.5rem);
    width: min(100%, 96rem);
    min-height: clamp(36rem, 80vh, 64rem);
    padding: clamp(1.5rem, 4vw, 3.5rem);
    border: 1px solid rgba(84, 146, 168, 0.16);
    border-radius: 2rem;
    background:
        linear-gradient(135deg, rgba(249, 252, 253, 0.97), rgba(229, 237, 242, 0.95)),
        radial-gradient(circle at top, rgba(74, 169, 200, 0.09), transparent 42%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.5) inset,
        0 2rem 5rem rgba(41, 63, 82, 0.12),
        0 0 3rem rgba(74, 169, 200, 0.08);
}

.ai-loader-shell::before,
.ai-loader-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ai-loader-shell::before {
    background:
        linear-gradient(rgba(74, 169, 200, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(74, 169, 200, 0.06) 1px, transparent 1px);
    background-size: 4.5rem 4.5rem;
    mask-image: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.8) 18%, rgba(0, 0, 0, 0.8) 82%, transparent);
    opacity: 0.42;
}

.ai-loader-shell::after {
    inset: 1rem;
    border: 1px solid rgba(118, 215, 193, 0.18);
    border-radius: 1.5rem;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3) inset;
}

.ai-loader-stage--fullscreen .ai-loader-shell {
    width: 100%;
    min-height: 100vh;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
}

.ai-loader-heading {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 0.8rem;
    justify-items: center;
    max-width: 44rem;
    text-align: center;
}

.ai-loader-badge,
.demo-loader-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 1rem;
    border: 1px solid rgba(74, 169, 200, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ai-loader-accent);
    font-family: "Orbitron", "Montserrat", sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.ai-loader-badge::before,
.demo-loader-kicker::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--ai-loader-secondary);
    box-shadow: 0 0 1rem var(--ai-loader-secondary);
}

.ai-loader-headline,
.demo-loader-showcase h2 {
    margin: 0;
    font-size: clamp(2.2rem, 4vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 0.98;
}

.ai-loader-subtitle,
.demo-loader-showcase p {
    margin: 0;
    max-width: 38rem;
    color: rgba(17, 34, 53, 0.62);
    font-size: clamp(1rem, 1.35vw, 1.12rem);
    line-height: 1.7;
}

.ai-loader-chassis {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: var(--ai-loader-size);
    aspect-ratio: 1;
}

.ai-loader-halo,
.ai-loader-sweep,
.ai-loader-word-ring,
.ai-loader-core::before,
.ai-loader-core::after {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.ai-loader-halo {
    border: 1px solid rgba(74, 169, 200, 0.2);
    box-shadow:
        0 0 1.5rem rgba(74, 169, 200, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.ai-loader-halo--outer {
    inset: 1%;
    animation: ai-loader-spin 16s linear infinite;
}

.ai-loader-halo--mid {
    inset: 11%;
    border-style: dashed;
    border-color: rgba(118, 215, 193, 0.32);
    animation: ai-loader-spin-reverse 12s linear infinite;
}

.ai-loader-halo--inner {
    inset: 21%;
    border-color: rgba(22, 124, 164, 0.18);
    animation: ai-loader-pulse 2.8s ease-in-out infinite;
}

.ai-loader-sweep {
    inset: 7%;
    background: conic-gradient(from 220deg, transparent 0 66%, rgba(22, 124, 164, 0.06) 74%, rgba(118, 215, 193, 0.4) 82%, transparent 90%);
    filter: blur(10px);
    mix-blend-mode: screen;
    animation: ai-loader-spin 3.8s linear infinite;
}

.ai-loader-word-ring {
    animation: ai-loader-spin 22s linear infinite;
}

.ai-loader-word-ring--inner {
    inset: 10%;
    animation-direction: reverse;
    animation-duration: 18s;
}

.ai-loader-word {
    --word-count: 6;
    --word-radius: 47%;
    position: absolute;
    top: 50%;
    left: 50%;
    color: rgba(20, 49, 72, 0.56);
    font-family: "Orbitron", "Montserrat", sans-serif;
    font-size: clamp(0.68rem, 1vw, 0.86rem);
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow: 0 0 1rem rgba(74, 169, 200, 0.14);
    transform:
        translate(-50%, -50%)
        rotate(calc(var(--word-index) * (360deg / var(--word-count))))
        translateY(calc(var(--word-radius) * -1))
        rotate(calc(var(--word-index) * (-360deg / var(--word-count))));
}

.ai-loader-word-ring--inner .ai-loader-word {
    --word-radius: 40%;
    color: rgba(33, 129, 115, 0.55);
    font-size: clamp(0.62rem, 0.86vw, 0.78rem);
    letter-spacing: 0.26em;
}

.ai-loader-core {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 0.8rem;
    place-items: center;
    width: 50%;
    aspect-ratio: 1;
    padding: clamp(1.4rem, 2vw, 1.9rem);
    border-radius: 50%;
    text-align: center;
    background:
        radial-gradient(circle at 50% 25%, rgba(118, 215, 193, 0.24), rgba(74, 169, 200, 0.12) 34%, rgba(229, 237, 242, 0.96) 76%),
        linear-gradient(180deg, rgba(247, 250, 252, 0.98), rgba(221, 230, 236, 0.96));
    border: 1px solid rgba(74, 169, 200, 0.18);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.45) inset,
        0 0 2rem rgba(74, 169, 200, 0.12),
        0 0 4rem rgba(118, 215, 193, 0.05);
}

.ai-loader-core::before {
    content: "";
    inset: 10%;
    border: 1px solid rgba(74, 169, 200, 0.14);
    animation: ai-loader-pulse 2.4s ease-in-out infinite;
}

.ai-loader-core::after {
    content: "";
    inset: 18%;
    border: 1px solid rgba(118, 215, 193, 0.16);
    animation: ai-loader-pulse 3.2s ease-in-out infinite reverse;
}

.ai-loader-core-kicker {
    color: rgba(22, 124, 164, 0.82);
    font-family: "Orbitron", "Montserrat", sans-serif;
    font-size: clamp(0.58rem, 0.78vw, 0.74rem);
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.ai-loader-core-title {
    margin: 0;
    max-width: 12ch;
    font-size: clamp(1.1rem, 1.75vw, 1.6rem);
    font-weight: 700;
    line-height: 1.1;
}

.ai-loader-core-copy {
    margin: 0;
    max-width: 16ch;
    color: rgba(20, 49, 72, 0.62);
    font-size: clamp(0.82rem, 1vw, 0.96rem);
    line-height: 1.55;
}

.ai-loader-signal {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 0.3rem;
    width: min(100%, 10rem);
    height: 3rem;
}

.ai-loader-signal span {
    flex: 1 1 0;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(118, 215, 193, 0.18), rgba(74, 169, 200, 0.88));
    box-shadow: 0 0 1rem rgba(74, 169, 200, 0.18);
    transform-origin: bottom;
    animation: ai-loader-equalizer 1.25s ease-in-out infinite;
}

.ai-loader-signal span:nth-child(1) {
    height: 28%;
    animation-delay: -0.2s;
}

.ai-loader-signal span:nth-child(2) {
    height: 56%;
    animation-delay: -0.45s;
}

.ai-loader-signal span:nth-child(3) {
    height: 84%;
    animation-delay: -0.1s;
}

.ai-loader-signal span:nth-child(4) {
    height: 48%;
    animation-delay: -0.6s;
}

.ai-loader-signal span:nth-child(5) {
    height: 72%;
    animation-delay: -0.3s;
}

.ai-loader-readout {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    width: min(100%, 56rem);
}

.ai-loader-readout-card {
    display: grid;
    gap: 0.45rem;
    padding: 1rem 1.15rem;
    border: 1px solid rgba(74, 169, 200, 0.12);
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, 0.56);
    box-shadow: 0 0 2rem rgba(41, 63, 82, 0.08);
}

.ai-loader-readout-card span {
    color: rgba(17, 34, 53, 0.48);
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.ai-loader-readout-card strong {
    color: var(--ai-loader-ink);
    font-family: "Orbitron", "Montserrat", sans-serif;
    font-size: clamp(0.92rem, 1vw, 1.08rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.demo-loader-showcase {
    display: grid;
    gap: 2rem;
    padding: clamp(1.5rem, 5vw, 4rem);
}

.demo-loader-copy {
    display: grid;
    gap: 0.9rem;
    max-width: 40rem;
}

.demo-loader-panel {
    padding: clamp(1rem, 3vw, 2rem);
    border: 1px solid rgba(74, 169, 200, 0.12);
    border-radius: 2rem;
    background: linear-gradient(180deg, rgba(248, 251, 253, 0.9), rgba(230, 237, 242, 0.88));
    box-shadow: 0 1.25rem 4rem rgba(41, 63, 82, 0.1);
}

.demo-loader-panel .ai-loader-shell {
    --ai-loader-size: min(72vw, 24rem);
    min-height: 42rem;
}

@keyframes ai-loader-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes ai-loader-spin-reverse {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

@keyframes ai-loader-pulse {
    0%,
    100% {
        opacity: 0.58;
        transform: scale(0.98);
    }

    50% {
        opacity: 1;
        transform: scale(1.03);
    }
}

@keyframes ai-loader-equalizer {
    0%,
    100% {
        transform: scaleY(0.42);
        opacity: 0.52;
    }

    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

@media (max-width: 900px) {
    .ai-loader-shell {
        min-height: auto;
        padding-block: 3rem;
    }

    .ai-loader-stage--fullscreen .ai-loader-shell {
        min-height: 100vh;
    }

    .ai-loader-readout {
        grid-template-columns: 1fr;
    }

    .ai-loader-core {
        width: 58%;
    }

    .demo-loader-panel .ai-loader-shell {
        min-height: auto;
    }
}

@media (max-width: 640px) {
    .ai-loader-shell {
        --ai-loader-size: min(86vw, 24rem);
        gap: 1.5rem;
        padding-inline: 1rem;
    }

    .ai-loader-word {
        letter-spacing: 0.18em;
    }

    .ai-loader-word-ring--inner .ai-loader-word {
        letter-spacing: 0.12em;
    }

    .ai-loader-core {
        width: 62%;
    }

    .ai-loader-core-title {
        max-width: 10ch;
    }
}