/* ระบบฟอร์มออนไลน์ — ฟอนต์และองค์ประกอบฟอร์ม ; สีแบรนด์มาจาก --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; }

/* ---------- แบนเนอร์เคลื่อนไหว (CSS ล้วน ; ทุกสหกรณ์ — ผู้ใช้ขอ 2026-10-27) ---------- */
/* คลื่น: SVG กว้าง 200% ลวดลายซ้ำทุกครึ่ง -> เลื่อน -50% แล้ววนต่อเนียน */
.wave-track { position: absolute; left: 0; bottom: 0; width: 200%; pointer-events: none; animation: wave-slide 26s linear infinite; }
.wave-track.slow { animation-duration: 40s; animation-direction: reverse; }
@keyframes wave-slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* วงแสงพื้นหลังลอยช้า ๆ */
.glow-blob { position: absolute; border-radius: 9999px; filter: blur(48px); pointer-events: none; animation: blob-drift 18s ease-in-out infinite alternate; }
.glow-blob.b2 { animation-duration: 24s; animation-delay: -6s; }
@keyframes blob-drift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(30px, -20px) scale(1.08); }
    100% { transform: translate(-20px, 15px) scale(0.96); }
}

/* ภาพประกอบลอยขึ้นลง + ส่วนย่อยขยับ */
.anim-float { animation: float-y 6s ease-in-out infinite; }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.anim-bob { animation: bob 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.anim-pen { animation: pen 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes pen { 0%, 100% { transform: rotate(0deg); } 30% { transform: rotate(-5deg) translateX(-2px); } 60% { transform: rotate(3deg); } }
.anim-paper { animation: paper 5s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes paper { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-3deg) translateY(-4px); } }

/* เครื่องหมายถูกวาดทีละอัน (วนทุก 7 วินาที) */
.anim-check { stroke-dasharray: 34; stroke-dashoffset: 34; animation: check-draw 7s ease-in-out infinite; }
.anim-check.c2 { animation-delay: .5s; }
.anim-check.c3 { animation-delay: 1s; }
@keyframes check-draw { 0%, 6% { stroke-dashoffset: 34; } 18%, 85% { stroke-dashoffset: 0; } 95%, 100% { stroke-dashoffset: 34; } }

/* แถบข้อความในแบบฟอร์มจำลองค่อย ๆ เต็ม */
.anim-line { transform-box: fill-box; transform-origin: left center; animation: line-grow 7s ease-out infinite; }
.anim-line.l2 { animation-delay: .5s; }
.anim-line.l3 { animation-delay: 1s; }
@keyframes line-grow { 0%, 8% { transform: scaleX(0); } 22%, 85% { transform: scaleX(1); } 96%, 100% { transform: scaleX(0); } }

/* ข้อความปรากฏตอนเปิดหน้า */
.anim-rise { opacity: 0; animation: rise .7s cubic-bezier(.2, .7, .2, 1) forwards; }
.anim-rise.d1 { animation-delay: .08s; }
.anim-rise.d2 { animation-delay: .18s; }
.anim-rise.d3 { animation-delay: .28s; }
.anim-rise.d4 { animation-delay: .4s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ผู้ใช้ที่ตั้งค่า "ลดการเคลื่อนไหว" ในเครื่อง -> นิ่งทั้งหมด */
@media (prefers-reduced-motion: reduce) {
    .wave-track, .glow-blob, .anim-float, .anim-bob, .anim-pen, .anim-paper, .anim-check, .anim-line { animation: none !important; }
    .anim-check { stroke-dashoffset: 0; }
    .anim-rise { animation: none !important; opacity: 1; }
}
@media print { .no-print { display: none !important; } }
