/* Decorative motion stays separate from the dialog's layout and entry/exit effects. */
@property --auth-border-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

.auth-dialog-atmosphere {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 5% 20%, rgba(237, 157, 120, 0.09), transparent 40%),
        radial-gradient(ellipse at 95% 80%, rgba(170, 164, 223, 0.09), transparent 40%);
}

.auth-dialog {
    z-index: 1;
    isolation: isolate;
}

.auth-dialog::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    padding: 1px;
    border-radius: inherit;
    background: conic-gradient(
        from var(--auth-border-angle),
        #ed9d78,
        #e5a5bf 24%,
        #aaa4df 47%,
        #94c5bd 70%,
        #e7c694 86%,
        #ed9d78
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0.78;
    pointer-events: none;
    animation: auth-border-orbit 42s linear infinite;
}

html[data-theme="light"] .auth-dialog::after {
    opacity: 0.9;
}

.auth-dialog-particle {
    position: absolute;
    left: var(--auth-particle-x);
    top: var(--auth-particle-y);
    width: var(--auth-particle-size, 5px);
    height: var(--auth-particle-size, 5px);
    border-radius: 50%;
    background: var(--auth-particle-color, #e5c1a8);
    box-shadow: 0 0 14px 3px color-mix(in srgb, var(--auth-particle-color, #e5c1a8) 25%, transparent);
    filter: blur(0.8px);
    opacity: 0.35;
    animation: auth-particle-drift var(--auth-particle-duration, 30s) ease-in-out infinite alternate;
    animation-delay: var(--auth-particle-delay, 0s);
}

.auth-dialog-particle:nth-child(1) {
    --auth-particle-x: 1.4%;
    --auth-particle-y: 18%;
    --auth-particle-duration: 32s;
    --auth-particle-delay: -18s;
    --auth-particle-drift-x: 4px;
}

.auth-dialog-particle:nth-child(2) {
    --auth-particle-x: 20%;
    --auth-particle-y: 76%;
    --auth-particle-size: 4px;
    --auth-particle-color: #c1b5ea;
    --auth-particle-duration: 38s;
    --auth-particle-delay: -9s;
}

.auth-dialog-particle:nth-child(3) {
    --auth-particle-x: 32%;
    --auth-particle-y: 2%;
    --auth-particle-size: 6px;
    --auth-particle-duration: 35s;
    --auth-particle-delay: -27s;
    --auth-particle-drift-y: 5px;
}

.auth-dialog-particle:nth-child(4) {
    --auth-particle-x: 44%;
    --auth-particle-y: 98%;
    --auth-particle-size: 3px;
    --auth-particle-color: #b0d4ce;
    --auth-particle-duration: 29s;
    --auth-particle-delay: -14s;
    --auth-particle-drift-y: 5px;
}

.auth-dialog-particle:nth-child(5) {
    --auth-particle-x: 58%;
    --auth-particle-y: 14%;
    --auth-particle-size: 4px;
    --auth-particle-color: #edbdcc;
    --auth-particle-duration: 41s;
    --auth-particle-delay: -30s;
}

.auth-dialog-particle:nth-child(6) {
    --auth-particle-x: 72%;
    --auth-particle-y: 84%;
    --auth-particle-size: 6px;
    --auth-particle-duration: 36s;
    --auth-particle-delay: -8s;
}

.auth-dialog-particle:nth-child(7) {
    --auth-particle-x: 98.2%;
    --auth-particle-y: 22%;
    --auth-particle-size: 3px;
    --auth-particle-color: #b0d4ce;
    --auth-particle-duration: 33s;
    --auth-particle-delay: -22s;
    --auth-particle-drift-x: 4px;
}

.auth-dialog-particle:nth-child(8) {
    --auth-particle-x: 98.2%;
    --auth-particle-y: 67%;
    --auth-particle-size: 5px;
    --auth-particle-color: #c1b5ea;
    --auth-particle-duration: 40s;
    --auth-particle-delay: -13s;
    --auth-particle-drift-x: 4px;
}

.auth-dialog-particle:nth-child(9) {
    --auth-particle-x: 1.4%;
    --auth-particle-y: 51%;
    --auth-particle-size: 3px;
    --auth-particle-duration: 37s;
    --auth-particle-delay: -25s;
    --auth-particle-drift-x: 4px;
}

.auth-dialog-particle:nth-child(10) {
    --auth-particle-x: 80%;
    --auth-particle-y: 7%;
    --auth-particle-size: 4px;
    --auth-particle-color: #edbdcc;
    --auth-particle-duration: 31s;
    --auth-particle-delay: -16s;
}

@keyframes auth-border-orbit {
    to { --auth-border-angle: 360deg; }
}

@keyframes auth-particle-drift {
    from {
        transform: translate3d(calc(-1 * var(--auth-particle-drift-x, 18px)), var(--auth-particle-drift-y, 24px), 0);
        opacity: 0.18;
    }
    to {
        transform: translate3d(var(--auth-particle-drift-x, 18px), calc(-1 * var(--auth-particle-drift-y, 24px)), 0);
        opacity: 0.48;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-dialog::after {
        animation: none;
        --auth-border-angle: 25deg;
    }

    .auth-dialog-particle {
        animation: none;
        transform: none;
        opacity: 0.2;
    }
}
