@extends('layout')

@section('title', __('store.reseller_agreement_title'))

@section('content')
<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-lg-9">
            <h1 class="mb-3">{{ __('store.reseller_agreement_title') }}</h1>
            <p class="text-muted">{{ __('store.reseller_agreement_subtitle') }}</p>

            <div class="card border-0 shadow-sm mb-3">
                <div class="card-body">
                    <h5>
                        {{ $contract->getTranslation('title') }}
                        <small class="text-muted">v{{ $contract->version }}</small>
                    </h5>
                    <div class="contract-content mb-3" style="max-height:400px;overflow-y:auto;">
                        {!! $contract->getTranslation('content') !!}
                    </div>
                    <form method="POST" action="{{ route('store.auth.reseller.agreement.accept') }}">
                        @csrf
                        <div class="form-check mb-3">
                            <input type="checkbox" name="agreement_accepted" id="agreement_accepted" value="1"
                                   class="form-check-input @error('agreement_accepted') is-invalid @enderror" required>
                            <label for="agreement_accepted" class="form-check-label">
                                {{ __('store.reseller_agreement_accept_label') }}
                                <span class="text-danger">*</span>
                            </label>
                            @error('agreement_accepted')
                                <div class="invalid-feedback d-block">{{ $message }}</div>
                            @enderror
                        </div>
                        <button type="submit" class="btn btn-primary">
                            {{ __('store.reseller_agreement_accept_button') }}
                        </button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
