/* ระบบฟอร์มออนไลน์ — ฟอนต์และองค์ประกอบฟอร์ม ; สีแบรนด์มาจาก --brand-* (includes/theme.php) */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai+Looped:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Noto Sans Thai Looped', 'Leelawadee UI', Tahoma, sans-serif;
    background-color: var(--page-bg, #f3f6f4);
    -webkit-font-smoothing: antialiased;
}

/* หน้าสมาชิก/เจ้าหน้าที่สหกรณ์: ขยายตัวอักษร Tailwind ขึ้นครึ่งระดับ อ่านสบายตา (ผู้ใช้ส่วนใหญ่อายุมาก) */
html body:not(.console) { font-size: 1.0625rem; }
html body:not(.console) .text-xs   { font-size: 0.8125rem; line-height: 1.2rem; }
html body:not(.console) .text-sm   { font-size: 0.9375rem; line-height: 1.45rem; }
html body:not(.console) .text-base { font-size: 1.0625rem; line-height: 1.7rem; }

.pf-label { display: block; font-size: 0.9rem; font-weight: 500; color: #374151; margin-bottom: 0.4rem; }
.pf-help  { font-size: 0.8rem; color: #9ca3af; margin-top: 0.35rem; line-height: 1.35rem; }
.pf-err   { font-size: 0.8rem; color: #dc2626; margin-top: 0.35rem; }

.pf-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 0.75rem;
    padding: 0.65rem 0.95rem;
    font-size: 0.95rem;
    color: #1f2937;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.pf-input::placeholder { color: #b6bec9; }
.pf-input:hover { border-color: #cbd5e1; }
.pf-input:focus { border-color: var(--brand-600); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-600) 14%, transparent); }
.pf-input[readonly], .pf-input:disabled { background: #f8fafc; color: #475569; cursor: default; }
.pf-input[readonly]:focus { box-shadow: none; border-color: #e2e8f0; }
.pf-invalid, .pf-input.pf-invalid { border-color: #f87171 !important; background-color: #fffafa; }
textarea.pf-input { resize: vertical; line-height: 1.6; }
.pf-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center; background-repeat: no-repeat; background-size: 1.25em; padding-right: 2.5rem;
}

.pf-choice {
    display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer;
    border: 1px solid #e2e8f0; border-radius: 0.75rem; padding: 0.5rem 0.9rem; font-size: 0.92rem; background: #fff;
    transition: border-color .15s, background .15s;
}
.pf-choice:hover { border-color: #cbd5e1; }
.pf-choice:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); color: #111827; }
.pf-choice input, .pf-check { accent-color: var(--brand-600); width: 1.05rem; height: 1.05rem; }
.pf-invalid-group .pf-choice { border-color: #fca5a5; }

.pf-drop {
    border: 1.5px dashed #cbd5e1; border-radius: 0.9rem; background: #fbfcfd; transition: border-color .15s, background .15s;
}
.pf-drop:hover, .pf-drop.is-over { border-color: var(--brand-600); background: var(--brand-50); }

/* ปุ่ม */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; border-radius: 0.75rem; font-weight: 500;
       padding: 0.6rem 1.25rem; font-size: 0.93rem; transition: background .15s, box-shadow .15s, color .15s, border-color .15s; white-space: nowrap; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; border-radius: 0.6rem; }
.btn-primary { background: var(--brand-600); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 12px color-mix(in srgb, var(--brand-600) 22%, transparent); }
.btn-primary:hover { filter: brightness(0.93); }
.btn-outline { background: #fff; color: #374151; border: 1px solid #e2e8f0; }
.btn-outline:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* การ์ด */
.card { background: #fff; border: 1px solid #edf0f3; border-radius: 1.25rem; box-shadow: 0 1px 2px rgba(15,23,42,.03), 0 8px 24px -12px rgba(15,23,42,.06); }

/* ตารางหลังบ้าน */
.tbl { width: 100%; font-size: 0.9rem; }
.tbl th { text-align: left; font-weight: 500; color: #64748b; font-size: 0.8rem; padding: 0.7rem 1rem; background: #f8fafc; border-bottom: 1px solid #eef2f6; white-space: nowrap; }
.tbl td { padding: 0.8rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafbfc; }

/* หลังบ้านกลาง (pfadmin) ใช้ขนาดมาตรฐาน */
body.console { font-size: 0.95rem; }

.hero-wave { position: absolute; inset: auto 0 0 0; height: 90px; pointer-events: none; }
@media print { .no-print { display: none !important; } }
