html,
body {
    font-family: var(--font-family-base);
    background-color: var(--theme-background);
    color: var(--theme-text-primary);
    margin: 0;
    line-height: 1.5;
    overflow-x: hidden;
    overflow-y: auto;
    transition: background-color var(--duration-mid) var(--ease-out), color var(--duration-mid) var(--ease-out);
}

@keyframes subtle-float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-3px);
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

/* FUI Premium Animation System */
@keyframes fui-breathe {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }
}

@keyframes fui-glow {

    0%,
    100% {
        box-shadow: 0 0 12px var(--theme-accent);
    }

    50% {
        box-shadow: 0 0 24px var(--theme-accent);
    }
}

@keyframes fui-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fui-scale-in {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

:root {
    --font-family-base: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

    --theme-background: #f4f7fd;
    --theme-surface: rgba(255, 255, 255, 0.94);
    --theme-surface-alt: rgba(255, 255, 255, 0.82);
    --theme-surface-muted: rgba(245, 248, 255, 0.7);
    --theme-surface-pop: rgba(255, 255, 255, 0.98);
    --theme-border: rgba(148, 163, 184, 0.14);
    --theme-border-strong: rgba(100, 116, 139, 0.28);
    --theme-shadow-soft: 0 18px 32px rgba(15, 23, 42, 0.12);
    --theme-shadow-pop: 0 22px 44px rgba(15, 23, 42, 0.18);
    --theme-overlay: rgba(15, 23, 42, 0.22);

    --theme-text-primary: #101828;
    --theme-text-secondary: #334155;
    --theme-text-muted: #38475b;
    --theme-text-inverse: #ffffff;

    --theme-accent: #2563eb;
    --theme-accent-active: #1d4ed8;
    --theme-accent-soft: rgba(37, 99, 235, 0.18);
    --theme-accent-strong: rgba(37, 99, 235, 0.32);

    --pane-background: linear-gradient(160deg, rgba(18, 32, 58, 0.96) 0%, rgba(24, 43, 78, 0.94) 50%, rgba(16, 25, 44, 0.97) 100%);
    --pane-border: rgba(59, 102, 175, 0.22);
    --pane-shadow: 4px 0 24px rgba(15, 23, 42, 0.24);
    --pane-text: rgba(235, 238, 255, 0.94);
    --pane-text-muted: rgba(203, 213, 225, 0.85);
    --pane-chip-bg: rgba(255, 255, 255, 0.08);
    --pane-chip-hover: rgba(203, 213, 225, 0.2);

    --surface-card: var(--theme-surface);
    --surface-card-alt: var(--theme-surface-alt);
    --surface-elevated: var(--theme-surface-pop);

    --theme-content-surface: color-mix(in srgb, var(--theme-surface) 94%, transparent 6%);
    --theme-content-surface-alt: color-mix(in srgb, var(--theme-surface-alt) 92%, transparent 8%);
    --theme-content-border: rgba(148, 163, 184, 0.26);
    --theme-content-shadow: 0 20px 44px rgba(15, 23, 42, 0.16);
    --theme-content-backdrop-blur: 16px;
    --theme-surface-tertiary: rgba(226, 232, 240, 0.48);
    --theme-scrollbar-thumb: rgba(148, 163, 184, 0.55);
    --theme-focus-ring: color-mix(in srgb, var(--theme-accent) 28%, transparent 72%);
    --theme-chip-background: color-mix(in srgb, var(--theme-surface) 88%, transparent 12%);
    --theme-chip-hover: color-mix(in srgb, var(--theme-accent-soft) 65%, transparent 35%);
    --theme-chip-border: rgba(148, 163, 184, 0.32);

    --control-border: color-mix(in srgb, var(--theme-border-strong) 65%, transparent 35%);
    --control-border-hover: color-mix(in srgb, var(--theme-accent) 40%, var(--control-border) 60%);
    --control-background: color-mix(in srgb, var(--theme-surface) 90%, transparent 10%);
    --control-background-muted: color-mix(in srgb, var(--theme-surface-alt) 92%, transparent 8%);
    --control-text: var(--theme-text-primary);

    --layout-content-max-width: min(100%, 1240px);
    --layout-content-padding-x: clamp(1.4rem, 3.2vw, 2.8rem);
    --layout-content-padding-y: clamp(1.6rem, 3.5vw, 2.8rem);
    --layout-content-radius: 24px;
    --layout-content-shadow: var(--theme-shadow-soft);
    --layout-content-justify: center;

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --duration-fast: 140ms;
    --duration-mid: 220ms;
    --ease-out: cubic-bezier(0.2, 0, 0, 1);
}

:root[data-theme="velvet"] {
    --theme-background: #18091f;
    --theme-surface: rgba(40, 18, 58, 0.94);
    --theme-surface-alt: rgba(55, 26, 78, 0.88);
    --theme-surface-muted: rgba(90, 36, 120, 0.5);
    --theme-surface-pop: rgba(28, 12, 44, 0.95);
    --theme-border: rgba(166, 113, 208, 0.32);
    --theme-border-strong: rgba(236, 72, 153, 0.42);
    --theme-shadow-soft: 0 22px 46px rgba(10, 0, 26, 0.46);
    --theme-shadow-pop: 0 26px 56px rgba(10, 0, 26, 0.54);
    --theme-overlay: rgba(18, 2, 34, 0.32);

    --theme-text-primary: #f8f5ff;
    --theme-text-secondary: rgba(226, 208, 255, 0.8);
    --theme-text-muted: rgba(222, 205, 255, 0.78);
    --theme-text-inverse: #fdf8ff;

    --theme-accent: #c084fc;
    --theme-accent-active: #a855f7;
    --theme-accent-soft: rgba(192, 132, 252, 0.24);
    --theme-accent-strong: rgba(236, 72, 153, 0.36);

    --pane-background: linear-gradient(165deg, rgba(45, 10, 61, 0.96) 0%, rgba(68, 20, 83, 0.92) 55%, rgba(25, 6, 41, 0.96) 100%);
    --pane-border: rgba(236, 72, 153, 0.28);
    --pane-shadow: 4px 0 28px rgba(10, 0, 26, 0.42);
    --pane-text: rgba(245, 238, 255, 0.94);
    --pane-text-muted: rgba(232, 222, 255, 0.82);
    --pane-chip-bg: rgba(236, 72, 153, 0.26);
    --pane-chip-hover: rgba(192, 132, 252, 0.3);

    --surface-card: rgba(40, 18, 58, 0.96);
    --surface-card-alt: rgba(55, 22, 76, 0.86);
    --surface-elevated: rgba(30, 12, 48, 0.96);

    --theme-content-surface: rgba(40, 18, 58, 0.96);
    --theme-content-surface-alt: rgba(55, 26, 78, 0.92);
    --theme-content-border: rgba(166, 113, 208, 0.38);
    --theme-content-shadow: 0 24px 52px rgba(6, 0, 18, 0.5);
    --theme-surface-tertiary: rgba(87, 50, 116, 0.52);
    --theme-scrollbar-thumb: rgba(166, 113, 208, 0.6);
    --theme-focus-ring: color-mix(in srgb, var(--theme-accent) 32%, transparent 68%);
    --theme-chip-background: rgba(73, 33, 103, 0.72);
    --theme-chip-hover: rgba(192, 132, 252, 0.32);
    --theme-chip-border: rgba(166, 113, 208, 0.42);

    --control-border: rgba(166, 113, 208, 0.5);
    --control-border-hover: color-mix(in srgb, var(--theme-accent) 55%, rgba(166, 113, 208, 0.5) 45%);
    --control-background: rgba(46, 20, 68, 0.92);
    --control-background-muted: rgba(58, 26, 82, 0.9);
    --control-text: var(--theme-text-primary);

    --layout-content-shadow: 0 26px 56px rgba(6, 0, 18, 0.55);
}

:root[data-theme="solstice"] {
    --theme-background: #fdf5e7;
    --theme-surface: rgba(255, 250, 240, 0.95);
    --theme-surface-alt: rgba(255, 236, 210, 0.82);
    --theme-surface-muted: rgba(253, 224, 171, 0.5);
    --theme-surface-pop: rgba(255, 244, 226, 0.98);
    --theme-border: rgba(253, 194, 120, 0.32);
    --theme-border-strong: rgba(253, 174, 84, 0.46);
    --theme-shadow-soft: 0 18px 36px rgba(126, 70, 19, 0.24);
    --theme-shadow-pop: 0 24px 52px rgba(126, 70, 19, 0.3);
    --theme-overlay: rgba(96, 52, 15, 0.24);

    --theme-text-primary: #361d0d;
    --theme-text-secondary: rgba(54, 29, 13, 0.78);
    --theme-text-muted: rgba(90, 58, 28, 0.58);

    --theme-accent: #f97316;
    --theme-accent-active: #e85c0c;
    --theme-accent-soft: rgba(249, 115, 22, 0.2);
    --theme-accent-strong: rgba(234, 88, 12, 0.28);

    --pane-background: linear-gradient(160deg, rgba(116, 60, 19, 0.95) 0%, rgba(147, 78, 23, 0.92) 55%, rgba(84, 41, 12, 0.95) 100%);
    --pane-border: rgba(253, 194, 90, 0.28);
    --pane-shadow: 4px 0 26px rgba(97, 49, 14, 0.35);
    --pane-text: rgba(255, 247, 234, 0.94);
    --pane-text-muted: rgba(254, 231, 196, 0.72);
    --pane-chip-bg: rgba(253, 200, 126, 0.24);
    --pane-chip-hover: rgba(249, 115, 22, 0.28);

    --surface-card: rgba(255, 250, 240, 0.95);
    --surface-card-alt: rgba(255, 236, 210, 0.85);
    --surface-elevated: rgba(255, 244, 226, 0.98);

    --theme-content-surface: rgba(255, 250, 240, 0.96);
    --theme-content-surface-alt: rgba(255, 236, 210, 0.9);
    --theme-content-border: rgba(253, 194, 120, 0.38);
    --theme-content-shadow: 0 22px 44px rgba(117, 56, 12, 0.24);
    --theme-surface-tertiary: rgba(249, 215, 160, 0.48);
    --theme-scrollbar-thumb: rgba(253, 194, 120, 0.6);
    --theme-focus-ring: color-mix(in srgb, var(--theme-accent) 32%, transparent 68%);
    --theme-chip-background: rgba(255, 240, 224, 0.86);
    --theme-chip-hover: rgba(249, 115, 22, 0.22);
    --theme-chip-border: rgba(253, 194, 120, 0.42);

    --control-border: rgba(253, 174, 84, 0.48);
    --control-border-hover: color-mix(in srgb, var(--theme-accent) 55%, rgba(253, 174, 84, 0.48) 45%);
    --control-background: rgba(255, 248, 232, 0.95);
    --control-background-muted: rgba(255, 236, 210, 0.88);
    --control-text: var(--theme-text-primary);
}

:root[data-theme="nebula"] {
    --theme-background: #06131f;
    --theme-surface: rgba(10, 25, 40, 0.94);
    --theme-surface-alt: rgba(14, 36, 55, 0.9);
    --theme-surface-muted: rgba(30, 58, 80, 0.54);
    --theme-surface-pop: rgba(8, 24, 38, 0.96);
    --theme-border: rgba(56, 189, 248, 0.28);
    --theme-border-strong: rgba(94, 234, 212, 0.4);
    --theme-shadow-soft: 0 22px 46px rgba(3, 10, 24, 0.48);
    --theme-shadow-pop: 0 26px 56px rgba(3, 10, 24, 0.56);
    --theme-overlay: rgba(3, 12, 24, 0.32);

    --theme-text-primary: #e2f3ff;
    --theme-text-secondary: rgba(195, 216, 235, 0.78);
    --theme-text-muted: rgba(176, 208, 232, 0.75);
    --theme-text-inverse: #f6fbff;

    --theme-accent: #38bdf8;
    --theme-accent-active: #0ea5e9;
    --theme-accent-soft: rgba(56, 189, 248, 0.28);
    --theme-accent-strong: rgba(14, 165, 233, 0.32);

    --pane-background: linear-gradient(168deg, rgba(8, 19, 32, 0.96) 0%, rgba(10, 34, 52, 0.93) 55%, rgba(6, 16, 28, 0.97) 100%);
    --pane-border: rgba(56, 189, 248, 0.3);
    --pane-shadow: 4px 0 28px rgba(2, 10, 20, 0.42);
    --pane-text: rgba(228, 240, 255, 0.94);
    --pane-text-muted: rgba(208, 226, 246, 0.84);
    --pane-chip-bg: rgba(56, 189, 248, 0.26);
    --pane-chip-hover: rgba(14, 165, 233, 0.32);
    --surface-card: rgba(10, 25, 40, 0.95);
    --surface-card-alt: rgba(12, 32, 48, 0.9);
    --surface-elevated: rgba(8, 22, 36, 0.96);

    --theme-content-surface: rgba(10, 25, 40, 0.95);
    --theme-content-surface-alt: rgba(12, 32, 48, 0.92);
    --theme-content-border: rgba(56, 189, 248, 0.36);
    --theme-content-shadow: 0 26px 56px rgba(2, 8, 18, 0.52);
    --theme-surface-tertiary: rgba(30, 58, 80, 0.5);
    --theme-scrollbar-thumb: rgba(56, 189, 248, 0.58);
    --theme-focus-ring: color-mix(in srgb, var(--theme-accent) 34%, transparent 66%);
    --theme-chip-background: rgba(12, 32, 48, 0.88);
    --theme-chip-hover: rgba(56, 189, 248, 0.34);
    --theme-chip-border: rgba(56, 189, 248, 0.4);

    --control-border: rgba(56, 189, 248, 0.42);
    --control-border-hover: color-mix(in srgb, var(--theme-accent) 55%, rgba(56, 189, 248, 0.42) 45%);
    --control-background: rgba(12, 30, 48, 0.94);
    --control-background-muted: rgba(14, 36, 55, 0.9);
    --control-text: var(--theme-text-primary);

    --layout-content-shadow: 0 28px 60px rgba(2, 8, 18, 0.55);
}

/* NEBULA FUI - Premium Futuristic Theme */
:root[data-theme="nebula-fui"] {
    --theme-background: #0c1222;
    --theme-surface: rgba(16, 24, 40, 0.95);
    --theme-surface-alt: rgba(20, 30, 48, 0.92);
    --theme-surface-muted: rgba(28, 40, 60, 0.75);
    --theme-surface-pop: rgba(12, 20, 36, 0.98);
    --theme-border: rgba(99, 179, 237, 0.12);
    --theme-border-strong: rgba(99, 179, 237, 0.25);
    --theme-shadow-soft: 0 16px 40px rgba(0, 0, 0, 0.35);
    --theme-shadow-pop: 0 24px 56px rgba(0, 0, 0, 0.45);
    --theme-overlay: rgba(8, 12, 24, 0.6);
    --theme-text-primary: #f1f5f9;
    --theme-text-secondary: rgba(203, 213, 225, 0.9);
    --theme-text-muted: rgba(148, 163, 184, 0.8);
    --theme-text-inverse: #0c1222;
    --theme-accent: #3b82f6;
    --theme-accent-active: #2563eb;
    --theme-accent-soft: rgba(59, 130, 246, 0.15);
    --theme-accent-strong: rgba(59, 130, 246, 0.3);
    --pane-background: linear-gradient(180deg, rgba(12, 18, 34, 0.98) 0%, rgba(16, 24, 44, 0.96) 100%);
    --pane-border: rgba(99, 179, 237, 0.08);
    --pane-shadow: 1px 0 20px rgba(0, 0, 0, 0.3);
    --pane-text: rgba(241, 245, 249, 0.95);
    --pane-text-muted: rgba(148, 163, 184, 0.75);
    --pane-chip-bg: rgba(59, 130, 246, 0.08);
    --pane-chip-hover: rgba(59, 130, 246, 0.15);
    --surface-card: rgba(16, 24, 40, 0.95);
    --surface-card-alt: rgba(20, 30, 48, 0.9);
    --surface-elevated: rgba(12, 20, 36, 0.98);
    --theme-content-surface: rgba(16, 24, 40, 0.92);
    --theme-content-surface-alt: rgba(20, 30, 48, 0.88);
    --theme-content-border: rgba(99, 179, 237, 0.1);
    --theme-content-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    --theme-content-backdrop-blur: 20px;
    --theme-surface-tertiary: rgba(28, 40, 60, 0.6);
    --theme-scrollbar-thumb: rgba(99, 179, 237, 0.35);
    --theme-focus-ring: rgba(59, 130, 246, 0.4);
    --theme-chip-background: rgba(20, 30, 48, 0.85);
    --theme-chip-hover: rgba(59, 130, 246, 0.12);
    --theme-chip-border: rgba(99, 179, 237, 0.15);
    --control-border: rgba(99, 179, 237, 0.2);
    --control-border-hover: rgba(59, 130, 246, 0.4);
    --control-background: rgba(16, 24, 40, 0.9);
    --control-background-muted: rgba(20, 30, 48, 0.85);
    --control-text: var(--theme-text-primary);
    --layout-content-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

:root[data-content-width="comfort"] {
    --layout-content-max-width: clamp(720px, 68vw, 960px);
    --layout-content-radius: 26px;
    --layout-content-padding-x: clamp(1.6rem, 4vw, 2.4rem);
}

:root[data-content-width="expanded"],
:root:not([data-content-width]) {
    --layout-content-max-width: 100%;
    --layout-content-radius: 20px;
    --layout-content-padding-x: clamp(0.6rem, 1.8vw, 1.4rem);
}

a,
.btn-link {
    color: var(--theme-accent);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

a:hover,
.btn-link:hover {
    color: var(--theme-accent-active);
    text-decoration: underline;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

.form-control,
.form-select,
textarea,
input[type="text"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="tel"] {
    border: 1px solid var(--control-border);
    border-radius: 12px;
    background: var(--control-background);
    color: var(--control-text);
    transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
    backdrop-filter: blur(4px);
}

.form-control:hover,
.form-select:hover,
textarea:hover,
input[type="text"]:hover,
input[type="password"]:hover,
input[type="search"]:hover,
input[type="number"]:hover,
input[type="email"]:hover,
input[type="url"]:hover,
input[type="tel"]:hover {
    border-color: var(--control-border-hover);
    background: color-mix(in srgb, var(--control-background) 95%, var(--theme-accent-soft) 5%);
}

.form-control:focus,
.form-select:focus,
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 3px var(--theme-focus-ring), 0 8px 16px color-mix(in srgb, var(--theme-accent) 12%, transparent 88%);
    outline: none;
    background: color-mix(in srgb, var(--control-background) 98%, var(--theme-accent-soft) 2%);
}

.btn {
    border-radius: 12px;
    border-width: 1px;
    border-color: var(--control-border);
    background: var(--control-background);
    color: var(--control-text);
    transition: transform var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
    opacity: 0;
    transition: opacity var(--duration-fast) var(--ease-out);
}

.btn:hover::before {
    opacity: 1;
}

.btn:hover,
.btn:focus-visible {
    border-color: var(--control-border-hover);
    background: color-mix(in srgb, var(--control-background) 80%, var(--theme-accent-soft) 20%);
    box-shadow: 0 12px 24px color-mix(in srgb, var(--theme-accent) 18%, transparent 82%);
    transform: translateY(-1px);
}

.btn-primary {
    color: var(--theme-text-inverse);
    background: linear-gradient(135deg, var(--theme-accent) 0%, color-mix(in srgb, var(--theme-accent) 90%, var(--theme-accent-active) 10%) 100%);
    border-color: var(--theme-accent-active);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--theme-accent) 28%, transparent 72%);
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0) 100%);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: linear-gradient(135deg, var(--theme-accent-active) 0%, color-mix(in srgb, var(--theme-accent-active) 85%, #000 15%) 100%);
    border-color: color-mix(in srgb, var(--theme-accent-active) 88%, #000 12%);
    box-shadow: 0 14px 32px color-mix(in srgb, var(--theme-accent) 38%, transparent 62%);
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: var(--theme-accent);
    background: transparent;
    border-color: var(--theme-accent);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible {
    background: var(--theme-accent);
    color: var(--theme-text-inverse);
    border-color: var(--theme-accent-active);
}

.btn-outline-secondary {
    color: var(--theme-text-secondary);
    background: transparent;
    border-color: var(--control-border);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
    color: var(--theme-accent);
    border-color: var(--theme-accent);
    background: var(--theme-accent-soft);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--theme-focus-ring);
    border-color: var(--theme-accent);
    outline: none;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: var(--theme-scrollbar-thumb);
    border-radius: 999px;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.9), rgba(220, 38, 38, 0.9));
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    color: var(--theme-text-inverse);
    box-shadow: 0 18px 30px rgba(185, 28, 28, 0.28);
}

.blazor-error-boundary::after {
    content: "An unexpected error has occurred.";
    font-weight: 600;
}

.form-floating>.form-control::placeholder {
    color: color-mix(in srgb, var(--theme-text-muted) 60%, transparent 40%);
    text-align: end;
}

.form-floating>.form-control:focus::placeholder {
    text-align: start;
}