/* เอกสารรับสมัคร 5 ฉบับ (หน้า /sign/{ฉบับ}) — พอร์ตจาก SchoolApp wwwroot/css/register-print.css
   ให้หน้าตาตรงกับที่พิมพ์ที่เคาน์เตอร์ · แผ่น A4 กว้าง 210mm บนจอแคบย่อทั้งแผ่นด้วย zoom (sign-pad.js)
   ฟอนต์ TH Sarabun New self-host (ฟรีจาก SIPA) */

@font-face {
    font-family: 'TH Sarabun New';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/lib/fonts/THSarabunNew.ttf') format('truetype');
}
@font-face {
    font-family: 'TH Sarabun New';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/lib/fonts/THSarabunNew-Bold.ttf') format('truetype');
}

.rp-root {
    --rp-fs-body: 14pt;
    --rp-fs-h1: 18pt;
    --rp-fs-h2: 16pt;
    font-family: 'TH Sarabun New', 'Sarabun', sans-serif;
    color: #000;
    line-height: 1.35;
}

.rp-sheet {
    box-sizing: border-box;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto 1.25rem;
    padding: 14mm 15mm;
    background: #fff;
    color: #000;
    box-shadow: 0 2px 14px rgb(23 36 64 / 22%);
    font-size: var(--rp-fs-body);
    line-height: 1.35;
    position: relative;
    overflow: hidden;
}
.rp-sheet:last-child { margin-bottom: 0; }

