/* Standalone print stylesheet for the civil registration form (iframe print). */

/* Self-hosted Ubuntu Sans so the printed PDF matches the rest of the app
   (the print iframe is a separate document and can't use the Next font vars). */
@font-face {
  font-family: "Ubuntu Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/UbuntuSans.woff2") format("woff2");
}

/* margin: 0 leaves the browser no room to draw its default headers/footers
   (page title, URL, date, page count), so those corner words disappear. The
   page's own margins are provided by padding on #printable-form instead. */
@page {
  size: A4;
  margin: 0;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: #1a1a2e;
  font-family: "Ubuntu Sans", system-ui, -apple-system, sans-serif;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

#printable-form {
  padding: 10mm;
  font-size: 11px;
  line-height: 1.35;
  color: #000;
  background: #fff;
}

#printable-form header {
  border-bottom: 2px solid #0d1f33;
  padding-bottom: 1rem;
}

#printable-form .header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

#printable-form .header-center {
  flex: 1;
  padding: 0 0.5rem;
  text-align: center;
}

#printable-form .header-right {
  flex-shrink: 0;
  text-align: right;
}

#printable-form .header-logo {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: contain;
}

#printable-form .applicant-photo {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 1px solid #0d1f33;
  margin-left: auto;
}

#printable-form .title-lg {
  font-size: 19px;
  font-weight: 800;
  text-transform: uppercase;
  color: #0d1f33;
}

#printable-form .title-md {
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  color: #0d1f33;
}

#printable-form .title-gold {
  margin-top: 0.35rem;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  color: #8a6c14;
}

#printable-form .form-code {
  margin-top: 0.25rem;
  font-size: 10px;
  color: #64748b;
}

#printable-form .app-id-banner {
  margin: 0.5rem 0;
  border-radius: 0.25rem;
  background: #0d1f33;
  padding: 0.35rem 1rem;
  text-align: center;
}

#printable-form .app-id-banner span {
  font-family: ui-monospace, monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #fff;
}

#printable-form section {
  margin-top: 0.5rem;
}

#printable-form h2 {
  margin: 0;
  border-bottom: 1px solid #a9c0db;
  padding-bottom: 0.2rem;
  font-size: 12px;
  font-weight: 700;
  color: #0d1f33;
}

#printable-form .section-body {
  margin-top: 0.25rem;
}

#printable-form .subtitle {
  margin: 0.4rem 0 0.15rem;
  font-size: 10.5px;
  font-weight: 700;
  color: #0d1f33;
}

/* Single full-width row — uses same 1:5 proportion as a RowGroup pair (1:2
   within each half of the 4-col grid = 1/6 total), so values align vertically
   with the RowGroup first-value column. */
#printable-form .row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 5fr;
  border: 1px solid #e2e8f0;
  border-top: none;
  break-inside: avoid;
}

#printable-form section > .section-body > .row:first-child,
#printable-form .subtitle + .row,
#printable-form .subtitle + .row-group {
  border-top: 1px solid #e2e8f0;
}

/* Two-pair row group: Label | Value | Label | Value — fixed 4-column grid
   so every label and value column align vertically like a proper table. */
#printable-form .row-group {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 2fr minmax(80px, 1fr) 2fr;
  border: 1px solid #e2e8f0;
  border-top: none;
  break-inside: avoid;
}

/* Each .row inside a group dissolves into the grid (label + value as cells). */
#printable-form .row-group .row {
  display: contents;
  border: none;
}

/* Internal cell borders */
#printable-form .row-group .row-label,
#printable-form .row-group .row-value {
  width: auto;
  border-right: 1px solid #e2e8f0;
}

/* Remove right border on the last cell of each row pair */
#printable-form .row-group > .row:last-child > .row-value {
  border-right: none;
}

#printable-form .row-label {
  width: auto;
  background: #f5f6fa;
  padding: 0.2rem 0.5rem;
  font-weight: 600;
  font-size: 10px;
  color: #0d1f33;
}

#printable-form .row-value {
  width: auto;
  padding: 0.2rem 0.5rem;
  font-weight: 700;
}

#printable-form .declaration {
  padding: 0.25rem 0.25rem 0.5rem;
  font-size: 11px;
  line-height: 1.625;
}

#printable-form .declaration p {
  margin: 0 0 0.5rem;
}

#printable-form .declaration-note {
  margin: 0.5rem 0.25rem;
  font-size: 11px;
  line-height: 1.625;
}

#printable-form .sig-row {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 1rem;
  padding-top: 0.35rem;
  font-size: 10px;
}

#printable-form .sig-line {
  flex: 1;
  border-top: 1px solid #000;
  padding-top: 0.25rem;
}

#printable-form .official-box {
  margin-top: 0.5rem;
  border: 1px solid #000;
  padding: 0.5rem;
}

#printable-form .official-box p {
  margin: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
