import { forwardRef, type InputHTMLAttributes } from 'react'
import { cn } from '@/lib/cn'

type Props = InputHTMLAttributes<HTMLInputElement>

export const Input = forwardRef<HTMLInputElement, Props>(({ className, ...props }, ref) => (
  <input
    ref={ref}
    className={cn(
      // Compact (~34px) rounded-lg. 2026-06-16: stronger brand focus glow
      // (border brand-500 + ring /25) so the active field reads clearly.
      'h-8 w-full rounded-lg border border-slate-300 bg-white px-3 py-1.5 text-sm text-slate-900',
      'placeholder:text-slate-400',
      'transition-[border-color,box-shadow] focus-visible:border-brand-500 focus-visible:ring-2 focus-visible:ring-brand-500/25',
      'disabled:cursor-not-allowed disabled:bg-slate-50 disabled:opacity-70',
      className,
    )}
    {...props}
  />
))
Input.displayName = 'Input'
