.official-form {
  position: relative;
  width: min(100%, 210mm);
  min-height: 0;
  aspect-ratio: 210 / 297;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #b9c0ca;
  background: #fff;
  box-shadow: 0 12px 35px rgba(23, 32, 51, 0.12);
  container-type: inline-size;
}

.form-template,
.form-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.form-template {
  display: block;
  object-fit: fill;
}

.form-overlay {
  z-index: 1;
  pointer-events: none;
}

.overlay-field {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  padding: 0 0.28cqw;
  color: #000;
  background: transparent;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 8px;
  font-size: 1cqw;
  font-weight: 700;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}

.overlay-invoice-number,
.overlay-chapter-code,
.overlay-vat-registration,
.overlay-service-postal,
.overlay-debtor-tax-id,
.overlay-postal-code,
.overlay-phone,
.overlay-vat-rate,
.overlay-analysis-vat-rate,
.overlay-net-euros,
.overlay-net-cents,
.overlay-vat-euros,
.overlay-vat-cents,
.overlay-sum1-euros,
.overlay-sum1-cents,
.overlay-sum2-euros,
.overlay-sum2-cents,
.overlay-gross-euros,
.overlay-gross-cents,
.overlay-analysis-euros,
.overlay-analysis-cents,
.overlay-sign-date,
.overlay-bottom-gross-euros,
.overlay-bottom-gross-cents {
  justify-content: center;
  text-align: center;
  padding: 0;
}

