<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Install · {{ config('app.name') }}</title><link rel="stylesheet" href="{{ asset('assets/app.css') }}"><style>.installer{max-width:1100px;margin:40px auto;padding:20px}.install-grid{display:grid;grid-template-columns:340px 1fr;gap:24px}.check{display:flex;justify-content:space-between;padding:9px 0;border-bottom:1px solid #e5e7eb}.ok{color:#15803d}.bad{color:#b91c1c}@media(max-width:800px){.install-grid{grid-template-columns:1fr}}</style></head>
<body class="bg-soft"><div class="installer"><div class="page-header"><div><h1>UAE Transport Accounting Setup</h1><p class="muted">Configure the legal entity and create the first super administrator.</p></div></div>
@if(session('error'))<div class="alert alert-error">{{ session('error') }}</div>@endif
@if($errors->any())<div class="alert alert-error"><ul>@foreach($errors->all() as $error)<li>{{ $error }}</li>@endforeach</ul></div>@endif
<div class="install-grid"><aside class="card"><div class="card-header"><h3>Server checklist</h3></div><div class="card-body">
@foreach($requirements as $label=>$passed)<div class="check"><span>{{ $label }}</span><strong class="{{ $passed?'ok':'bad' }}">{{ $passed?'Ready':'Missing' }}</strong></div>@endforeach
@foreach($writable as $label=>$passed)<div class="check"><span>{{ $label }}</span><strong class="{{ $passed?'ok':'bad' }}">{{ $passed?'Writable':'Not writable' }}</strong></div>@endforeach
<p class="muted" style="margin-top:16px">Before submitting, create <code>.env</code>, set MySQL credentials, run <code>composer install</code>, and make storage writable.</p></div></aside>
<section class="card"><div class="card-header"><h3>Company and administrator</h3></div><div class="card-body"><form method="post" enctype="multipart/form-data" action="{{ route('install.store') }}">@csrf
<div class="form-grid"><div class="field span-2"><label>Company Legal Name *</label><input class="control" name="legal_name" value="{{ old('legal_name') }}" required></div><div class="field"><label>Trade Name</label><input class="control" name="trade_name" value="{{ old('trade_name') }}"></div><div class="field"><label>Company Logo</label><input class="control" type="file" name="logo" accept="image/png,image/jpeg,image/webp"><small>PNG, JPG or WebP; maximum 2 MB.</small></div><div class="field"><label>TRN</label><input class="control" name="trn" value="{{ old('trn') }}"></div><div class="field"><label>Trade Licence Number</label><input class="control" name="trade_license_number" value="{{ old('trade_license_number') }}"></div><div class="field"><label>Company Email</label><input class="control" type="email" name="company_email" value="{{ old('company_email') }}"></div><div class="field"><label>Company Phone</label><input class="control" name="company_phone" value="{{ old('company_phone') }}"></div><div class="field"><label>Website</label><input class="control" name="website" value="{{ old('website') }}" placeholder="https://"></div><div class="field span-2"><label>Legal Address</label><textarea class="control" name="address" rows="3">{{ old('address') }}</textarea></div><div class="field"><label>Financial Year Starts</label><select class="control" name="financial_year_start_month">@foreach(range(1,12) as $m)<option value="{{ $m }}" @selected((int)old('financial_year_start_month',1)===$m)>{{ DateTime::createFromFormat('!m',$m)->format('F') }}</option>@endforeach</select></div><div class="field"><label>VAT Registration Date</label><input class="control" type="date" name="vat_registration_date" value="{{ old('vat_registration_date') }}"></div><div class="field span-2"><label class="checkbox"><input type="checkbox" name="vat_registered" value="1" @checked(old('vat_registered'))> Company is VAT registered</label></div>
<div class="field"><label>Head Office Code *</label><input class="control" name="branch_code" value="{{ old('branch_code','HO') }}" required></div><div class="field"><label>Head Office Name *</label><input class="control" name="branch_name" value="{{ old('branch_name','Head Office') }}" required></div><div class="field span-2"><label>Head Office Emirate</label><input class="control" name="branch_emirate" value="{{ old('branch_emirate','Abu Dhabi') }}"></div>
<div class="field"><label>Administrator Name *</label><input class="control" name="admin_name" value="{{ old('admin_name') }}" required></div><div class="field"><label>Administrator Email *</label><input class="control" type="email" name="admin_email" value="{{ old('admin_email') }}" required></div><div class="field"><label>Password *</label><input class="control" type="password" name="admin_password" minlength="10" required></div><div class="field"><label>Confirm Password *</label><input class="control" type="password" name="admin_password_confirmation" minlength="10" required></div></div>
<div class="form-actions"><button class="btn btn-primary">Install Application</button></div></form></div></section></div></div></body></html>
