
@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,600&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');


:root {
    --color-bg: #070910;
    --color-surface: #0C1118;
    --color-surface-2: #131d2a;
    --color-accent: #6C63FF;
    --color-accent-2: #00D4FF;
    --color-accent-3: #23D18B;
    --color-accent-glow: rgba(108, 99, 255, 0.35);
    --color-text: #EDF0FF;
    --color-text-muted: #7B84A0;
    --color-border: rgba(108, 99, 255, 0.18);
    --color-border-dim: rgba(255, 255, 255, 0.055);
    --color-border-hover: rgba(108, 99, 255, 0.5);
    --gradient-accent: linear-gradient(135deg, #7B72FF 0%, #00D4FF 100%);
    --gradient-text: linear-gradient(135deg, #EDF0FF 0%, #9E98FF 45%, #00D4FF 100%);
    --gradient-card: linear-gradient(160deg, rgba(108,99,255,0.06) 0%, rgba(0,212,255,0.03) 100%);
    --shadow-card: 0 4px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 50px rgba(108, 99, 255, 0.25);
    --shadow-glow2: 0 0 60px rgba(0, 212, 255, 0.18);
    --shadow-lift: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(108,99,255,0.15);
    --glass-bg: rgba(12, 17, 24, 0.65);
    --glass-blur: blur(18px);
    --glass-border: 1px solid rgba(108, 99, 255, 0.18);
    --nav-height: 68px;
    --section-pad: clamp(2.5rem, 9vw, 3rem) 0;
    --container-max: 1180px;
    --radius-card: 18px;
    --radius-sm: 10px;
    --t-fast: 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --t-base: 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --t-slow: 0.5s  cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ════════════════════════════════════════════════════════════
   THEMES for classic UI — set via "Theme" in appsettings
   (original = :root defaults above; overrides re-skin everything
   built on the CSS variables)
   ════════════════════════════════════════════════════════════ */

/* BLACK — pure black, same accents */
body.theme-black {
    --color-bg:        #000000;
    --color-surface:   #0A0A0C;
    --color-surface-2: #141417;
    --color-border:     rgba(255, 255, 255, 0.1);
    --color-border-dim: rgba(255, 255, 255, 0.07);
    --glass-bg:         rgba(8, 8, 10, 0.7);
    --shadow-card:      0 4px 32px rgba(0, 0, 0, 0.7);
}

/* COLORFUL — soothing emerald / sky / pink mix on calm navy */
body.theme-colorful {
    --color-bg:        #0B1020;
    --color-surface:   #101831;
    --color-surface-2: #182242;
    --color-accent:    #34D399;
    --color-accent-2:  #60A5FA;
    --color-accent-3:  #F472B6;
    --color-accent-glow: rgba(52, 211, 153, 0.35);
    --color-border:       rgba(96, 165, 250, 0.22);
    --color-border-hover: rgba(52, 211, 153, 0.5);
    --gradient-accent: linear-gradient(135deg, #34D399 0%, #60A5FA 55%, #F472B6 100%);
    --gradient-text:   linear-gradient(135deg, #ECFDF5 0%, #A7F3D0 35%, #93C5FD 65%, #F9A8D4 100%);
    --glass-bg:        rgba(13, 19, 38, 0.65);
    --glass-border:    1px solid rgba(96, 165, 250, 0.2);
    --shadow-glow:     0 0 50px rgba(52, 211, 153, 0.2);
    --shadow-glow2:    0 0 60px rgba(96, 165, 250, 0.16);
}

/* ORANGE — dark warm amber theme */
body.theme-orange {
    --color-bg:        #0D0906;
    --color-surface:   #150F09;
    --color-surface-2: #1F1610;
    --color-accent:    #F97316;
    --color-accent-2:  #FBBF24;
    --color-accent-3:  #34D399;
    --color-accent-glow: rgba(249, 115, 22, 0.35);
    --color-border:       rgba(249, 115, 22, 0.22);
    --color-border-hover: rgba(249, 115, 22, 0.55);
    --gradient-accent: linear-gradient(135deg, #F97316 0%, #FBBF24 100%);
    --gradient-text:   linear-gradient(135deg, #FFF7ED 0%, #FDBA74 50%, #FBBF24 100%);
    --glass-bg:        rgba(18, 12, 7, 0.68);
    --glass-border:    1px solid rgba(249, 115, 22, 0.2);
    --shadow-glow:     0 0 50px rgba(249, 115, 22, 0.22);
    --shadow-glow2:    0 0 60px rgba(251, 191, 36, 0.15);
}

/* RED — dark crimson theme */
body.theme-red {
    --color-bg:        #100507;
    --color-surface:   #170A0C;
    --color-surface-2: #221013;
    --color-accent:    #EF4444;
    --color-accent-2:  #FB7185;
    --color-accent-3:  #FBBF24;
    --color-accent-glow: rgba(239, 68, 68, 0.35);
    --color-border:       rgba(239, 68, 68, 0.22);
    --color-border-hover: rgba(239, 68, 68, 0.55);
    --gradient-accent: linear-gradient(135deg, #EF4444 0%, #FB7185 100%);
    --gradient-text:   linear-gradient(135deg, #FEF2F2 0%, #FCA5A5 50%, #FB7185 100%);
    --glass-bg:        rgba(20, 8, 10, 0.68);
    --glass-border:    1px solid rgba(239, 68, 68, 0.2);
    --shadow-glow:     0 0 50px rgba(239, 68, 68, 0.22);
    --shadow-glow2:    0 0 60px rgba(251, 113, 133, 0.15);
}

/* GREEN — dark forest theme */
body.theme-green {
    --color-bg:        #050F09;
    --color-surface:   #0A170F;
    --color-surface-2: #102217;
    --color-accent:    #22C55E;
    --color-accent-2:  #A3E635;
    --color-accent-3:  #FBBF24;
    --color-accent-glow: rgba(34, 197, 94, 0.35);
    --color-border:       rgba(34, 197, 94, 0.22);
    --color-border-hover: rgba(34, 197, 94, 0.55);
    --gradient-accent: linear-gradient(135deg, #22C55E 0%, #A3E635 100%);
    --gradient-text:   linear-gradient(135deg, #F0FDF4 0%, #86EFAC 50%, #A3E635 100%);
    --glass-bg:        rgba(8, 18, 12, 0.68);
    --glass-border:    1px solid rgba(34, 197, 94, 0.2);
    --shadow-glow:     0 0 50px rgba(34, 197, 94, 0.22);
    --shadow-glow2:    0 0 60px rgba(163, 230, 53, 0.15);
}

/* BLUE — deep ocean theme */
body.theme-blue {
    --color-bg:        #04091A;
    --color-surface:   #091126;
    --color-surface-2: #0F1A36;
    --color-accent:    #3B82F6;
    --color-accent-2:  #38BDF8;
    --color-accent-3:  #34D399;
    --color-accent-glow: rgba(59, 130, 246, 0.35);
    --color-border:       rgba(59, 130, 246, 0.22);
    --color-border-hover: rgba(59, 130, 246, 0.55);
    --gradient-accent: linear-gradient(135deg, #3B82F6 0%, #38BDF8 100%);
    --gradient-text:   linear-gradient(135deg, #EFF6FF 0%, #93C5FD 50%, #38BDF8 100%);
    --glass-bg:        rgba(7, 13, 30, 0.68);
    --glass-border:    1px solid rgba(59, 130, 246, 0.2);
    --shadow-glow:     0 0 50px rgba(59, 130, 246, 0.22);
    --shadow-glow2:    0 0 60px rgba(56, 189, 248, 0.15);
}

/* TEAL — calm aqua theme */
body.theme-teal {
    --color-bg:        #04100F;
    --color-surface:   #081816;
    --color-surface-2: #0E2320;
    --color-accent:    #14B8A6;
    --color-accent-2:  #2DD4BF;
    --color-accent-3:  #FBBF24;
    --color-accent-glow: rgba(20, 184, 166, 0.35);
    --color-border:       rgba(20, 184, 166, 0.22);
    --color-border-hover: rgba(20, 184, 166, 0.55);
    --gradient-accent: linear-gradient(135deg, #14B8A6 0%, #2DD4BF 100%);
    --gradient-text:   linear-gradient(135deg, #F0FDFA 0%, #5EEAD4 50%, #2DD4BF 100%);
    --glass-bg:        rgba(6, 19, 17, 0.68);
    --glass-border:    1px solid rgba(20, 184, 166, 0.2);
    --shadow-glow:     0 0 50px rgba(20, 184, 166, 0.22);
    --shadow-glow2:    0 0 60px rgba(45, 212, 191, 0.15);
}

/* ROSE — dark berry theme */
body.theme-rose {
    --color-bg:        #120511;
    --color-surface:   #1A0A17;
    --color-surface-2: #261021;
    --color-accent:    #F43F5E;
    --color-accent-2:  #E879F9;
    --color-accent-3:  #FBBF24;
    --color-accent-glow: rgba(244, 63, 94, 0.35);
    --color-border:       rgba(244, 63, 94, 0.22);
    --color-border-hover: rgba(244, 63, 94, 0.55);
    --gradient-accent: linear-gradient(135deg, #F43F5E 0%, #E879F9 100%);
    --gradient-text:   linear-gradient(135deg, #FFF1F2 0%, #FDA4AF 50%, #E879F9 100%);
    --glass-bg:        rgba(22, 8, 19, 0.68);
    --glass-border:    1px solid rgba(244, 63, 94, 0.2);
    --shadow-glow:     0 0 50px rgba(244, 63, 94, 0.22);
    --shadow-glow2:    0 0 60px rgba(232, 121, 249, 0.15);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: 'Space Grotesk', system-ui, sans-serif;
    line-height: 1.65;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Subtle noise grain overlay for depth */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-size: 180px 180px;
    opacity: 0.028;
    pointer-events: none;
    z-index: 9997;
}

a { color: inherit; text-decoration: none; }
img, canvas { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul, ol { list-style: none; }

/* Branded text selection */
::selection {
    background: rgba(108, 99, 255, 0.4);
    color: #fff;
}

/* Visible focus ring for keyboard users only */
:focus-visible {
    outline: 2px solid var(--color-accent-2);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Headings receive programmatic focus via FocusOnNavigate — suppress the browser outline */
h1:focus, h2:focus, h3:focus, h4:focus, h5:focus, h6:focus { outline: none; }

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Archivo', system-ui, sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}

/* ── Utility: Glass card ─────────────────────────────────── */
.glass-card {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    /* Subtle top light edge — the premium dark-UI detail */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Mouse-tracking spotlight — radial glow follows the cursor (set via --mx/--my in app.js) */
.glass-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        420px circle at var(--mx, 50%) var(--my, 50%),
        rgba(108, 99, 255, 0.1),
        rgba(0, 212, 255, 0.04) 40%,
        transparent 65%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}
.glass-card:hover::after {
    opacity: 1;
}

/* ── Utility: Gradient text ──────────────────────────────── */
.gradient-text {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Utility: Accent button ──────────────────────────────── */
.btn-primary {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-family: 'Archivo', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    background: var(--gradient-accent);
    color: #fff;
    transition: transform var(--t-fast), box-shadow var(--t-fast);
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.4);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(108, 99, 255, 0.55);
}

/* Shine sweep across the button on hover */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.55s ease;
    pointer-events: none;
}
.btn-primary:hover::before {
    left: 130%;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.73rem 2rem;
    border-radius: 50px;
    font-family: 'Archivo', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid var(--color-accent);
    color: var(--color-text);
    background: transparent;
    transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.btn-outline:hover {
    background: rgba(108, 99, 255, 0.12);
    transform: translateY(-2px);
}

/* Tactile press feedback on all buttons */
.btn-primary:active,
.btn-outline:active,
.btn-ghost:active,
.filter-btn:active {
    transform: translateY(0) scale(0.97);
}

/* ── Section layout ──────────────────────────────────────── */
.section-wrapper {
    padding: var(--section-pad);
    scroll-margin-top: var(--nav-height);
    position: relative;
    isolation: isolate;
}

.section-wrapper:nth-child(even) {
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border-dim);
    border-bottom: 1px solid var(--color-border-dim);
}

/* Subtle dot grid on surface sections */
.section-wrapper:nth-child(even)::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--color-accent-glow) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
    opacity: 0.18;
    z-index: -1;
}

/* Ambient top glow on every section — follows the active theme */
.section-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(600px 320px at 50% 0%, var(--color-accent-glow), transparent 70%);
    opacity: 0.12;
    pointer-events: none;
    z-index: -1;
}

.section-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 3rem);
}

.section-header {
    text-align: center;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
}

.section-title {
    font-family: 'Archivo', sans-serif;
    font-size: clamp(1.9rem, 4vw, 3rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    background: var(--gradient-text);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    animation: gradientShift 9s ease-in-out infinite;
}

.section-subtitle {
    margin-top: 0.85rem;
    color: var(--color-text-muted);
    font-size: 1rem;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.section-divider {
    width: 40px;
    height: 3px;
    background: var(--gradient-accent);
    border-radius: 3px;
    margin: 1.4rem auto 0;
    position: relative;
}
.section-divider::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50px;
    width: 8px;
    height: 3px;
    border-radius: 3px;
    background: var(--color-accent-2);
    opacity: 0.6;
}

/* ── MudBlazor overrides ─────────────────────────────────── */
.mud-main-content { padding-top: 0 !important; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 3px;
}

/* ── Blazor error UI ─────────────────────────────────────── */
#blazor-error-ui {
    background: #b32121;
    bottom: 0; left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
    color: #fff;
    display: none;
    font-size: 0.9rem;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* ── Ghost button ────────────────────────────────────────── */
.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.73rem 2rem;
    border-radius: 50px;
    font-family: 'Archivo', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--color-text-muted);
    background: transparent;
    transition: border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.btn-ghost:hover {
    border-color: var(--color-accent);
    color: var(--color-text);
    transform: translateY(-2px);
}

/* ── Scroll progress bar ─────────────────────────────────── */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--gradient-accent);
    z-index: 9999;
    transition: width 0.1s linear;
    pointer-events: none;
}

/* ── Active nav link ─────────────────────────────────────── */
.nav-link.is-active {
    color: var(--color-text) !important;
}
.nav-link.is-active::after {
    transform: translateX(-50%) scaleX(1) !important;
}

/* ── Back to top button ──────────────────────────────────── */
.back-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gradient-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity var(--t-base), visibility var(--t-base), transform var(--t-base);
    z-index: 900;
}
.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(108, 99, 255, 0.6);
}
.back-to-top-btn .material-icons { font-size: 22px; }

/* ── Site footer ─────────────────────────────────────────── */
.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border-dim);
    padding: 2.5rem 0 2rem;
}
.site-footer-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 3rem);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.site-footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.site-footer-brand {
    font-family: 'Archivo', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.site-footer-socials {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.site-footer-social {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.site-footer-social:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: rgba(108,99,255,0.08);
}
.site-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border-dim);
    font-size: 0.82rem;
    color: var(--color-text-muted);
}
.site-footer-copy { opacity: 0.7; }
.site-footer-built { opacity: 0.55; font-style: italic; }


/* ── 404 Not Found ───────────────────────────────────────── */
.notfound-section {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
}
.notfound-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
    padding-top: 4rem;
    padding-bottom: 4rem;
}
.notfound-code {
    font-family: 'Archivo', sans-serif;
    font-size: clamp(6rem, 18vw, 12rem);
    font-weight: 800;
    line-height: 1;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.85;
}
.notfound-title {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 700;
    color: var(--color-text);
}
.notfound-message {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    max-width: 420px;
}
.notfound-btn {
    margin-top: 0.5rem;
}

/* ════════════════════════════════════════════════════════════
   BLAZOR RECONNECT TOAST
   Replaces the default full-page "Attempting to reconnect"
   overlay. The page stays fully visible; Blazor toggles the
   components-reconnect-* classes on #components-reconnect-modal.
   ════════════════════════════════════════════════════════════ */

/* Hidden unless Blazor applies a state class */
#components-reconnect-modal { display: none; }

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: fixed;
    left: 1.25rem;
    bottom: 1.25rem;
    z-index: 10000;
    max-width: 320px;
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    background: rgba(12, 14, 20, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    font-size: 0.85rem;
    color: var(--color-text);
    animation: fadeInUp 0.3s ease both;
}

/* Amber border while retrying, red once failed/rejected */
#components-reconnect-modal.components-reconnect-show {
    border-color: rgba(251, 191, 36, 0.4);
}
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    border-color: rgba(255, 95, 87, 0.45);
}

/* Spinner — visible only while actively reconnecting */
.reconnect-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(251, 191, 36, 0.25);
    border-top-color: #FBBF24;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
    display: none;
}
#components-reconnect-modal.components-reconnect-show .reconnect-spinner { display: block; }

/* Offline icon — visible on failed/rejected */
.reconnect-icon-failed {
    display: none;
    font-size: 1.25rem !important;
    color: #FF5F57;
    flex-shrink: 0;
}
#components-reconnect-modal.components-reconnect-failed .reconnect-icon-failed,
#components-reconnect-modal.components-reconnect-rejected .reconnect-icon-failed { display: block; }

.reconnect-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

/* One message per state */
.reconnect-msg-show,
.reconnect-msg-failed,
.reconnect-msg-rejected { display: none; font-weight: 600; line-height: 1.35; }

#components-reconnect-modal.components-reconnect-show     .reconnect-msg-show     { display: block; color: #FBBF24; }
#components-reconnect-modal.components-reconnect-failed   .reconnect-msg-failed   { display: block; color: #FF5F57; }
#components-reconnect-modal.components-reconnect-rejected .reconnect-msg-rejected { display: block; color: #FF5F57; }

/* Action buttons — hidden while auto-retrying */
.reconnect-actions { display: none; gap: 0.5rem; }
#components-reconnect-modal.components-reconnect-failed   .reconnect-actions,
#components-reconnect-modal.components-reconnect-rejected .reconnect-actions { display: flex; }

/* Retry only makes sense when the circuit can be revived */
#components-reconnect-modal.components-reconnect-rejected .reconnect-btn-retry { display: none; }

.reconnect-btn {
    padding: 0.3rem 0.85rem;
    border-radius: 7px;
    font-size: 0.76rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text);
    transition: background var(--t-fast), border-color var(--t-fast);
}
.reconnect-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 480px) {
    #components-reconnect-modal.components-reconnect-show,
    #components-reconnect-modal.components-reconnect-failed,
    #components-reconnect-modal.components-reconnect-rejected {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        max-width: none;
    }
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .animate-on-scroll {
        transform: none !important;
        transition: none !important;
    }
}