.overlay-full-invoice-identifier {
  left: 4.8%;
  top: 2.9%;
  width: 34%;
  height: 1.75%;
  color: #333;
  font-size: 8px;
  font-size: 1.2cqw;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.overlay-invoice-number {
  left: 84%;
  top: 2.72%;
  width: 11.6%;
  height: 2.45%;
  justify-content: flex-start;
  padding: 0;
  font-size: 12px;
  font-size: 2.2cqw;
  text-align: left;
  white-space: nowrap;
}
.overlay-department,
.overlay-chapter-code,
.overlay-vat-registration,
.overlay-issue-date,
.overlay-service-address,
.overlay-service-postal {
  font-size: 9px;
  font-size: 1.95cqw;
  font-weight: 700;
}
.overlay-department { left: 27.9%; top: 11.24%; width: 68%; height: 1.74%; }
.overlay-chapter-code { left: 27.9%; top: 13.84%; width: 9%; height: 1.74%; }
.overlay-vat-registration { left: 55.25%; top: 13.84%; width: 11%; height: 1.74%; }
.overlay-issue-date {
  left: 83.55%;
  top: 14.32%;
  width: 11.48%;
  height: 1.74%;
  align-items: center;
  background: #fff;
  border-bottom: 1px dotted #000;
  justify-content: center;
  padding: 0;
  text-align: center;
}
.overlay-service-address { left: 32.38%; top: 16.45%; width: 38%; height: 1.74%; }
.overlay-service-postal { left: 86.07%; top: 16.45%; width: 7%; height: 2.05%; }
.overlay-debtor-name {
  left: 26%;
  top: 20.75%;
  width: 39%;
  height: 2.04%;
  align-items: flex-start;
  overflow: visible;
  font-size: 12px;
  font-size: 2.35cqw;
  white-space: nowrap;
}
.overlay-debtor-tax-id { left: 82.96%; top: 21.06%; width: 9%; height: 1.6%; font-size: 9px; font-size: 1.95cqw; }
.overlay-debtor-location { left: 29.21%; top: 23.49%; width: 25%; height: 2.04%; font-size: 12px; font-size: 2.35cqw; }
.overlay-postal-code { left: 70.26%; top: 23.98%; width: 9%; height: 1.6%; font-size: 9px; font-size: 1.95cqw; }
.overlay-phone { left: 86.49%; top: 23.98%; width: 9%; height: 1.6%; font-size: 9px; font-size: 1.95cqw; }
.overlay-payment-type { left: 67.1%; top: 26.75%; width: 29.5%; height: 1.8%; font-size: 8px; font-size: 1.2cqw; }
.overlay-description-line-1,
.overlay-description-line-2 { left: 12.96%; width: 27%; height: 1.6%; font-size: 10px; font-size: 1.7cqw; }
.overlay-description-line-1 { top: 35.25%; }
.overlay-description-line-2 { top: 37.64%; }
.overlay-billing-period { left: 19.37%; top: 42.52%; width: 15%; height: 1.6%; font-size: 10px; font-size: 1.7cqw; }
.overlay-vat-rate,
.overlay-analysis-vat-rate { left: 76.06%; width: 2.5%; height: 1.6%; font-size: 10px; font-size: 1.95cqw; }
.overlay-vat-rate { left: 76.36%; top: 35.03%; width: 2.5%; height: 1.6%; font-size: 10px; font-size: 1.95cqw; }
.overlay-analysis-vat-rate { top: 74.87%; }
.overlay-net-euros,
.overlay-sum1-euros,
.overlay-gross-euros { left: 64.73%; width: 3.76%; }
.overlay-net-cents,
.overlay-sum1-cents,
.overlay-gross-cents { left: 69.9%; width: 2.51%; }
.overlay-vat-euros,
.overlay-sum2-euros,
.overlay-analysis-euros,
.overlay-bottom-gross-euros { left: 86.88%; width: 3.76%; }
.overlay-vat-cents,
.overlay-sum2-cents,
.overlay-analysis-cents,
.overlay-bottom-gross-cents { left: 92.11%; width: 2.51%; }
.overlay-net-euros,
.overlay-net-cents,
.overlay-vat-euros,
.overlay-vat-cents,
.overlay-sum1-euros,
.overlay-sum1-cents,
.overlay-sum2-euros,
.overlay-sum2-cents,
.overlay-gross-euros,
.overlay-gross-cents,
.overlay-analysis-euros,
.overlay-analysis-cents,
.overlay-bottom-gross-euros,
.overlay-bottom-gross-cents { height: 2%; font-size: 12px; font-size: 1.95cqw; }
.overlay-net-euros,
.overlay-net-cents { top: 42.04%; }
.overlay-vat-euros,
.overlay-vat-cents { top: 41.97%; }
.overlay-sum1-euros,
.overlay-sum1-cents { top: 56.94%; }
.overlay-sum2-euros,
.overlay-sum2-cents { top: 56.87%; }
.overlay-gross-euros,
.overlay-gross-cents { top: 59.65%; }
.overlay-amount-words {
  left: 26.87%;
  top: 65.47%;
  width: 40.24%;
  height: 1.31%;
  font-size: 7px;
  font-size: 1.55cqw;
  line-height: 1.08;
  white-space: normal;
}
.overlay-analysis-euros,
.overlay-analysis-cents { top: 74.69%; }
.overlay-signatory-name { left: 29.72%; top: 81.15%; width: 20%; height: 1.31%; font-size: 9px; font-size: 1.55cqw; }
.overlay-sign-date { left: 31.21%; top: 84.43%; width: 16%; height: 1.74%; font-size: 12px; font-size: 2cqw; }
.overlay-bottom-gross-euros,
.overlay-bottom-gross-cents { top: 84.31%; }
.overlay-revenue-account { left: 51%; top: 89.1%; width: 28%; height: 1.8%; font-size: 8px; font-size: 1cqw; }

.cancelled-invoice-watermark {
  left: 6%;
  top: 42%;
  z-index: 5;
  width: 88%;
  height: 14%;
  justify-content: center;
  padding: 0;
  color: rgba(170, 0, 0, 0.34);
  font-size: 60px;
  font-size: 10cqw;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.08em;
  opacity: 1;
  transform: rotate(-24deg);
  transform-origin: center;
  pointer-events: none;
}

@media print {
  .official-form {
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    aspect-ratio: auto;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
