@extends('store.layouts.app')

@section('title', 'Register')
@section('meta_description', 'Create account – ' . ($store_name ?? config('app.name')))

@section('content')
<div class="max-w-md mx-auto px-4 py-12">
    <div class="card p-8">
        <h1 class="text-2xl font-bold text-gray-800 mb-6">Create Account</h1>
        <form action="{{ route('register') }}" method="POST" class="space-y-4">
            @csrf
            <div>
                <label class="block text-sm font-medium text-gray-700 mb-1">Name</label>
                <input type="text" name="name" value="{{ old('name') }}" required autofocus class="input">
                @error('name')<p class="text-red-600 text-sm mt-1">{{ $message }}</p>@enderror
            </div>
            <div>
                <label class="block text-sm font-medium text-gray-700 mb-1">Email</label>
                <input type="email" name="email" value="{{ old('email') }}" required class="input">
                @error('email')<p class="text-red-600 text-sm mt-1">{{ $message }}</p>@enderror
            </div>
            <div>
                <label class="block text-sm font-medium text-gray-700 mb-1">Password</label>
                <input type="password" name="password" required class="input">
                @error('password')<p class="text-red-600 text-sm mt-1">{{ $message }}</p>@enderror
            </div>
            <div>
                <label class="block text-sm font-medium text-gray-700 mb-1">Confirm Password</label>
                <input type="password" name="password_confirmation" required class="input">
            </div>
            <button type="submit" class="btn-primary w-full py-3">Register</button>
        </form>
        <p class="mt-4 text-center text-sm text-gray-600">Already have an account? <a href="{{ route('login') }}" class="text-primary font-semibold hover:underline">Login</a></p>
    </div>
</div>
@endsection
