/*
 * MindCore-Desk — brand layer.
 *
 * Loaded after the theme/branding sheets on every page. Carries the brand
 * gradient (electric blue -> violet/magenta -> green), the soft neon glow and
 * the flowing wave motion from the MindCore-Desk splash art, so the login,
 * console chrome and stand-alone pages all share one look.
 * Motion is disabled for users who ask for reduced motion.
 */

:root {
    --mc-blue: #1e90ff;
    --mc-cyan: #22d3ee;
    --mc-violet: #8b5cf6;
    --mc-magenta: #d946ef;
    --mc-green: #22c55e;
    --mc-lime: #a3e635;
    --mc-navy: #070b1a;
    --mc-gradient: linear-gradient(90deg, #1e90ff 0%, #22d3ee 22%, #8b5cf6 48%, #d946ef 66%, #22c55e 86%, #a3e635 100%);
    --mc-gradient-soft: linear-gradient(120deg, rgba(30, 144, 255, 0.22), rgba(139, 92, 246, 0.2) 50%, rgba(34, 197, 94, 0.18));
    --mc-text-gradient: linear-gradient(90deg, #22d3ee 0%, #4c8dff 30%, #a855f7 60%, #d946ef 80%, #22d3ee 100%);
    --mc-glow: 0 0 18px rgba(76, 141, 255, 0.45), 0 0 42px rgba(168, 85, 247, 0.25);
}

@keyframes mcGradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes mcGlowPulse {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(76, 141, 255, 0.55)) drop-shadow(0 0 16px rgba(168, 85, 247, 0.25)); }
    50% { filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.7)) drop-shadow(0 0 26px rgba(217, 70, 239, 0.35)); }
}

@keyframes mcFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes mcKenBurns {
    0% { transform: scale(1.02) translate3d(0, 0, 0); }
    100% { transform: scale(1.08) translate3d(0, -1%, 0); }
}

