import { useMemo } from 'react'; import { useTheme } from '../lib/theme-context'; function buildEmberParticles(theme) { return Array.from({ length: 12 }, (_, i) => { const warmChannel = 100 + Math.random() * 100; const lightWarmChannel = 100 + Math.random() * 46; return { key: i, left: `${Math.random() * 100}%`, top: `${Math.random() * 100}%`, animationDelay: `${Math.random() * 8}s`, animationDuration: `${8 + Math.random() * 4}s`, backgroundColor: theme === 'dark' ? `rgba(255, ${warmChannel}, 0, 0.6)` : `rgba(251, ${lightWarmChannel}, 60, 0.4)`, boxShadow: theme === 'dark' ? `0 0 8px rgba(255, ${warmChannel}, 0, 0.4)` : `0 0 6px rgba(251, ${lightWarmChannel}, 60, 0.3)`, }; }); } export default function AuthLayout({ children }) { const { theme } = useTheme(); const embers = useMemo(() => buildEmberParticles(theme), [theme]); return (