@extends('layouts.nova')

@section('content')
<div class="flex-1 flex items-center justify-center px-6 py-16 min-h-[calc(100vh-4rem)] box-border">
    <div class="max-w-5xl w-full">
        <div class="rounded-2xl border border-white/10 bg-slate-900/70 backdrop-blur shadow-xl p-8 auth-card">
            <h2 class="text-2xl font-semibold mb-2 text-white">Add Your Email</h2>
            <div class="mt-4 text-white/90">
                @include('auth.partials.onboarding-progress', ['currentStep' => 'email'])

                @if (session('status'))
                    <div class="mb-4 rounded-md border border-green-700/60 bg-green-900/20 px-3 py-2 text-sm text-green-300">
                        {{ session('status') }}
                    </div>
                @endif

                @if ($errors->any())
                    <div class="mb-4 rounded-md border border-red-700/60 bg-red-900/20 px-3 py-2 text-sm text-red-300">
                        {{ $errors->first() }}
                    </div>
                @endif

                <p class="mb-4 text-sm text-white/60">Username sign-in is temporary. Add the email address you want to use for future logins and continue setup.</p>

                <form method="POST" action="{{ route('setup.email.store') }}">
                    @csrf

                    <div>
                        <label class="block text-sm mb-1 text-white/80" for="email">Email Address</label>
                        <x-text-input id="email" name="email" type="email" :value="old('email', $email)" required autocomplete="email" class="w-full rounded-lg bg-slate-950/70 border border-white/10 px-4 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-cyan-500 text-white" />
                        <x-input-error :messages="$errors->get('email')" class="mt-2" />
                    </div>

                    <div class="mt-6 flex justify-end">
                        <x-primary-button class="w-full sm:w-auto justify-center">
                            {{ __('Continue') }}
                        </x-primary-button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
@endsection