/* =============== शाळा सोडल्याचे प्रमाणपत्र (दाखला) ===============
   Mirrors the official printed Form-1/Rule-7 leaving-certificate sheet:
   a bordered single sheet, a school-info header, a centered title bar,
   ruled blank rows for every field, a declaration line, a date bar,
   and a three-column signature row. One page, no invented content.

   Devanagari ruling convention: the fill-in rule sits ABOVE the answer
   (script hangs from the line, mirroring the shirorekha), not below it
   like a Latin-script underline — so .cert-blank/.cert-idrow use
   border-top, never border-bottom.

   Sizing convention: everything on this sheet is in pt/mm, never rem/em
   root-relative units. rem inherits the page's global font-size, which
   is what made the printed certificate come out a different size on
   every render — pt/mm are physical units, identical on screen and in
   the print/PDF engine, so the sheet is always the same size.

   Page-fill convention: .cert-page is pinned to exactly one A4 sheet
   (190mm x 277mm, matching the 10mm @page margin below) and .cert-signrow
   carries margin-top:auto inside that flex column, so the signature
   block + footnote are always pushed flush to the bottom edge. Whatever
   the content length for a given student, the sheet always fills the
   same fixed page — never a half-empty sheet, never overflow past it. */

.print-actions { max-width: 190mm; margin: 0 auto 12pt; display: flex; gap: 7pt; justify-content: flex-end; flex-wrap: wrap; }

.cert-page {
  background: #fff; width: 190mm; height: 277mm; box-sizing: border-box;
  margin: 0 auto; display: flex; flex-direction: column;
  border: 2pt solid #000; padding: 12pt 16pt 14pt;
  font-family: 'Noto Sans Devanagari', 'Segoe UI', system-ui, sans-serif;
  color: #000; font-size: 9.5pt; line-height: 1.45;
}

.cert-header-block { flex: none; padding-bottom: 1pt; }

.cert-hrow { display: flex; flex-wrap: wrap; gap: 0 13pt; margin: 1pt 0; align-items: flex-end; }
.cert-field { display: flex; align-items: flex-end; gap: 3.5pt; flex: 1 1 auto; min-width: 90pt; }
.cert-field.wide { flex: 2 1 100%; }
.cert-label { white-space: nowrap; font-weight: 600; }
.cert-blank {
  flex: 1; min-width: 24pt; border-top: 1pt dotted #000;
  padding: .12em 3pt 0; font-weight: 400; text-align: left;
}

/* single-character ruled boxes, register-style (student/UID/UDISE/DOB) */
.cert-idrow { flex: none; display: flex; align-items: center; gap: 6pt; margin: 2.5pt 0; flex-wrap: wrap; }
.cert-boxes { display: inline-flex; gap: 2px; }
.cert-cell {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.15em; height: 1.5em; border: 1pt solid #000; font-weight: 600; font-size: .95em;
}

.cert-title-bar { flex: none; text-align: center; margin: 6pt 0 7pt; }
.cert-title-bar span {
  display: inline-block; font-size: 13pt; font-weight: 700; line-height: 1.5;
  letter-spacing: .05em; border-top: 1.5pt solid #000; border-bottom: 1.5pt solid #000;
  padding: 3pt 16pt;
}

.cert-divider { flex: none; border-top: 1.5pt solid #000; margin: 4pt 0 6pt; }

.cert-body { flex: none; }
.cert-body .cert-hrow { margin: 3.5pt 0; }

.cert-declare { display: flex; align-items: baseline; gap: 3.5pt; flex-wrap: wrap; margin: 3.5pt 0; }
.cert-datebar { display: flex; gap: 0 12pt; margin-top: 6pt; flex-wrap: wrap; }

.cert-signrow {
  flex: none; margin-top: auto; padding-top: 26pt;
  display: flex; justify-content: space-between; gap: 12pt; flex-wrap: wrap;
}
.cert-signrow div { text-align: center; font-weight: 600; min-width: 110pt; }

.cert-footnote { flex: none; font-size: 8.5pt; margin-top: 10pt; }

@media print {
  .topbar, .print-actions, .foot, .flash, .no-print { display: none !important; }
  body { background: #fff; }
  .wrap { max-width: none; margin: 0; padding: 0; }
  .cert-page { border-color: #000; }
  @page { size: A4; margin: 10mm; }
}
