* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #e9e9e9;
  font-family: Arial, sans-serif;
}

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px;
}

.certificate {
  position: relative;
  width: min(100%, 1472px);
  line-height: 0;
  background: #e8efbd;
  overflow: hidden;
}

.certificate-image {
  display: block;
  width: 100%;
  height: auto;
}

.qr-cover {
  position: absolute;
  left: 62.5%;
  top: 74.3%;
  width: 10.5%;
  height: 14.8%;
  background: linear-gradient(135deg, #e6efbd 0%, #dce9a8 48%, #e8efbd 100%);
  /* Subtle texture helps the covered patch blend with the certificate. */
  opacity: 0.98;
}

.image-error {
  margin: 0;
  padding: 24px;
  color: #8b1e1e;
  font: 16px/1.5 Arial, sans-serif;
}

@media (max-width: 600px) {
  .page {
    padding: 6px;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }

  body {
    background: #fff;
  }

  .page {
    min-height: 0;
    padding: 0;
  }

  .certificate {
    width: 100%;
  }
}
