@extends('frontend.layout') @php $siteName = \App\Helpers\BrandingHelper::name(); $hero = array_merge([ 'badge' => __('Talk to our AI assistant'), 'title_line1' => __('Meet your AI guide for'), 'title_highlight' => $siteName, 'title_line2' => '', 'subtitle' => __('Ask any question, get instant answers, and let our AI agent route you to the right product, plan, or person — live, right now.'), 'cta_text' => __('Get Started Free'), 'cta_url' => '/register', 'cta2_text' => __('See Features'), 'cta2_url' => '#features', ], is_array($hero ?? null) ? $hero : []); $featureItems = $features['items'] ?? []; if (! is_array($featureItems) || count($featureItems) === 0) { $featureItems = [ ['title' => __('Always-on AI Agent'), 'desc' => __('Answers visitor questions 24/7 using your business context and the configured model.')], ['title' => __('Live Lead Capture'), 'desc' => __('Every chat becomes a structured lead with name, email, company, and use case.')], ['title' => __('Unified Inbox'), 'desc' => __('Email, WhatsApp, SMS, Slack, and Telegram in one inbox.')], ['title' => __('CRM & Deals'), 'desc' => __('Track contacts, pipelines, and lead activity from first message to closed deal.')], ['title' => __('Workflow Automation'), 'desc' => __('No-code triggers, routing, and follow-up automation.')], ['title' => __('Analytics Dashboard'), 'desc' => __('Measure conversations, conversions, AI cost, and team performance.')], ]; } $testimonialItems = $testimonials['items'] ?? []; if (! is_array($testimonialItems) || count($testimonialItems) === 0) { $testimonialItems = [ ['quote' => __('The AI agent on our homepage qualifies leads while we sleep — and the answers actually match our pricing.'), 'name' => 'Marcus Rivera', 'role' => __('CEO'), 'company' => 'GrowthStack'], ['quote' => __('Visitors leave with a clear next step every time. Our demo bookings tripled in three weeks.'), 'name' => 'Emily Watson', 'role' => __('Marketing Director'), 'company' => 'Vertex Labs'], ['quote' => __('We replaced two contact forms and a chatbot with one agent — and the inbox finally feels manageable.'), 'name' => 'Raj Patel', 'role' => __('Lead Engineer'), 'company' => 'CloudNine'], ]; } $faqItems = $faq['items'] ?? []; if (! is_array($faqItems) || count($faqItems) === 0) { $faqItems = [ ['question' => __('How does the AI agent know about my business?'), 'answer' => __('You add a short business context paragraph under Admin → Frontend Settings → Agent Configuration. The agent uses it to answer accurately and qualify leads.')], ['question' => __('Which AI providers are supported?'), 'answer' => __('OpenAI, Anthropic, Google Gemini, and Mistral. Pick the provider, paste your API key under Admin → AI Providers, and the homepage agent uses it immediately.')], ['question' => __('Where do captured leads go?'), 'answer' => __('Every chat becomes a row under Admin → Homepage Leads with the full transcript, contact details, status workflow, and CSV export.')], ['question' => __('Can I edit the greeting and agent name?'), 'answer' => __('Yes — both live under Admin → Frontend Settings → Agent Configuration. Changes apply on the next page load.')], ['question' => __('What happens if the AI is not configured?'), 'answer' => __("The homepage still renders the full marketing page with all sections — only the chat panel is replaced with a friendly placeholder until an API key is saved.")], ]; } $cta = array_merge([ 'badge' => __('Ready to automate'), 'title' => __('Ready to put an AI agent on your homepage?'), 'subtitle' => __('Activate it in two minutes, capture leads from the first visitor.'), 'cta_text' => __('Get Started Free'), 'cta_url' => '/register', ], is_array($cta ?? null) ? $cta : []); // Pricing is driven by the `plans` table — active plans only, sorted by sort_order. $plans = \App\Models\Plan::where('is_active', true) ->orderBy('sort_order') ->orderBy('monthly_price') ->get() ->map(function ($plan) { $monthly = (float) $plan->monthly_price; $yearly = (float) ($plan->yearly_price ?? round($monthly * 12 * 0.8, 0)); return [ 'name' => $plan->name, 'monthly' => $monthly, 'yearly' => $yearly, 'monthly_display' => \App\Helpers\CurrencyHelper::display($monthly), 'yearly_display' => \App\Helpers\CurrencyHelper::display($yearly), 'desc' => (string) ($plan->description ?? ''), 'popular' => (bool) $plan->is_popular, 'cta' => $monthly <= 0 ? __('Start Free') : ((stripos($plan->name, 'enterprise') !== false) ? __('Contact Sales') : __('Get Started')), 'features' => is_array($plan->features) ? $plan->features : [], ]; }) ->all(); @endphp @push('styles') @endpush @section('content')
{{-- ═══════════════════════════════════════════════════════════════ HERO — 2 columns: marketing copy + AI chat panel ═══════════════════════════════════════════════════════════════ --}}
{{-- ── LEFT: marketing copy ────────────────────────── --}}
{{ $hero['badge'] }}

