{{ header }}
  <div class="ftr-container">
    <form class="ftr-form js-address js-form-no-submit" id="form-address" action="{{ action }}" method="post" enctype="multipart/form-data" autocomplete="off">
      <label class="ftr-field {{ (data.error.error_address_firstname[0]) ? 'error' : '' }}">
        <input type="text" id="firstname" name="firstname" class="ftr-field__entry ftr-js-field__entry" value="{{ data.configurations.firstname }}" maxlength="32" required>
        <span class="ftr-field__text">{{ text_name }}</span>
        {% if data.error.error_address_firstname[0] %}
          <span class="ftr-field__error">{{ data.error.error_address_firstname[0] }}</span>
        {% endif %}
      </label>
      <label class="ftr-field {{ (data.error.error_address_lastname[0]) ? 'error' : '' }}">
        <input type="text" id="lastname" name="lastname" class="ftr-field__entry ftr-js-field__entry" value="{{ data.configurations.lastname }}" maxlength="32" required>
        <span class="ftr-field__text">{{ text_last_name }}</span>
        {% if data.error.error_address_lastname[0] %}
          <span class="ftr-field__error">{{ data.error.error_address_lastname[0] }}</span>
        {% endif %}
      </label>
      <label class="ftr-field {{ (data.error.error_address_postcode[0]) ? 'error' : '' }}">
        <input type="text" id="postcode" name="postcode" class="ftr-field__entry ftr-js-field__entry mask-cep js-postcode-search" value="{{ data.configurations.postcode }}" maxlength="10" required>
        <span class="ftr-field__text">{{ text_postcode }}</span>
        {% if data.error.error_address_postcode[0] %}
          <span class="ftr-field__error">{{ data.error.error_address_postcode[0] }}</span>
        {% endif %}
      </label>
      {{ dont_know_cep }}
      <div class="js-postcode-content ftr-h--full {{ (postcode_visible==false) ? 'ftr-none' : '' }}">
          <label class="ftr-field {{ (data.error.error_address_apelido[0]) ? 'error' : '' }}">
              <input type="text" id="apelido" name="apelido" class="ftr-field__entry ftr-js-field__entry" value="{{ data.configurations.apelido }}" maxlength="80" minlength="3" required>
              <span class="ftr-field__text">{{ text_local }} ({{ text_local_description }})</span>
              {% if data.error.error_address_apelido[0] %}
                <span class="ftr-field__error">{{ data.error.error_address_apelido[0] }}</span>
              {% endif %}
            </label>
            <label class="ftr-field {{ (data.error.error_address_address_1[0]) ? 'error' : '' }}">
              <input type="text" id="address_1" name="address_1" class="ftr-field__entry ftr-js-field__entry address_1" value="{{ data.configurations.address_1 }}" maxlength="70" minlength="3" required {{ (postcode_readonly) ? 'readonly' : '' }}>
              <span class="ftr-field__text">{{ text_street }}</span>
              <input type="hidden" class="tipo_logradouro" name="tipo_logradouro" value="{{ data.configurations.tipo_logradouro }}">
              <input type="hidden" class="logradouro" name="logradouro" value="{{ data.configurations.logradouro }}">
              <input type="hidden" class="city" name="city" value="{{ data.configurations.city }}">
              {% if data.error.error_address_address_1[0] %}
                <span class="ftr-field__error">{{ data.error.error_address_address_1[0] }}</span>
              {% endif %}
            </label>
            <label class="ftr-field {{ (data.error.error_address_numero[0]) ? 'error' : '' }}">
              <input type="text" id="numero" name="numero" class="ftr-field__entry ftr-js-field__entry mask-int" value="{{ data.configurations.numero }}" maxlength="14" required>
              <span class="ftr-field__text">{{ text_number }}</span>
              {% if data.error.error_address_numero[0] %}
                <span class="ftr-field__error">{{ data.error.error_address_numero[0] }}</span>
              {% endif %}
            </label>
            <label class="ftr-field {{ (data.error.error_address_complemento[0]) ? 'error' : '' }}">
                <input type="text" id="complemento" name="complemento" class="ftr-field__entry ftr-js-field__entry" value="{{ data.configurations.complemento }}" maxlength="60" minlength="3">
                <span class="ftr-field__text">{{ text_complement }}</span>
                {% if data.error.error_address_complemento[0] %}
                  <span class="ftr-field__error">{{ data.error.error_address_complemento[0] }}</span>
                {% endif %}
              </label>
            <label class="ftr-field {{ (data.error.error_address_address_2[0]) ? 'error' : '' }}">
              <input type="text" id="address_2" name="address_2" class="ftr-field__entry ftr-js-field__entry address_2" value="{{ data.configurations.address_2 }}" maxlength="128" required {{ (postcode_readonly) ? 'readonly' : '' }}>
              <span class="ftr-field__text">{{ text_neighborhood }}</span>
              {% if data.error.error_address_address_2[0] %}
                <span class="ftr-field__error">{{ data.error.error_address_address_2[0] }}</span>
              {% endif %}
            </label>

              <label for="zone_id" class="ftr-select ftr-js-select {{ (data.configurations.zone_name) ? 'written' : '' }} {{ (postcode_readonly) ? 'ftr-select--disabled ftr-js-select--disabled written' : '' }}">
                <input class="ftr-select__entry ftr-js-select__entry" type="text" name="" value="{{ data.configurations.zone_name }}" id="zone_id" disabled readonly>
                <input class="js-city-search ftr-js-select__value ftr-hidden zone_id" name="zone_id" value="{{ data.configurations.zone_id }}" data-codigo-municipio="{{ data.configurations.codigo_municipio }}" required>
                <span class="ftr-select__text">{{ text_zone }}</span>
                <div class="ftr-select__content">
                  {% for state in states %}
                    <span class="ftr-select__content__item ftr-js-select__content__item ftr-js-ripple-effect" data-value="{{ state.zone_id }}" {{ (state.zone_id == zone_id) ? 'data-selected="true"' : '' }}>{{ state.name }}</span>
                  {% endfor %}
                </div>
              </label>

              <label for="codigo_municipio" class="ftr-select ftr-js-select {{ (data.configurations.codigo_municipio) ? 'written' : '' }} {{ (postcode_readonly) ? 'ftr-select--disabled ftr-js-select--disabled written' : '' }}">
                <input class="ftr-select__entry ftr-js-select__entry city-name" type="text" name="" value="{{ data.configurations.city }}" id="city" disabled readonly>
                <input class="ftr-js-select__value ftr-hidden codigo-municipio codigo_municipio" name="codigo_municipio" value="{{ data.configurations.codigo_municipio }}" required>
                <span class="ftr-select__text">{{ text_city }}</span>
                <div class="ftr-select__content cities-list"></div>
              </label>

              <input type="hidden" name="country_id" value="{{ country_id }}"><!-- Importante ter o valor do pais -->
              
      </div>
      <button type="submit" class="ftr-btn ftr-js-ripple-effect ftr-h--full ftr-background--primary">
        {{ button_save }}
      </button>
    </form>
  </div>
{{ footer }}
