@extends('installer.layout')

@section('title', 'Step 3: Super Admin & License')
@section('step_1_class', 'completed')
@section('step_2_class', 'completed')
@section('step_3_class', 'active')

@section('content')
    <h2 style="font-size: 1.1rem; font-weight: 700; color: #FFFFFF; margin-bottom: 0.5rem;">Super Admin & License Key</h2>
    <p style="font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 1.5rem;">
        Set up your primary administrator login and enter your purchased software license key.
    </p>

    <form method="POST" action="{{ route('install.admin.submit') }}">
        @csrf

        <div class="form-group">
            <label class="form-label">Administrator Full Name</label>
            <input type="text" name="admin_name" class="form-control" value="{{ old('admin_name', 'Super Admin') }}" required placeholder="e.g. John Doe">
        </div>

        <div class="form-group">
            <label class="form-label">Administrator Email Address</label>
            <input type="email" name="admin_email" class="form-control" value="{{ old('admin_email') }}" required placeholder="admin@yourdomain.com">
            <div class="form-helper">This will be your login username for the Admin Dashboard.</div>
        </div>

        <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;">
            <div class="form-group">
                <label class="form-label">Password</label>
                <input type="password" name="admin_password" class="form-control" required placeholder="••••••••">
            </div>

            <div class="form-group">
                <label class="form-label">Confirm Password</label>
                <input type="password" name="admin_password_confirmation" class="form-control" required placeholder="••••••••">
            </div>
        </div>

        <div class="form-group" style="background: rgba(16, 185, 129, 0.05); border: 1px dashed rgba(16, 185, 129, 0.3); border-radius: 0.75rem; padding: 1rem; margin-top: 1rem;">
            <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem;">
                <label class="form-label" style="color: #34D399; margin-bottom: 0; font-weight: 700;">Software License Key</label>
                <span style="font-size: 0.75rem; color: #9CA3AF;">Domain: <strong style="color: #FFFFFF;">{{ $domain }}</strong></span>
            </div>
            <input type="text" name="license_key" class="form-control" value="{{ old('license_key') }}" required placeholder="e.g. ARORA-XXXX-XXXX-XXXX" style="border-color: rgba(16, 185, 129, 0.4); font-family: monospace;">
            <div class="form-helper" style="color: #9CA3AF;">Enter the License Key provided with your software purchase.</div>
        </div>

        <div style="margin-top: 2rem;">
            <button type="submit" class="btn">
                <span>Complete Installation & Activate</span>
                <svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/></svg>
            </button>
        </div>
    </form>
@endsection