{{ $hero['title_line1'] }} {{ $hero['title_highlight'] }} @if(!empty($hero['title_line2'])) {{ $hero['title_line2'] }} @endif

{{ $hero['subtitle'] }}

{{-- Trust pills --}}
@foreach([__('No credit card'), __('Self-hosted ready'), __('Live in 2 minutes')] as $pill) {{ $pill }} @endforeach
{{-- ── RIGHT: AI chat panel (or fallback placeholder) ── --}}
@if($agentReady)
{{-- Chat header --}}

{{ __('Online · AI Assistant') }}

{{-- ── Intro step ────────────────────────────── --}}

{{ __('Start the conversation') }}

{{-- ── Chat step ─────────────────────────────── --}}
{{-- Static greeting --}}
{{-- Dynamic messages --}} {{-- Typing indicator --}}
@else {{-- AI not configured — friendly placeholder card --}}

{{ __('AI assistant launching soon') }}

{{ __("We're activating the AI agent right now. In the meantime, jump straight in — sign up takes less than a minute.") }}

@auth @if(auth()->user()->is_admin ?? false)

{{ __('Admin tip: paste a provider API key under') }} {{ __('Admin → AI Providers') }} {{ __('to activate this chat.') }}

@endif @endauth
@endif
{{-- ═══════════════════════════════════════════════════════════════ HOW IT WORKS ═══════════════════════════════════════════════════════════════ --}}
{{ __('How it works') }}

{{ __('From visitor to') }} {{ __('captured lead.') }}

{{ __('The AI greets visitors, answers in your voice, qualifies them, and routes the lead straight to your CRM.') }}

@foreach([ [__('Visitor lands'), __('Your homepage opens with the AI assistant ready in the hero panel.')], [__('AI talks'), __('Trained on your business context, it answers product, pricing, and support questions instantly.')], [__('Lead captured'), __('Name, email, company, use case, and full transcript saved to Homepage Leads.')], [__('Team follows up'), __('Triage in admin, mark contacted/qualified, export to CSV, close the deal.')], ] as $index => $step)
{{ $index + 1 }}

{{ $step[0] }}

{{ $step[1] }}

@endforeach
{{-- ═══════════════════════════════════════════════════════════════ FEATURES (bento grid) ═══════════════════════════════════════════════════════════════ --}}
{{ $features['badge'] ?? __('Features') }}

{{ $features['title'] ?? __('Everything you need to convert visitors') }}

{{ $features['subtitle'] ?? __('A complete CRM + AI agent stack in one self-hosted workspace.') }}

@foreach($featureItems as $index => $item)
{{ str_pad($index + 1, 2, '0', STR_PAD_LEFT) }}

{{ $item['title'] ?? '' }}

{{ $item['desc'] ?? '' }}

@if($index === 0)
@foreach([__('Live AI'), __('Lead Capture'), __('CRM Inbox')] as $chip) {{ $chip }} @endforeach
@endif
@endforeach
{{-- ═══════════════════════════════════════════════════════════════ TESTIMONIALS ═══════════════════════════════════════════════════════════════ --}}
{{ __('Testimonials') }}

{{ $testimonials['title'] ?? __('Loved by teams worldwide') }}

{{ $testimonials['subtitle'] ?? __('See what customers say about :brand.', ['brand' => $siteName]) }}

@foreach($testimonialItems as $index => $item)
@for($i = 0; $i < 5; $i++) @endfor

"{{ $item['quote'] ?? $item['body'] ?? '' }}"

{{ substr($item['name'] ?? 'C', 0, 1) }}
{{ $item['name'] ?? __('Customer') }}
{{ trim(($item['role'] ?? '') . (($item['company'] ?? '') ? ' at ' . $item['company'] : '')) }}
@endforeach
{{-- ═══════════════════════════════════════════════════════════════ PRICING ═══════════════════════════════════════════════════════════════ --}} @if(count($plans))
{{ __('Pricing') }}

{{ __('Simple,') }} {{ __('transparent') }} {{ __('pricing') }}

{{ __("Start free, upgrade when you're ready. No hidden fees.") }}

@foreach($plans as $index => $plan) @endforeach
@endif {{-- ═══════════════════════════════════════════════════════════════ FAQ ═══════════════════════════════════════════════════════════════ --}} @if(count($faqItems))
{{ __('FAQ') }}

{{ $faq['title'] ?? __('Frequently Asked Questions') }}

@if(!empty($faq['subtitle']))

{{ $faq['subtitle'] }}

@endif
@foreach($faqItems as $index => $item)
{{ $item['question'] ?? '' }}

{{ $item['answer'] ?? '' }}

@endforeach
@endif {{-- ═══════════════════════════════════════════════════════════════ FINAL CTA ═══════════════════════════════════════════════════════════════ --}}
{{ $cta['badge'] ?? '' }}

{{ $cta['title'] }}

{{ $cta['subtitle'] }}

@endsection @push('scripts') @if($agentReady) @endif @endpush