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

type Props = TextareaHTMLAttributes<HTMLTextAreaElement>

export const Textarea = forwardRef<HTMLTextAreaElement, Props>(({ className, ...props }, ref) => (
  <textarea
    ref={ref}
    className={cn(
      // Density-first: matches Input — rounded-lg, brand focus glow.
      'w-full rounded-lg border border-slate-300 bg-white px-3 py-1.5 text-sm leading-relaxed text-slate-900',
      'placeholder:text-slate-400',
      'transition-[border-color,box-shadow] focus-visible:border-brand-400 focus-visible:ring-2 focus-visible:ring-brand-500/15',
      'disabled:cursor-not-allowed disabled:bg-slate-50 disabled:opacity-70',
      className,
    )}
    {...props}
  />
))
Textarea.displayName = 'Textarea'