.rp-header { display: flex; align-items: center; gap: 12px; border-bottom: 1.5px solid #000; padding-bottom: 6px; padding-right: 3.1cm; }
.rp-header-logo { width: 92px; height: 92px; object-fit: contain; flex: 0 0 auto; }
.rp-header-text { flex: 1 1 auto; }
.rp-header-name { font-weight: 700; font-size: 16pt; }
.rp-header-line { font-size: 13pt; }

.rp-photo { position: absolute; top: 6mm; right: 17mm; width: 2.67cm; height: 3.3cm; object-fit: cover; border: 1px solid #000; background: #f2f2f2; z-index: 2; }
.rp-photo-slot { position: absolute; top: 6mm; right: 17mm; width: 2.67cm; height: 3.3cm; border: 1px dashed #999; z-index: 2; }

.rp-title { text-align: center; font-weight: 700; font-size: var(--rp-fs-h1); margin: 8px 0; }
.rp-right { text-align: right; }
.rp-section-h { font-weight: 700; font-size: var(--rp-fs-h2); margin: 8px 0 2px; margin-left: -6px; }
.rp-p { margin: 3px 0; text-indent: 0; }
.rp-indent { text-indent: 2.5em; }
.rp-tight { line-height: 1.3; }
.rp-row { display: flex; justify-content: space-between; gap: 16px; }
.rp-col { flex: 1 1 0; }
.rp-lbl { font-weight: 700; }
.rp-bullets { margin: 2px 0; padding-left: 1.2em; }
.rp-bullets li { list-style: none; text-indent: -1.2em; }
.rp-check { display: inline-block; width: 14px; height: 14px; border: 1.2px solid #000; text-align: center; line-height: 12px; font-size: 11px; margin-right: 4px; vertical-align: -1px; }
.rp-hr { border: 0; border-top: 1px solid #000; margin: 6px 0; }

.rp-sign-grid { display: flex; justify-content: space-around; gap: 24px; margin-top: 18px; }
.rp-sign { flex: 1 1 0; text-align: center; position: relative; }
.rp-sign-line { white-space: nowrap; }
.rp-contact .rp-sign-grid { margin-top: 4.05em; }

.rp-pdpa { font-size: 12pt; line-height: 1.26; }
.rp-pdpa .rp-title { font-size: 16pt; margin: 4px 0; }
.rp-pdpa .rp-section-h { font-size: 13pt; margin: 6px 0 1px; }
.rp-pdpa .rp-p { margin: 3px 0; text-align: justify; }
.rp-pdpa-list { margin: 2px 0; padding-left: 2em; }
.rp-pdpa-list li { margin: 2px 0; text-align: justify; }
.rp-pdpa-sign { margin-top: 12px; text-align: center; }
.rp-pdpa-sign > div { margin: 5px 0; white-space: nowrap; }
.rp-pdpa-divider { border-top: 1px dashed #888; margin: 9px 0 2px; }

.rp-footer { position: absolute; bottom: 8mm; left: 15mm; right: 15mm; display: flex; justify-content: space-between; font-size: 12pt; }
.rp-note-box { border: 1px solid #000; padding: 4px 8px; margin-top: 10px; font-size: 13pt; }
.rp-em { font-weight: 700; text-decoration: underline; }

/* แบบรัฐ (อ้างอิง 20260922050856874.pdf) */
.rp-state { font-size: 16pt; line-height: 1.15; overflow: visible; }
.rp-state-heading { text-align: center; margin-bottom: 5mm; }
.rp-state-heading h1 { font: bold 18pt/1.4 'TH Sarabun New', sans-serif; margin: 2mm 0; }
.rp-state-logo { width: 22mm; height: 22mm; object-fit: contain; margin: 0 auto 1mm; }
.rp-state h2 { font-size: 16pt; font-weight: 700; margin: 3mm 0 1mm; font-family: 'TH Sarabun New', sans-serif; }
.rp-state p { margin: 0; }
.rs-row { display: flex; align-items: baseline; gap: 1.5mm; margin: 0.3mm 0; }
.rs-value { display: inline-block; min-width: 22mm; min-height: 1em; border-bottom: 1px dotted #333; text-align: center; padding: 0 1mm; overflow-wrap: anywhere; }
.rs-row .rs-value { flex: 1; min-width: 0; }
.rs-row .rs-short { flex: 0 0 14mm; }
.rp-state .rs-value, .rs-majors td { font-size: 14pt; }
.rp-state-photo { position: absolute; right: 10mm; top: 10mm; width: 28mm; height: 36mm; border: 1px solid #000; display: grid; place-items: center; text-align: center; }
.rp-state-photo img { width: 100%; height: 100%; object-fit: cover; }
.rp-state-application { padding: 12mm 10mm 8mm; display: flex; flex-direction: column; }
.rp-state-application .rp-state-heading { padding: 0 30mm; min-height: 40mm; margin: 0; }
.rs-application-confirm { margin-top: auto; padding-top: 4mm; text-align: center; line-height: 1.3; }
.rs-application-confirm .rs-value, .rs-official .rs-value { min-width: 48mm; }
.rs-official { text-align: center; border-top: 1px solid #000; margin-top: 3mm; padding-top: 3mm; }
.rs-official-sign { margin-top: 4mm; }
.rs-majors { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: 1mm; }
.rs-majors th, .rs-majors td { border: 1px solid #000; padding: 1mm 2mm; text-align: left; overflow-wrap: anywhere; }
.rs-majors th:first-child, .rs-majors td:first-child { width: 15mm; text-align: center; }
.rp-state-enrollment { padding: 18mm 22mm; line-height: 1.1; }
.rp-state-enrollment .rp-state-logo { width: 27mm; height: 27mm; }
.rp-state-enrollment .rp-state-heading { margin-bottom: 7mm; }
.rs-written { margin: 0 0 7mm auto; width: fit-content; text-align: center; }
.rs-indent { text-indent: 10mm; }
.rs-row.rs-indent { text-indent: 0; padding-left: 10mm; }
.rs-enrollment-signatures { margin: calc(7mm + 3.3em) 0 0 auto; width: 83mm; text-align: center; }
.rs-enrollment-signatures > div { margin-top: 4mm; }
.rs-enrollment-signatures .rs-value { min-width: 48mm; }

/* ── ลายเซ็นอิเล็กทรอนิกส์ (ของฉบับนี้) วางเหนือเส้น "ลงชื่อ" แบบเดียวกับ .rp-sign-img ของหน้าพิมพ์ ── */
.doc-sigline { position: relative; }
.doc-sig {
    position: absolute; left: 50%; bottom: 0.9em; transform: translateX(-50%);
    display: grid; justify-items: center; pointer-events: none; text-indent: 0;
}
.doc-sig__img { max-height: 46px; max-width: 180px; object-fit: contain; mix-blend-mode: multiply; }
.doc-sig__stamp { font-size: 9pt; line-height: 1; color: #1b3a8a; white-space: nowrap; }
/* บรรทัดกดยอมรับ (8 พ.ย. 69) — ใต้วันเวลา ตัวเล็กกว่า */
.doc-sig__accept { font-size: 7pt; line-height: 1.1; color: #1b3a8a; white-space: nowrap; }
.rp-sign > .doc-sig { bottom: auto; top: -54px; }
/* แบบรัฐ/PDPA ไม่มีที่ว่างเหนือเส้นลงชื่อ (ต้นฉบับให้เซ็นด้วยมือ) — มีลายเซ็นแล้วเว้นที่ไม่ให้ทับข้อความด้านบน */
.doc-sigline:has(> .doc-sig) { margin-top: 3.4em; }
.rs-enrollment-signatures .doc-sigline:has(> .doc-sig) { margin-top: 4mm; }

/* ── พื้นที่แสดงแผ่นเอกสารบนจอ ── */
.docview {
    margin: 0 -16px 8px;
    padding: 12px 0;
    background: #e3e8f1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.docview__stage { width: 210mm; margin: 0 auto; }
.docview__hint { margin: 0 0 20px; text-align: center; color: var(--ink-2); font-size: .85rem; }
@media (min-width: 640px) {
    .docview { margin: 0 0 8px; border-radius: var(--r-lg); padding: 20px 0; }
}
