@extends('install.layout')
@section('title', 'Already installed — AI Vision Attendance')
@section('tagline', 'Already installed')
@section('footnote', 'Setup only ever runs once, to protect existing data.')

@section('content')
<div style="text-align:center;">
    <div class="success-icon" aria-hidden="true">&#10003;</div>
    <h2 style="margin:0 0 6px;font-size:19px;">This application is already set up</h2>
    <p class="muted" style="color:var(--i-text-muted);margin:0 0 22px;">Setup has already completed successfully — the install wizard won't run again automatically.</p>
</div>

@if($lock)
    <div class="card">
        <h3>Install details</h3>
        <p style="margin:0 0 4px;">Installed at: <strong>{{ $lock['installed_at'] ?? 'unknown' }}</strong></p>
        <p style="margin:0;">App URL recorded at install time: <strong>{{ $lock['app_url'] ?? 'unknown' }}</strong></p>
    </div>
@endif

<div class="card">
    <h3>Need to start over?</h3>
    <p style="margin:0 0 10px;">To protect existing data, the install wizard will never re-run automatically. If you
        really need a from-scratch reinstall (fresh database, new admin, new device tokens), an administrator must
        first:</p>
    <ol class="checklist">
        <li>Back up anything needed from the current database.</li>
        <li>Delete <code>storage/app/installed.lock</code> from the server via FTP/File Manager.</li>
        <li>Reload this page.</li>
    </ol>
</div>

<a class="btn btn-primary btn-block btn-lg" href="{{ route('login') }}">Go to login</a>
@endsection