@keyframes mcWaveDrift {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

@keyframes mcWaveBob {
    0%, 100% { transform: translateY(0) scaleY(1); }
    50% { transform: translateY(-10px) scaleY(1.08); }
}

@keyframes mcParticles {
    0% { background-position: 0 0, 0 0, 0 0; }
    100% { background-position: 0 -600px, 0 -400px, 0 -300px; }
}

@keyframes mcAurora {
    0% { transform: translate3d(-6%, -4%, 0) rotate(0deg); }
    50% { transform: translate3d(5%, 4%, 0) rotate(8deg); }
    100% { transform: translate3d(-6%, -4%, 0) rotate(0deg); }
}

/* ---------- Shared brand helpers ---------- */

.mc-gradient-text,
.ux35-topbar-logo .brand-name,
.login-page .mc-login-wordmark {
    background: var(--mc-text-gradient);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: mcGradientFlow 9s ease-in-out infinite;
}

/* Primary buttons: animated brand gradient with neon glow */
.btn-primary,
.btn.btn-primary {
    background-image: linear-gradient(90deg, #1e6bff 0%, #4c8dff 25%, #8b5cf6 55%, #b44cf0 75%, #1e6bff 100%) !important;
    background-size: 220% 100% !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 4px 18px -6px rgba(76, 141, 255, 0.55), 0 2px 10px -4px rgba(168, 85, 247, 0.45);
    animation: mcGradientFlow 8s ease-in-out infinite;
    transition: box-shadow 0.2s ease, transform 0.15s ease, filter 0.2s ease;
}
.btn-primary:hover:not(:disabled),
.btn.btn-primary:hover:not(:disabled) {
    filter: brightness(1.08) saturate(1.1);
    box-shadow: 0 6px 24px -6px rgba(34, 211, 238, 0.6), 0 4px 18px -6px rgba(217, 70, 239, 0.55);
}
.btn-primary:active:not(:disabled) { transform: translateY(1px); }

/* Focus ring follows the brand blue/violet */
.form-input:focus,
input.form-input:focus,
select.form-input:focus,
textarea.form-input:focus {
    border-color: #6c8cff !important;
    box-shadow: 0 0 0 3px rgba(76, 141, 255, 0.22), 0 0 18px -4px rgba(168, 85, 247, 0.45) !important;
}

/* ---------- Console chrome (UX 3.5 / 3.6 shells and classic sidebar) ---------- */

.ux35-topbar {
    background-image: linear-gradient(90deg, rgba(30, 144, 255, 0) 0%, #1e90ff 12%, #8b5cf6 40%, #d946ef 55%, #22c55e 78%, rgba(163, 230, 53, 0) 100%);
    background-repeat: no-repeat;
    background-size: 200% 2px;
    background-position: 0% 100%;
    animation: mcGradientFlow 12s linear infinite;
}

.ux35-topbar-logo img,
.sidebar-logo img,
.sidebar-logo-img {
    object-fit: contain !important;
    border-radius: 0 !important;
    animation: mcGlowPulse 5s ease-in-out infinite;
}
.ux35-topbar-logo .brand-name {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.ux35-sidebar-item.active,
.sidebar-item.active {
    background-image: var(--mc-gradient-soft);
    box-shadow: inset 3px 0 0 0 #4c8dff, inset 4px 0 12px -6px rgba(168, 85, 247, 0.6);
}

.sidebar-attribution-powered,
.ux35-sidebar-footer span {
    letter-spacing: 0.01em;
}

/* ---------- Login ---------- */

body.login-page {
    background: radial-gradient(1200px 700px at 15% 85%, rgba(30, 144, 255, 0.10), transparent 60%),
                radial-gradient(900px 600px at 85% 15%, rgba(168, 85, 247, 0.10), transparent 60%),
                var(--mc-navy);
}

.login-page .login-promo {
    background: #050916;
    isolation: isolate;
}

.login-page .login-promo-slide.is-active .login-promo-slide-bg {
    animation: mcKenBurns 16s ease-out both;
}

.login-page .login-promo-slide-overlay {
    background: linear-gradient(180deg,
        rgba(5, 9, 22, 0.05) 0%,
        rgba(5, 9, 22, calc(var(--slide-overlay, 0.3) * 0.6)) 52%,
        rgba(5, 9, 22, 0.82) 100%);
}

.login-page .login-promo-title {
    background: linear-gradient(90deg, #ffffff 0%, #bfe8ff 35%, #e3c6ff 70%, #c9ffd9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 2px 14px rgba(30, 144, 255, 0.35));
}
.login-page .login-promo-copy::before {
    content: '';
    display: block;
    width: 72px;
    height: 3px;
    margin-bottom: 16px;
    border-radius: 3px;
    background: var(--mc-gradient);
    background-size: 200% 100%;
    box-shadow: 0 0 14px rgba(76, 141, 255, 0.7);
    animation: mcGradientFlow 6s ease-in-out infinite;
}

.login-page .login-promo-dot.is-active {
    background: var(--mc-gradient);
    box-shadow: 0 0 10px rgba(76, 141, 255, 0.8);
}

/* Flowing neon waves + drifting particles over the splash */
.mc-wave-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
    mix-blend-mode: screen;
}
.mc-wave-layer .mc-wave {
    position: absolute;
    left: 0;
    width: 200%;
    height: 40%;
    bottom: 30%;
    animation: mcWaveDrift 22s linear infinite;
    opacity: 0.55;
}
.mc-wave-layer .mc-wave svg {
    width: 100%;
    height: 100%;
    display: block;
    animation: mcWaveBob 7s ease-in-out infinite;
}
.mc-wave-layer .mc-wave-2 { bottom: 24%; animation-duration: 30s; animation-direction: reverse; opacity: 0.4; }
.mc-wave-layer .mc-wave-2 svg { animation-duration: 9s; animation-delay: -3s; }
.mc-wave-layer .mc-wave-3 { bottom: 38%; animation-duration: 38s; opacity: 0.28; }
.mc-wave-layer .mc-wave-3 svg { animation-duration: 11s; animation-delay: -5s; }
.mc-wave-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1.6px 1.6px at 20px 30px, rgba(125, 211, 252, 0.9), transparent 60%),
        radial-gradient(1.2px 1.2px at 140px 90px, rgba(196, 181, 253, 0.8), transparent 60%),
        radial-gradient(1.4px 1.4px at 260px 160px, rgba(134, 239, 172, 0.75), transparent 60%);
    background-size: 300px 300px, 240px 240px, 360px 360px;
    animation: mcParticles 40s linear infinite;
    opacity: 0.7;
}

.login-page.login-layout-single .login-main,
.login-page.login-layout-slides .login-main {
    background: #0b1024;
    border-left: 1px solid rgba(91, 104, 166, 0.35);
    position: relative;
    isolation: isolate;
}
.login-page.login-layout-single .login-main::before,
.login-page.login-layout-slides .login-main::before {
    content: '';
    position: absolute;
    inset: -20%;
    z-index: -1;
    background:
        radial-gradient(40% 35% at 20% 25%, rgba(30, 144, 255, 0.22), transparent 70%),
        radial-gradient(38% 32% at 80% 70%, rgba(168, 85, 247, 0.2), transparent 70%),
        radial-gradient(30% 30% at 40% 95%, rgba(34, 197, 94, 0.14), transparent 70%);
    filter: blur(10px);
    animation: mcAurora 18s ease-in-out infinite;
}
.login-page.login-layout-single .login-main::after,
.login-page.login-layout-slides .login-main::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #1e90ff, #8b5cf6 45%, #d946ef 60%, #22c55e);
    background-size: 100% 200%;
    box-shadow: 0 0 16px rgba(76, 141, 255, 0.6);
    animation: mcGradientFlow 10s ease-in-out infinite;
}

.login-layout-classic .login-card,
.login-card {
    position: relative;
}
.login-layout-classic .login-card {
    background: rgba(13, 19, 40, 0.78);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(91, 104, 166, 0.45);
    box-shadow: var(--mc-glow);
}

.login-page .login-logo {
    flex-direction: column;
    gap: 10px;
}
.login-page .login-logo-img {
    width: 92px !important;
    height: 92px !important;
    max-height: 92px !important;
    object-fit: contain !important;
    border-radius: 0 !important;
    animation: mcGlowPulse 5s ease-in-out infinite, mcFloat 6s ease-in-out infinite;
}
.login-page .mc-login-wordmark {
    display: block;
    font-size: clamp(1.6rem, 2.4vw, 2.1rem);
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.1;
    filter: drop-shadow(0 0 14px rgba(76, 141, 255, 0.35));
}
.login-page .login-title { color: #e6eaff; }
.login-page .login-subtitle { color: #a6b0d4; }

.login-page .login-btn.btn-primary {
    font-weight: 600;
    letter-spacing: 0.02em;
}

.login-page .form-input {
    background: rgba(9, 14, 32, 0.75);
    border-color: rgba(93, 106, 168, 0.55);
}

.login-page .login-footer p {
    color: #8590b8;
}

/* ---------- Light theme tweaks ---------- */
html[data-theme="light"] .ux35-sidebar-item.active,
html[data-theme="light"] .sidebar-item.active {
    background-image: linear-gradient(120deg, rgba(31, 95, 224, 0.12), rgba(124, 58, 237, 0.1) 50%, rgba(22, 163, 74, 0.08));
}

@media (prefers-reduced-motion: reduce) {
    .btn-primary, .btn.btn-primary,
    .ux35-topbar,
    .ux35-topbar-logo img, .sidebar-logo img, .sidebar-logo-img,
    .mc-gradient-text, .ux35-topbar-logo .brand-name,
    .login-page .mc-login-wordmark,
    .login-page .login-logo-img,
    .login-page .login-promo-slide.is-active .login-promo-slide-bg,
    .login-page .login-promo-copy::before,
    .mc-wave-layer .mc-wave, .mc-wave-layer .mc-wave svg, .mc-wave-layer::after,
    .login-page .login-main::before, .login-page .login-main::after {
        animation: none !important;
    }
}
