<?php echo $header; ?>

<section class="container-fluid">
  <?php echo $breadcrumbs; ?>

  <div class="row">
    <div class="col-xs-12 top-margin-large bottom-margin-large flex flex-column align-items-center center-xs text-center">
      <h1 class="heading-2 vertical-middle"><?php echo $heading_title; ?></h1>
    </div>
  </div>

  <div class="padding-large paper flex flex-column align-items-center center-xs text-center" style="background-color:#f8f8f8">
    <?php if ($error) { ?>
      <div style="margin-bottom: 20px; animation: fadeIn 1.5s;">
        <i class="fa-solid fa-triangle-exclamation" aria-hidden="true" style="font-size: 30px; color: #f65f3e;" aria-label="Erro" role="img"></i>
      </div>
      <span class="full-width text-center text-x-large text-dark" style="animation: fadeIn 2s;">
        <?php echo $error; ?>
      </span>
    <?php } else { ?>
      <div style="margin-bottom: 20px; animation: fadeIn 1.5s;">
        <i class="fa-solid fa-download" aria-hidden="true" style="font-size: 30px; color: #22407c;" aria-label="Download em andamento" role="img"></i>
      </div>
      <span class="full-width text-center text-x-large text-dark" style="animation: fadeIn 2s;">
        <?php echo $text_pdf_downloading; ?>
      </span>
    <?php } ?>

    <a href="<?php echo $continue; ?>" class="btn-default btn-medium top-margin-large">
      <span><?php echo $button_continue; ?></span>
    </a>
  </div>
</section>

<?php echo $footer; ?>

<script type="text/javascript">
  <?php if ($pdf_file) { ?>
    var filePath = "<?php echo addslashes($pdf_file); ?>";
    var downloadURL = "/index.php?route=common/download_pdf&file=" + encodeURIComponent(filePath);
    window.location.href = downloadURL;
  <?php } ?>
</script>

<style>
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
</style>