{% trans_default_domain 'security' %}

<div class="form-group d-flex flex-column justify-content-center mt-3 password">
    {% if form is defined and not null %}
        {{ form_label(form) }}
    {% else %}
        <label class="text-black fs-6 required"
               for="login-password">
            {{ 'login_action.fom.password.label'|trans }}
        </label>
    {% endif %}
    <div class="password-visibility input-group"
         data-controller="password-visibility">
        {% if form is defined and not null %}
            {{ form_widget(form) }}
        {% else %}
            <input type="password"
                   id="login-password"
                   class="form-control form-control-sm {% if error is not null %}is-invalid{% endif %}"
                   name="_password"
                   placeholder="******"
                   data-password-visibility-target="input"
                   spellcheck="false"
                   required>
        {% endif %}
        <div class="eye input-group-text cursor-pointer"
             data-action="click->password-visibility#toggle">
                <span data-password-visibility-target="icon">
                    <i class="bi bi-eye-fill"></i>
                </span>
            <span data-password-visibility-target="icon"
                  class="hidden">
                <i class="bi bi-eye-slash-fill"></i>
            </span>
        </div>
        {% if form is defined and not null %}
            {{ form_errors(form) }}
        {% endif %}
    </div>
    {% if form is defined and not null %}
        {{ form_help(form) }}
    {% endif %}
</div>
