@extends('layouts.app')

@section('title', 'Daftar - FIN-ANALYSIS PRO')

@section('content')
<div class="flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
    <div class="max-w-md w-full space-y-8">
        <div>
            <div class="flex justify-center">
                <div class="w-16 h-16 bg-gradient-primary rounded-lg flex items-center justify-center">
                    <i class="fas fa-chart-line text-white text-2xl"></i>
                </div>
            </div>
            <h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-white">
                Buat Akun Baru
            </h2>
            <p class="mt-2 text-center text-sm text-gray-600 dark:text-gray-400">
                Atau
                <a href="{{ route('login') }}" class="font-medium text-primary-600 hover:text-primary-500 dark:text-primary-400">
                    masuk ke akun yang sudah ada
                </a>
            </p>
        </div>
        
        <form class="mt-8 space-y-6" action="{{ route('register') }}" method="POST">
            @csrf
            
            <div class="rounded-md shadow-sm space-y-4">
                <div>
                    <label for="name" class="label-field">Nama Lengkap</label>
                    <input id="name" name="name" type="text" autocomplete="name" required 
                           class="input-field @error('name') input-error @enderror"
                           value="{{ old('name') }}"
                           placeholder="John Doe">
                    @error('name')
                        <p class="mt-1 text-sm text-danger-600">{{ $message }}</p>
                    @enderror
                </div>
                
                <div>
                    <label for="email" class="label-field">Email</label>
                    <input id="email" name="email" type="email" autocomplete="email" required 
                           class="input-field @error('email') input-error @enderror"
                           value="{{ old('email') }}"
                           placeholder="nama@perusahaan.com">
                    @error('email')
                        <p class="mt-1 text-sm text-danger-600">{{ $message }}</p>
                    @enderror
                </div>
                
                <div>
                    <label for="password" class="label-field">Password</label>
                    <input id="password" name="password" type="password" autocomplete="new-password" required 
                           class="input-field @error('password') input-error @enderror"
                           placeholder="Minimal 8 karakter">
                    @error('password')
                        <p class="mt-1 text-sm text-danger-600">{{ $message }}</p>
                    @enderror
                </div>
                
                <div>
                    <label for="password_confirmation" class="label-field">Konfirmasi Password</label>
                    <input id="password_confirmation" name="password_confirmation" type="password" autocomplete="new-password" required 
                           class="input-field"
                           placeholder="••••••••">
                </div>
            </div>

            <div class="flex items-center">
                <input id="terms" name="terms" type="checkbox" required 
                       class="h-4 w-4 text-primary-600 focus:ring-primary-500 border-gray-300 rounded">
                <label for="terms" class="ml-2 block text-sm text-gray-900 dark:text-gray-300">
                    Saya setuju dengan 
                    <a href="{{ route('public.terms') }}" class="font-medium text-primary-600 hover:text-primary-500">syarat & ketentuan</a>
                </label>
            </div>

            <div>
                <button type="submit" class="btn-primary w-full py-3">
                    <i class="fas fa-user-plus mr-2"></i>
                    Daftar
                </button>
            </div>
        </form>
    </div>
</div>
@endsection

