<h5 class="title pb-3">@lang('system_settings.mail_settings.modal.header')</h5>

<form action="{{ route('settings.mail.update') }}" method="post" async-form on-async-modal data-event="mailsettings.updated">
    @csrf

    @method('put')

    <div class="row gy-4">
        <div class="col-md-6">
            <div class="form-group">
                <label class="form-label" for="mail_host">@lang('system_settings.mail_settings.form.host.label')</label>
                <input type="text" class="form-control form-control-lg" id="mail_host" name="mail_host" placeholder="@lang('system_settings.mail_settings.form.host.placeholder')"
                    value="{{ isset($mailSettings['mail_host']) ? $mailSettings['mail_host'] : '' }}">
                <span class="invalid-feedback pb-3" role="alert"></span>
            </div>
        </div>

        <div class="col-md-6">
            <div class="form-group">
                <label class="form-label" for="mail_port">@lang('system_settings.mail_settings.form.port.label')</label>
                <input type="text" class="form-control form-control-lg" id="mail_port" name="mail_port" placeholder="@lang('system_settings.mail_settings.form.port.placeholder')"
                    value="{{ isset($mailSettings['mail_port']) ? $mailSettings['mail_port'] : '' }}">
                <span class="invalid-feedback pb-3" role="alert"></span>
            </div>
        </div>

        <div class="col-md-6">
            <div class="form-group">
                <label class="form-label" for="mail_username">@lang('system_settings.mail_settings.form.username.label')</label>
                <input type="text" class="form-control form-control-lg" id="mail_username" name="mail_username" placeholder="@lang('system_settings.mail_settings.form.username.placeholder')"
                    value="{{ isset($mailSettings['mail_username']) ? $mailSettings['mail_username'] : '' }}">
                <span class="invalid-feedback pb-3" role="alert"></span>
            </div>
        </div>

        <div class="col-md-6">
            <div class="form-group">
                <label class="form-label" for="mail_password">@lang('system_settings.mail_settings.form.password.label')</label>
                <input type="text" class="form-control form-control-lg" id="mail_password" name="mail_password" placeholder="@lang('system_settings.mail_settings.form.password.placeholder')"
                    value="{{ isset($mailSettings['mail_password']) ? $mailSettings['mail_password'] : '' }}">
                <span class="invalid-feedback pb-3" role="alert"></span>
            </div>
        </div>

        <div class="col-md-6">
            <div class="form-group">
                <label class="form-label" for="mail_from_name">@lang('system_settings.mail_settings.form.from_name.label')</label>
                <input type="text" class="form-control form-control-lg" id="mail_from_name" name="mail_from_name" placeholder="@lang('system_settings.mail_settings.form.from_name.placeholder')"
                    value="{{ isset($mailSettings['mail_from_name']) ? $mailSettings['mail_from_name'] : '' }}">
                <span class="invalid-feedback pb-3" role="alert"></span>
            </div>
        </div>

        <div class="col-md-6">
            <div class="form-group">
                <label class="form-label" for="mail_from_email">@lang('system_settings.mail_settings.form.from_email.label')</label>
                <input type="text" class="form-control form-control-lg" id="mail_from_email" name="mail_from_email" placeholder="@lang('system_settings.mail_settings.form.from_email.placeholder')"
                    value="{{ isset($mailSettings['mail_from_email']) ? $mailSettings['mail_from_email'] : '' }}">
                <span class="invalid-feedback pb-3" role="alert"></span>
            </div>
        </div>

        <div class="col-md-12">
            <div class="form-group">
                <label class="form-label" for="mail_encryption">@lang('system_settings.mail_settings.form.encryption.label')</label>
                <input type="text" class="form-control form-control-lg" id="mail_encryption" name="mail_encryption" placeholder="@lang('system_settings.mail_settings.form.encryption.placeholder')"
                    value="{{ isset($mailSettings['mail_encryption']) ? $mailSettings['mail_encryption'] : '' }}">
                <span class="invalid-feedback pb-3" role="alert"></span>
            </div>
        </div>

    </div>

    <div class="row pt-4">
        <div class="col-12">
            <ul class="align-center flex-wrap flex-sm-nowrap gx-4 gy-2">
                <li><button type="submit" class="btn btn-lg btn-primary">@lang('global.form.button.save')</button></li>
                <li><button type="button" class="btn btn-lg btn-outline-danger" async-modal-close>@lang('global.form.button.cancel')</button></li>
            </ul>
        </div>
    </div>
</form>
