{{ 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 {{ (error_firstname) ? 'error' : '' }}">
        <input type="text" id="firstname" name="firstname" class="ftr-field__entry ftr-js-field__entry" value="{{ firstname }}" maxlength="32" required>
        <span class="ftr-field__text">{{ text_name }}</span>
        {% if error_firstname %}
          <span class="ftr-field__error">{{ error_firstname }}</span>
        {% endif %}
      </label>
      <label class="ftr-field {{ (error_lastname) ? 'error' : '' }}">
        <input type="text" id="lastname" name="lastname" class="ftr-field__entry ftr-js-field__entry" value="{{ lastname }}" maxlength="32" required>
        <span class="ftr-field__text">{{ text_last_name }}</span>
        {% if error_lastname %}
          <span class="ftr-field__error">{{ error_lastname }}</span>
        {% endif %}
      </label>
      <label class="ftr-field {{ (error_postcode) ? 'error' : '' }}">
        <input type="text" id="postcode" name="postcode" class="ftr-field__entry ftr-js-field__entry mask-cep js-postcode-search" value="{{ postcode }}" maxlength="10" required>
        <span class="ftr-field__text">{{ text_postcode }}</span>
        {% if error_postcode %}
          <span class="ftr-field__error">{{ error_postcode }}</span>
        {% endif %}
      </label>
      {{ dont_know_cep }}
      <div class="js-postcode-content ftr-h--full {{ (postcode_visible==false) ? 'ftr-none' : '' }}">
          <label class="ftr-field {{ (error_apelido) ? 'error' : '' }}">
              <input type="text" id="apelido" name="apelido" class="ftr-field__entry ftr-js-field__entry" value="{{ apelido }}" maxlength="80" minlength="3">
              <span class="ftr-field__text">{{ text_local }} ({{ text_local_description }})</span>
              {% if error_apelido %}
                <span class="ftr-field__error">{{ error_apelido }}</span>
              {% endif %}
            </label>
            <label class="ftr-field {{ (error_address_1) ? 'error' : '' }}">
              <input type="text" id="address_1" name="address_1" class="ftr-field__entry ftr-js-field__entry address_1" value="{{ 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="{{ tipo_logradouro }}">
              <input type="hidden" class="logradouro" name="logradouro" value="{{ logradouro }}">
              <input type="hidden" class="city" name="city" value="{{ city }}">
              {% if error_address_1 %}
                <span class="ftr-field__error">{{ error_address_1 }}</span>
              {% endif %}
            </label>
            <label class="ftr-field {{ (error_numero) ? 'error' : '' }}">
              <input type="text" id="numero" name="numero" class="ftr-field__entry ftr-js-field__entry mask-int" value="{{ numero }}" maxlength="14" required>
              <span class="ftr-field__text">{{ text_number }}</span>
              {% if error_numero %}
                <span class="ftr-field__error">{{ error_numero }}</span>
              {% endif %}
            </label>
            <label class="ftr-field {{ (error_complemento) ? 'error' : '' }}">
                <input type="text" id="complemento" name="complemento" class="ftr-field__entry ftr-js-field__entry" value="{{ complemento }}" maxlength="60" minlength="3">
                <span class="ftr-field__text">{{ text_complement }}</span>
                {% if error_complemento %}
                  <span class="ftr-field__error">{{ error_complemento }}</span>
                {% endif %}
              </label>
            <label class="ftr-field {{ (error_address_2) ? 'error' : '' }}">
              <input type="text" id="address_2" name="address_2" class="ftr-field__entry ftr-js-field__entry address_2" value="{{ address_2 }}" maxlength="128" required {{ (postcode_readonly) ? 'readonly' : '' }}>
              <span class="ftr-field__text">{{ text_neighborhood }}</span>
              {% if error_address_2 %}
                <span class="ftr-field__error">{{ error_address_2 }}</span>
              {% endif %}
            </label>

              <label for="zone_id" class="ftr-select ftr-js-select {{ (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="{{ zone_name }}" id="zone_id" disabled readonly>
                <input class="js-city-search ftr-js-select__value ftr-hidden zone_id" name="zone_id" value="{{ zone_id }}" data-codigo-municipio="{{ 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 {{ (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="{{ city }}" id="city" disabled readonly>
                <input class="ftr-js-select__value ftr-hidden codigo-municipio codigo_municipio" name="codigo_municipio" value="{{ 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 -->

            {% if default == false %}
              <span class="ftr-text--s ftr-out-space--t-l ftr-block">{{ text_address_default }}</span>
              <input class="ftr-radio" id="default-yes" type="radio" name="default" value="1" {{ (default) ? 'checked' : '' }}>
              <label class="ftr-radio-label ftr-block" for="default-yes">
                <span class="ftr-radio-label__text">{{ text_yes }}</span>
              </label>
              <input class="ftr-radio" id="default-no" type="radio" name="default" value="0" {{ (default) ? '' : 'checked' }}>
              <label class="ftr-radio-label ftr-block" for="default-no">
                <span class="ftr-radio-label__text">{{ text_no }}</span>
              </label>
            {% endif %}
      </div>
      <button type="submit" class="ftr-btn ftr-js-ripple-effect ftr-h--full ftr-background--primary">
        {{ button_save }}
      </button>
    </form>
  </div>
{{ footer }}
