import { cn } from '../_lib/utils';

interface PortalLoginShellProps {
  title: string;
  subtitle: string;
  accentClass?: string;
  children: React.ReactNode;
  footer?: React.ReactNode;
}

export function PortalLoginShell({ title, subtitle, accentClass = 'bg-primary', children, footer }: PortalLoginShellProps) {
  return (
    <div className="min-h-screen grid lg:grid-cols-2">
      {/* Left branding panel */}
      <div className={cn('hidden lg:flex flex-col justify-between p-10 text-white', accentClass)}>
        <div className="flex items-center gap-2">
          <span className="font-bold text-xl tracking-tight">TOWER</span>
        </div>
        <div>
          <blockquote className="space-y-2">
            <p className="text-lg font-medium leading-relaxed">
              "Community knowledge, beautifully organised."
            </p>
            <footer className="text-sm opacity-70">Insignia TOWER Platform</footer>
          </blockquote>
        </div>
      </div>

      {/* Right form panel */}
      <div className="flex items-center justify-center p-8 bg-background">
        <div className="w-full max-w-sm space-y-6">
          {/* Mobile logo */}
          <div className="flex items-center gap-2 lg:hidden">
            <span className="font-bold text-lg">TOWER</span>
          </div>

          <div className="space-y-1">
            <h1 className="text-2xl font-bold tracking-tight">{title}</h1>
            <p className="text-sm text-muted-foreground">{subtitle}</p>
          </div>

          {children}

          {footer && <div className="text-center text-sm text-muted-foreground">{footer}</div>}
        </div>
      </div>
    </div>
  );
}
