'use client'

import Link from 'next/link'
import { useApp } from '@/components/providers/AppProvider'

export function HomeRegisterCta() {
  const { hydrated, user } = useApp()

  if (!hydrated || user) return null

  return (
    <section className="bg-brand py-20 text-white">
      <div data-reveal="lift" className="mx-auto grid max-w-[1280px] gap-10 px-6 md:grid-cols-[1fr_auto] md:items-center">
        <div>
          <h2 className="text-3xl font-extrabold md:text-4xl">注册账户，进入完整服务闭环</h2>
          <p className="mt-3 max-w-2xl text-[15px] leading-8 text-white/65">
            登录后可以继续办理咨询、预约专家、加入课程、报名活动、申请数据服务与购买智能体产品，并在个人中心查看订单和服务进度。
          </p>
        </div>
        <div className="flex flex-wrap gap-3">
          <Link href="/login" className="rounded-[4px] bg-white px-7 py-3 text-sm font-extrabold text-brand hover:bg-brand-light">立即注册</Link>
          <Link href="/membership" className="rounded-[4px] border-2 border-white/60 px-7 py-3 text-sm font-extrabold text-white hover:bg-white/10">查看会员</Link>
        </div>
      </div>
    </section>
  )
}
