<form name="signupForm" data-ng-class="{'was-validated': validated}" novalidate>
  <div class="row">
    <div class="col-md-12">
      <div class="title" data-translate>Sign up</div>
    </div>
  </div>
  <div class="row">
    <div class="col-md-6 form-group">
      <label data-translate>Name</label>
      <span class="text-danger" data-uib-tooltip="{{'This field is mandatory' | translate}}">*</span>
      <input name="name" class="form-control" data-ng-model="signup.name" type="text" required>
    </div>
    <div class="col-md-6 form-group">
      <label data-translate>Surname</label>
      <span class="text-danger" data-uib-tooltip="{{'This field is mandatory' | translate}}">*</span>
      <input name="surname" class="form-control" data-ng-model="signup.surname" type="text" required>
    </div>
  </div>
  <div class="row">
    <div class="col-md-6 form-group">
      <label data-translate>Phone number</label> <span class="text-danger" data-uib-tooltip="{{'This field is mandatory' | translate}}">*</span>
      <input name="phone" class="form-control" data-ng-model="signup.phone" type="text" data-ng-pattern="CONSTANTS.phonenumber_regexp" required>
      <div class="text-danger" data-ng-show="signupForm.phone.$error.pattern">
        <span data-translate>Invalid phone number</span>
      </div>
    </div>
  </div>
  <div class="row">
    <div class="col-md-6 form-group">
      <label>
        <span data-translate>Email address</span>
        <span class="text-danger" data-uib-tooltip="{{'This field is mandatory' | translate}}">*</span>
      </label>
      <div>
        <input name="email" class="form-control" data-ng-model="signup.email" data-ng-pattern="CONSTANTS.email_regexp" type="email" required>
        <div class="text-danger" data-ng-show="signupForm.email.$error.pattern">
          <span data-translate>Invalid email address</span>
        </div>
      </div>
    </div>
    <div class="col-md-6 form-group">
      <label>
        <span data-translate>Email address</span> (<span data-translate>Confirm</span>)
        <span class="text-danger" data-uib-tooltip="{{'This field is mandatory' | translate}}">*</span>
      </label>
      <div>
        <input name="email" class="form-control" data-ng-model="confirmation_email" data-disable-ccp type="email" required>
        <div class="text-danger" data-ng-show="signupForm.email.$valid && signup.email !== confirmation_email">
          <span data-translate>Invalid confirmation</span>
        </div>
      </div>
    </div>
  </div>
  <div class="row">
    <div class="col-md-12">
      <label class="title" data-translate>Organization</label>
    </div>
  </div>
  <div class="row">
    <div class="col-md-12 form-group">
      <label data-translate>Name</label>
      <span class="text-danger" data-uib-tooltip="{{'This field is mandatory' | translate}}">*</span>
      <input name="organization_name" class="form-control" data-ng-model="signup.organization_name" type="text" data-ng-change="updateSubdomain()" required>
    </div>
  </div>
  <div class="row">
    <div class="col-md-12 form-group">
      <label data-translate>Address</label>
      <span class="text-danger" data-uib-tooltip="{{'This field is mandatory' | translate}}">*</span>
      <input name="organization_location" class="form-control" data-ng-model="signup.organization_location" type="text" required>
    </div>
  </div>
  <div class="row">
    <div class="col-md-6 form-group">
      <label data-translate>Fiscal code</label>
      <span class="text-danger" data-uib-tooltip="{{'This field is mandatory' | translate}}">*</span>
      <input name="tax_code" class="form-control" data-ng-model="signup.organization_tax_code" type="text"
             data-ng-required="!signup.organization_tax_code && !signup.organization_vat_code">
    </div>
    <div class="col-md-6 form-group">
      <label data-translate>Tax code</label>
      <span class="text-danger" data-uib-tooltip="{{'This field is mandatory' | translate}}">*</span>
      <input name="vat_code" class="form-control" data-ng-model="signup.organization_vat_code" type="text"
             data-ng-required="!signup.organization_tax_code && !signup.organization_vat_code">
    </div>
  </div>
  <div class="row">
    <div class="col-md-12 form-group">
      <label>
        <span data-translate>Site</span>
        <span class="text-danger" data-uib-tooltip="{{'This field is mandatory' | translate}}">*</span>
      </label>
      <div class="input-group">
        <input name="subdomain" class="form-control" data-ng-model="signup.subdomain" type="text"
               data-ng-pattern="/^[a-z0-9]+$/" required
               subdomainvalidator>
        <span class="input-group-append"><span class="input-group-text">.{{public.node.rootdomain}}</span></span>
      </div>
    </div>
  </div>
  <br />
  <div data-ng-include="'views/signup/tos.html'"></div>
  <div class="row">
    <div class="col-md-12">
      <button class="ButtonNext btn btn-primary" data-ng-click="(validated = true) && !signupForm.$invalid && complete()">
        <i class="fa-solid fa-check"></i>
        <span data-translate>Proceed</span>
      </button>
    </div>
  </div>
</form>
