/* ═══════════════════════════════════════════════════════
   js/forms/print.css — استایل کاغذ A4 و چاپ فرم‌ها
   ═══════════════════════════════════════════════════════ */

#formPrintArea { display: none; }

/* پیش‌نمایش روی صفحه (موبایل) */
.form-preview-wrap {
  background: #f1f5f9;
  padding: 12px 8px;
  border-radius: 12px;
  overflow: hidden;
}

.form-preview-scale {
  transform-origin: top center;
  background: #fff;
  width: 745px;
  min-height: 1050px;
  padding: 20px 24px;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  border-radius: 4px;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  direction: rtl;
  color: #000;
  font-size: 12px;
  line-height: 1.9;
}

/* ═══ استایل مشترک فرم‌ها (روی پیش‌نمایش و چاپ) ═══ */
.form-sheet {
  width: 100%;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  direction: rtl;
  color: #000;
  font-size: 12px;
  line-height: 1.9;
}

.form-sheet .header-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}
.form-sheet .header-table td {
  border: 1.5px solid #000;
  padding: 4px 6px;
  vertical-align: middle;
  font-size: 11px;
}
.form-sheet .header-logo { width: 70px; text-align: center; }
.form-sheet .header-logo img { max-width: 60px; max-height: 60px; }
.form-sheet .header-center { text-align: center; font-weight: 700; }
.form-sheet .header-form-code { text-align: center; direction: ltr; font-weight: 700; font-size: 12px; }

.form-sheet h2.form-title {
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  margin: 10px 0;
}

.form-sheet .field-row {
  margin: 5px 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.form-sheet .lbl { font-weight: 700; white-space: nowrap; }
.form-sheet .val {
  flex: 1;
  min-width: 60px;
  border-bottom: 1px dotted #000;
  padding: 0 4px;
  min-height: 22px;
}
.form-sheet .val.short { flex: 0 0 auto; min-width: 80px; }
.form-sheet .val.box { border: 1px solid #000; border-bottom: 1px solid #000; padding: 2px 4px; }

.form-sheet .check-line {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 5px 0;
}
.form-sheet .check-item { display: inline-flex; align-items: center; gap: 4px; }
.form-sheet .check-box {
  display: inline-block;
  width: 12px; height: 12px;
  border: 1.2px solid #000;
  vertical-align: middle;
  text-align: center;
  line-height: 10px;
  font-size: 11px;
  font-weight: 700;
}
.form-sheet .check-box.checked::before { content: '✓'; }

.form-sheet .dotted-lines {
  margin: 6px 0;
}
.form-sheet .dotted-lines .line {
  border-bottom: 1px dotted #000;
  min-height: 22px;
  margin-bottom: 4px;
}

.form-sheet .box {
  border: 1.5px solid #000;
  padding: 8px 10px;
  margin: 8px 0;
}

.form-sheet .box-title {
  font-weight: 800;
  text-align: center;
  border-bottom: 1px solid #000;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.form-sheet .signature-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
  font-size: 11px;
}
.form-sheet .signature-item { flex: 1; }
.form-sheet .signature-item .line {
  border-bottom: 1px dotted #000;
  min-height: 30px;
  margin-top: 4px;
}

.form-sheet .footer-note {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  margin-top: 12px;
}

.form-sheet textarea.form-textarea {
  width: 100%;
  border: 1px solid #000;
  padding: 4px;
  font-family: inherit;
  font-size: 11px;
  resize: vertical;
  min-height: 50px;
}
.form-sheet input.form-inline {
  border: none;
  border-bottom: 1px dotted #000;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 11px;
  padding: 0 4px;
  min-width: 50px;
}
.form-sheet input.form-inline:focus { background: #fff7ed; }

/* ═══════════════════════════════════════════════════════
   چاپ
   ═══════════════════════════════════════════════════════ */
@page { size: A4; margin: 12mm; }

@media print {
  body > *:not(#formPrintArea) { display: none !important; }
  #formPrintArea {
    display: block !important;
    width: 100%;
    background: #fff;
    padding: 0;
    margin: 0;
  }
  #formPrintArea .form-sheet {
    page-break-inside: avoid;
  }
  #formPrintArea .page-break-after {
    page-break-after: always;
  }
}