@extends('eliteadmin::layouts.installer')

@section('title', 'Installation - Welcome')

@section('content')
    <div class="text-center mb-4">
        <div class="wizard-finish-icon mb-3">
            <i class="bi bi-rocket-takeoff"></i>
        </div>
        <h1 class="h3 mb-2">Welcome to {{ config('installer.product_name') }}</h1>
        <p class="text-muted mb-0">Version {{ $version ?? config('installer.version') }}</p>
    </div>

    <p class="text-muted text-center mb-4">
        This wizard will guide you through server checks, database setup, and application configuration.
        A free license key is generated automatically during installation.
    </p>

    <form action="{{ route('installer.welcome.store') }}" method="POST">
        @csrf
        <div class="row g-3 mb-4">
            <div class="col-12">
                <label for="app_name" class="form-label">Platform Name</label>
                <input type="text" name="app_name" id="app_name" class="form-control @error('app_name') is-invalid @enderror"
                       value="{{ old('app_name', $state->appName ?? config('installer.product_name')) }}" required>
                @error('app_name')<div class="invalid-feedback">{{ $message }}</div>@enderror
                <div class="form-text">Shown on login, sidebar, and throughout the admin panel.</div>
            </div>
            <div class="col-12">
                <label for="app_url" class="form-label">Application URL</label>
                <input type="url" name="app_url" id="app_url" class="form-control @error('app_url') is-invalid @enderror"
                       value="{{ old('app_url', $state->appUrl ?? url('/')) }}" required>
                @error('app_url')<div class="invalid-feedback">{{ $message }}</div>@enderror
            </div>
        </div>

        <div class="d-grid">
            <button type="submit" class="btn btn-primary btn-lg">Start Installation</button>
        </div>
    </form>
@endsection
