/* แบบฟอร์มออนไลน์ (eform_r27.php) — หน้าจอ + แผ่นพิมพ์ (@media print) */

.ef-hero { background: linear-gradient(135deg, #003366 0%, #001a33 50%, #0a1628 100%); padding: 12px 0; margin-bottom: 8px; }
.ef-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 22px; box-shadow: 0 6px 24px rgba(15, 23, 42, .06); }
.ef-summary { position: sticky; top: 90px; }
.ef-h { font-size: 1.1rem; font-weight: 700; color: #003366; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ef-h span { width: 28px; height: 28px; border-radius: 50%; background: #003366; color: #ffd700; display: inline-grid; place-items: center; font-size: .85rem; flex-shrink: 0; }
.req { color: #dc2626; font-weight: 700; }
.ef-steps { background: #eef4fb; border-left: 4px solid #003366; border-radius: 10px; padding: 12px 14px; font-size: .88rem; color: #1e293b; }
.ef-steps ol { padding-left: 18px; }
.ef-steps li { margin-bottom: 4px; }
.ef-steps a { font-weight: 600; margin-left: 2px; }
.ef-lookup { background: linear-gradient(135deg, #fffbeb, #fff7ed); border: 1px solid #fde68a; border-radius: 14px; padding: 14px 16px; }
.ef-lookup .ok { color: #047857; } .ef-lookup .bad { color: #b91c1c; }
.ef-pick { display: block; width: 100%; text-align: left; border: 1px solid #cbd5e1; background: #fff; border-radius: 10px; padding: 8px 12px; margin-top: 6px; }
.ef-pick:hover, .ef-pick:focus-visible { border-color: #003366; background: #eef4fb; }
.ef-filled { animation: ef-flash 1.2s ease; }
@keyframes ef-flash { 0% { background: #fef3c7; } 100% { background: #fff; } }
@media (prefers-reduced-motion: reduce) { .ef-filled { animation: none; } }
.ef-page legend.form-label { font-size: 1rem; }
.ef-chip { cursor: pointer; margin: 0; }
.ef-chip input { position: absolute; opacity: 0; pointer-events: none; }
.ef-chip span { display: inline-block; padding: 7px 16px; border-radius: 999px; border: 1px solid #cbd5e1; background: #fff; color: #334155; }
.ef-chip input:checked + span { background: #003366; border-color: #003366; color: #fff; }
.ef-chip input:focus-visible + span { outline: 3px solid #ffd700; outline-offset: 2px; }
.ef-group-title { font-weight: 700; color: #003366; border-bottom: 2px solid #ffd700; padding-bottom: 6px; margin-bottom: 4px; }
.ef-group-title span { font-weight: 400; color: #64748b; font-size: .85rem; margin-left: 6px; }
.ef-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px dashed #e2e8f0; }
.ef-item.is-on { background: #f0f7ff; margin: 0 -10px; padding: 10px; border-radius: 10px; }
.ef-item-name { flex: 1; min-width: 0; }
.ef-item-name small { display: block; color: #64748b; font-size: .78rem; }
.ef-qty { display: flex; gap: 8px; flex-shrink: 0; }
.ef-qty label { font-size: .82rem; color: #475569; display: flex; flex-direction: column; gap: 2px; }
.ef-qty input { width: 76px; text-align: center; }
.ef-total { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 6px; padding: 12px; border-radius: 12px; background: #fff7ed; color: #92400e; }
.ef-total b { font-size: 1.8rem; color: #003366; margin-left: auto; }
.ef-attach-box { background: #f8fafc; border-radius: 10px; padding: 10px 12px; font-size: .82rem; }
.ef-attach-box ul { margin: 6px 0 0; padding-left: 18px; }
.ef-sum-row { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; color: #334155; }
@media (max-width: 575.98px) { .ef-item { flex-direction: column; align-items: stretch; } .ef-qty input { width: 100%; } .ef-qty label { flex: 1; } }

/* ---------- แผ่น A4 สำหรับพิมพ์ ---------- */
.ef-sheet { display: none; }
@media print {
    @page { size: A4; margin: 7mm 9mm; }
    /* แผ่นถูกย้ายเป็นลูกตรงของ body ก่อนพิมพ์ → ซ่อนส่วนอื่นทั้งหมด (ไม่กินพื้นที่หน้ากระดาษ) */
    body > *:not(#ef-sheet) { display: none !important; }
    #ef-sheet { display: block !important; position: static !important; width: 100%; }
    html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
}
.ef-sheet { font-family: 'Sarabun', 'TH Sarabun New', Tahoma, sans-serif; font-size: 9.6pt; line-height: 1.22; color: #000; }
.ef-sheet .hd { display: flex; align-items: center; gap: 8px; position: relative; margin-bottom: 4px; }
.ef-sheet .hd img { width: 40px; }
.ef-sheet .hd .uni { font-weight: 700; font-size: 12pt; line-height: 1.1; }
.ef-sheet .hd .uni small { display: block; font-size: 6.5pt; font-weight: 400; letter-spacing: .3px; }
.ef-sheet .hd .ttl { font-size: 15pt; font-weight: 700; margin-left: 12px; }
.ef-sheet .hd .code { position: absolute; right: 0; top: -2px; font-size: 13pt; font-weight: 700; }
.ef-sheet .ln { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; margin: 1mm 0; }
.ef-sheet .f { border-bottom: 1px dotted #000; min-width: 14mm; padding: 0 2px; font-weight: 600; flex: 1; }
.ef-sheet .f.s { flex: 0 0 auto; min-width: 9mm; text-align: center; }
.ef-sheet .f.m { flex: 0 0 auto; min-width: 30mm; }
.ef-sheet .r { text-align: right; justify-content: flex-end; }
.ef-sheet .cb { display: inline-block; width: 3.2mm; height: 3.2mm; border: 1px solid #000; margin-right: 3px; position: relative; top: .4mm; text-align: center; line-height: 3mm; font-size: 9pt; font-weight: 700; }
.ef-sheet table { width: 100%; border-collapse: collapse; margin-top: 1.5mm; }
.ef-sheet th, .ef-sheet td { border: 1px solid #000; padding: .4mm 1.2mm; vertical-align: middle; }
.ef-sheet th { font-weight: 700; text-align: center; }
.ef-sheet td.fee { text-align: center; width: 15mm; }
.ef-sheet th { font-size: 9pt; }
.ef-sheet .it { display: flex; justify-content: space-between; gap: 4mm; }
.ef-sheet .nt { font-size: 7.8pt; line-height: 1.15; }
.ef-sheet .langs { white-space: nowrap; }
.ef-sheet .langs div { display: flex; gap: 2mm; }
.ef-sheet .q { display: inline-block; min-width: 9mm; border-bottom: 1px dotted #000; text-align: center; font-weight: 700; }
.ef-sheet .sign { display: flex; justify-content: space-around; margin: 2mm 0 1.5mm; text-align: center; line-height: 1.35; }
.ef-sheet .office td { vertical-align: top; width: 33.3%; font-size: 8.4pt; line-height: 1.3; }
.ef-sheet .office th { background: #f1f1f1; }
