<div class="col-md-12">
    <div class="input-group input-group-outline my-3 {{ old('name', $utente->name ?? '') ? 'is-filled' : '' }}">
        <label class="form-label">Nome</label>
        <input type="text" name="name" class="form-control" value="{{ old('name', $utente->name ?? '') }}" required>
    </div>
</div>

<div class="col-md-12">
    <div class="input-group input-group-outline my-3 {{ old('surname', $utente->surname ?? '') ? 'is-filled' : '' }}">
        <label class="form-label">Cognome</label>
        <input type="text" name="surname" class="form-control" value="{{ old('surname', $utente->surname ?? '') }}">
    </div>
</div>

<div class="col-md-12">
    <div
        class="input-group input-group-outline my-3 {{ old('codice_fiscale', $utente->codice_fiscale ?? '') ? 'is-filled' : '' }}">
        <label class="form-label">Codice fiscale</label>
        <input type="text" name="codice_fiscale" class="form-control"
            value="{{ old('codice_fiscale', $utente->codice_fiscale ?? '') }}">
    </div>
</div>

<div class="col-md-12">
    <div class="input-group input-group-outline my-3 {{ old('telefono', $utente->telefono ?? '') ? 'is-filled' : '' }}">
        <label class="form-label">Telefono</label>
        <input type="text" name="telefono" class="form-control"
            value="{{ old('telefono', $utente->telefono ?? '') }}">
    </div>
</div>

<div class="col-md-12">
    <div class="input-group input-group-outline my-3 {{ old('email', $utente->email ?? '') ? 'is-filled' : '' }}">
        <label class="form-label">Email</label>
        <input type="email" name="email" class="form-control" value="{{ old('email', $utente->email ?? '') }}"
            required>
    </div>
</div>

<div class="col-md-12">
    <div class="input-group input-group-outline my-3 {{ isset($utente) ? 'is-filled' : '' }}">
        <label class="form-label">Password</label>
        <input type="password" name="password" class="form-control" {{ isset($utente) ? '' : 'required' }}>
    </div>
</div>

<div class="col-md-12">
    <div
        class="input-group input-group-outline my-3 {{ old('azienda_id', $utente->azienda_id ?? '') ? 'is-filled' : '' }}">
        <select name="azienda_id" class="form-control">
            <option value="">-- Seleziona azienda --</option>
            @foreach ($aziende as $azienda)
                <option value="{{ $azienda->id }}"
                    {{ old('azienda_id', $utente->azienda_id ?? '') == $azienda->id ? 'selected' : '' }}>
                    {{ $azienda->nome }}
                </option>
            @endforeach
        </select>
    </div>
</div>

<div class="col-12 d-flex justify-content-end mt-2">
    <button type="submit" class="btn btn-primary">{{ $submitLabel ?? 'Salva' }}</button>
</div>
