/* ฟอนต์กลางของระบบ — ฝังฟอนต์ Sarabun ไว้ในเว็บเอง (self-host)
   ทุกหน้าที่ลิงก์ไฟล์นี้จะแสดงเป็น Sarabun เหมือนกันทุกเครื่อง ไม่ต้องพึ่งฟอนต์ที่ติดตั้งในเครื่องผู้ใช้
   ตัวหนา (bold) เบราว์เซอร์จะสร้างให้อัตโนมัติจากตัวปกติ */
@font-face {
  font-family: 'Sarabun';
  src: url('/assets/fonts/Sarabun-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   ธีมกลางของเว็บ (ฝั่งประชาชน) — ใช้ร่วมกับ app/site_ui.php
   ทุกหน้ายังนิยาม :root ของตัวเองได้ตามเดิม (ค่าซ้ำจะไม่ชนกัน)
   ============================================================ */
:root {
  --navy: #0f2c59;
  --navy-dark: #0b2447;
  --gold: #c9a24a;
  --blue: #1d4ed8;
  --line: #e4e9f2;
  --ink: #1c2434;
  --gray: #5f6a7c;
  --bg: #f4f7fb;
}

html { scroll-behavior: smooth; }
body { font-family: 'Sarabun', 'Segoe UI', Tahoma, sans-serif; background: var(--bg); color: var(--ink); margin: 0; }

/* กรอบโฟกัสชัดเจนตอนกด Tab — สำคัญกับผู้สูงอายุ/ผู้ใช้คีย์บอร์ด */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ===== แถบช่วยการเข้าถึง ===== */
.a11y-bar { background: #eef2f8; border-bottom: 1px solid var(--line); }
.a11y-wrap { max-width: 1000px; margin: 0 auto; padding: 7px 16px; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.a11y-label { font-weight: 700; color: var(--ink); }
.a11y-btn { min-height: 34px; min-width: 34px; display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border: 1.5px solid #cbd5e1; border-radius: 8px; background: #fff; color: #334155; font-weight: 700; font-family: inherit; cursor: pointer; transition: .15s; }
.a11y-btn:hover { background: #e2e8f0; border-color: #94a3b8; }
.a11y-btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ===== ส่วนหัวเว็บ (ใช้ร่วมกันทุกหน้า) ===== */
.site-top { background: var(--navy); color: #fff; }
.site-top-wrap { max-width: 1000px; margin: 0 auto; padding: 16px 16px 10px; display: flex; align-items: center; gap: 12px; }
.seal { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; background: var(--gold); color: var(--navy); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 23px; overflow: hidden; }
.seal.has-logo { background: transparent; }
.seal img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.site-top h1 { font-size: 18px; margin: 0; }
.site-top p { font-size: 13px; margin: 2px 0 0; color: #c6d6f0; }

.site-nav { max-width: 1000px; margin: 0 auto; padding: 0 10px; display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { flex-shrink: 0; display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 10px 10px 0 0; font-weight: 700; font-size: 14.5px; text-decoration: none; color: #c6d6f0; white-space: nowrap; transition: .15s; }
.site-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.site-nav a.active { background: var(--bg); color: var(--navy); }

/* ===== container กลาง ===== */
.wrap { max-width: 1000px; margin: 0 auto; padding: 20px 16px 40px; }

/* ===== ท้ายเว็บ (ใช้ร่วมกันทุกหน้า) — พื้นน้ำเงินกรมท่า ===== */
.site-footer { background: var(--navy); margin-top: 30px; }
.site-footer-wrap { max-width: 640px; margin: 0 auto; padding: 34px 16px 24px; text-align: center; }
.footer-logo { width: 68px; height: 68px; object-fit: cover; border-radius: 50%; display: block; margin: 0 auto 12px; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.ft-logos { display: flex; justify-content: center; align-items: center; gap: 14px; margin-bottom: 4px; }
.ft-logos .footer-logo { margin: 0 0 8px; }
.footer-logo-dept { background: #fff; }
.ft-title { color: #fff; font-weight: 700; font-size: 15px; margin: 0 0 8px; }
.ft-line { color: #c6d6f0; font-size: 13px; line-height: 1.7; margin: 0; }
.ft-badge { display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 700; padding: 4px 14px; border-radius: 999px; border: 1px solid rgba(201,162,74,.5); background: rgba(201,162,74,.15); color: #f0cf8e; }
.ft-hr { border: none; border-top: 1px solid rgba(255,255,255,.15); max-width: 380px; margin: 18px auto; }
.ft-fb { margin-bottom: 14px; }
.ft-fb a { display: inline-flex; align-items: center; gap: 8px; background: #1877f2; color: #fff; font-size: 13.5px; font-weight: 700; padding: 9px 20px; border-radius: 8px; text-decoration: none; }
.ft-fb a:hover { opacity: .9; }
.ft-links { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.ft-links a { color: #c6d6f0; font-size: 12.5px; text-decoration: none; padding: 4px 4px; }
.ft-links a:hover { color: #fff; text-decoration: underline; }
.ft-links span { color: rgba(198,214,240,.5); font-size: 12px; }

/* เส้นนำทาง (breadcrumb) */
.breadcrumb { max-width: 960px; margin: 0 auto; padding: 12px 20px 0; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13px; }
.breadcrumb a { color: var(--gray); text-decoration: none; }
.breadcrumb a:hover { color: var(--navy); text-decoration: underline; }
.breadcrumb span { color: #b9c2d0; }
.breadcrumb .cur { color: var(--navy); font-weight: 700; }

/* แผนที่ที่ตั้งสำนักงาน */
.map-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 3px 12px rgba(15,44,89,.05); margin-top: 16px; }
.map-card .map-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 18px; gap: 10px; flex-wrap: wrap; }
.map-card .map-head span { font-weight: 700; color: var(--navy); font-size: 15px; }
.map-card .map-head a { color: var(--blue); font-size: 13px; font-weight: 700; text-decoration: none; }
.map-card iframe { width: 100%; height: 320px; border: 0; display: block; border-top: 1px solid var(--line); }

/* ปุ่มกลับขึ้นด้านบน */
.to-top { position: fixed; right: 20px; bottom: 20px; width: 46px; height: 46px; border-radius: 50%; border: none;
  background: var(--navy); color: #fff; font-size: 20px; cursor: pointer; box-shadow: 0 4px 14px rgba(15,44,89,.34);
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: .2s; z-index: 900; }
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--navy-dark); }
.ft-credit { color: rgba(198,214,240,.75); font-size: 12.5px; margin: 0 0 6px; }
.ft-credit b { color: rgba(255,255,255,.95); font-weight: 600; }
.ft-copy { color: rgba(198,214,240,.4); font-size: 12px; margin: 0; }

/* ===== เมนูย่อยแบบแคปซูล (ใต้เมนูหลัก ในแต่ละบริการ) ===== */
.sub-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.sub-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; text-decoration: none; background: #fff; color: var(--gray); border: 1.5px solid var(--line); transition: .15s; }
.sub-nav a:hover { border-color: #9db3cc; color: var(--navy); }
.sub-nav a.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ===== การ์ดคำถามพบบ่อย / ข้อปฏิบัติ (FAQ) ===== */
.faq-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 12px; box-shadow: 0 3px 12px rgba(15,44,89,.04); }
.faq-card h4 { color: var(--navy); font-size: 15.5px; margin: 0 0 8px; }
.faq-card p { color: var(--gray); font-size: 14px; line-height: 1.7; margin: 0; }
.faq-card + .faq-card { margin-top: 0; }

/* ===== การ์ดข้อมูลติดต่อ ===== */
.contact-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin-bottom: 14px; box-shadow: 0 3px 12px rgba(15,44,89,.04); }
.contact-card h4 { color: var(--navy); font-size: 15.5px; margin: 0 0 12px; }
.contact-card .row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; font-size: 14px; color: var(--ink); line-height: 1.6; }
.contact-card .row:last-child { margin-bottom: 0; }
.contact-card .row b { color: var(--navy); }
.contact-card .fb-btn { display: inline-flex; align-items: center; gap: 8px; width: 100%; justify-content: center; box-sizing: border-box; padding: 11px; border-radius: 10px; border: 1.5px solid #1877f2; color: #1877f2; font-weight: 700; text-decoration: none; font-size: 14px; }
.contact-card .fb-btn:hover { background: #1877f2; color: #fff; }

/* ===== การ์ดประเภทใบอนุญาต ===== */
.type-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: 12px; padding: 16px 20px; margin-bottom: 12px; box-shadow: 0 3px 12px rgba(15,44,89,.04); }
.type-card h4 { color: var(--navy); font-size: 15px; margin: 0 0 6px; }
.type-card p { color: var(--gray); font-size: 13.5px; line-height: 1.65; margin: 0; }
.type-card .warn { color: #b91c1c; font-weight: 700; }

/* ===== ขั้นตอนแบบเลขวงกลม ===== */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.step-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; text-align: center; box-shadow: 0 3px 12px rgba(15,44,89,.04); }
.step-card .num { width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; font-size: 18px; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.step-card h4 { color: var(--navy); font-size: 15px; margin: 0 0 6px; }
.step-card p { color: var(--gray); font-size: 13px; line-height: 1.6; margin: 0; }
.step-note { margin-top: 16px; background: #fff8e6; border: 1px solid #f5e2a8; color: #7a5b12; border-radius: 10px; padding: 12px 16px; font-size: 13.5px; line-height: 1.6; }

/* ===== สถิติคิว (กล่องตัวเลข) ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-box { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: 14px; padding: 16px 18px; box-shadow: 0 3px 12px rgba(15,44,89,.04); }
.stat-box .n { font-size: 28px; font-weight: 800; color: var(--navy); }
.stat-box .l { font-size: 13px; color: var(--gray); margin-top: 2px; }

/* ===== ชิปกรองสถานะ ===== */
.status-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.status-chips a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; text-decoration: none; background: #fff; color: var(--gray); border: 1.5px solid var(--line); }
.status-chips a .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.status-chips a.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ===== โหมดคอนทราสต์สูง — สลับด้วยปุ่มบนแถบการเข้าถึง =====
   เพิ่มความเข้มของสี/เส้นขอบ เพื่อผู้สูงอายุหรือผู้ที่สายตาไม่ดีอ่านง่ายขึ้น
   ใช้วิธี override ตัวแปรสี (--ink/--gray/--line) ที่ทุกหน้าอ้างอิงอยู่แล้ว
   จึงมีผลกับข้อความ/เส้นขอบทั่วทั้งหน้าโดยไม่ต้องแก้ CSS ของแต่ละหน้า */
body.hc { --ink: #000000; --gray: #1c2434; --line: #334155; background: #ffffff !important; }
body.hc .site-top { background: #000000; }
body.hc .seal { background: #ffe08a; }
body.hc .card, body.hc .service-card, body.hc .hero, body.hc .al, body.hc .lic,
body.hc .faq-card, body.hc .contact-card, body.hc .type-card, body.hc .step-card, body.hc .stat-box {
  box-shadow: none !important; border-width: 2px !important;
}
body.hc .sub-nav a, body.hc .status-chips a { border-width: 2px !important; }
body.hc a { text-decoration: underline; }
body.hc .site-nav a, body.hc .btn, body.hc .btn-ghost, body.hc .service-card { text-decoration: none; }
body.hc .btn, body.hc .btn-ghost { border-width: 2px !important; }

/* ===== การ์ด/ปุ่มกลาง (ใช้ซ้ำได้ทุกหน้า — หน้าเดิมยังกำหนดของตัวเองทับได้ตามปกติ) ===== */
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px 26px; box-shadow: 0 6px 24px rgba(15,44,89,.06); }
.btn { display: inline-block; background: var(--navy); color: #fff; border: none; border-radius: 999px; padding: 13px 32px; font-size: 16px; font-weight: 700; font-family: inherit; cursor: pointer; text-decoration: none; text-align: center; transition: .15s; }
.btn:hover { background: var(--navy-dark); color: #fff; }
.btn-ghost { display: inline-block; background: #fff; color: var(--navy); border: 1.5px solid #b9c6dd; border-radius: 999px; padding: 11px 28px; font-size: 14.5px; font-weight: 700; font-family: inherit; cursor: pointer; text-decoration: none; text-align: center; }
.btn-ghost:hover { background: #f4f7fb; }

/* ===== หน้าแรก: hero + การ์ดบริการ ===== */
.hero { background: linear-gradient(135deg, var(--navy) 0%, #173154 100%); border-radius: 20px; padding: 38px 30px; color: #fff; text-align: center; margin-bottom: 30px; }
.hero .emoji { font-size: 44px; }
.hero .hero-img { width: 100%; max-width: 100%; height: auto; margin: 0 auto 18px; display: block; border-radius: 14px; }
.hero h2 { font-size: 24px; margin: 10px 0 6px; }
.hero p { font-size: 15px; color: #c6d6f0; margin: 0 auto; max-width: 560px; line-height: 1.7; }
/* กรณีมีรูป hero.png ที่มีข้อความ/โลโก้อยู่ในภาพแล้ว — ให้กล่องมีแต่ภาพเต็มพื้นที่ ไม่ต้องมี padding/หัวข้อซ้ำ */
.hero.hero-image-only { padding: 0; overflow: hidden; }
.hero.hero-image-only .hero-img { margin: 0; border-radius: 20px; }

.section-title { text-align: center; margin: 0 0 20px; }
.section-title h3 { color: var(--navy); font-size: 21px; margin: 0 0 4px; }
.section-title p { color: var(--gray); font-size: 14px; margin: 0; }

.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 30px; }
.service-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px 22px; box-shadow: 0 4px 16px rgba(15,44,89,.05); text-decoration: none; color: inherit; display: block; transition: .15s; }
.service-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(15,44,89,.12); border-color: #9db3cc; }
.service-card .icon { width: 56px; height: 56px; border-radius: 16px; background: #eef2f8; display: flex; align-items: center; justify-content: center; font-size: 28px; margin-bottom: 14px; }
.service-card .badge { display: inline-block; font-size: 12px; font-weight: 700; color: #0b6b34; background: #e7f6ec; border: 1px solid #a6dcb8; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }
.service-card h4 { color: var(--navy); font-size: 17px; margin: 0 0 6px; }
.service-card p { color: var(--gray); font-size: 13.5px; margin: 0 0 14px; line-height: 1.6; }
.service-card .go { color: var(--navy); font-weight: 700; font-size: 13.5px; }

.help-box { max-width: 640px; margin: 0 auto; text-align: center; background: #eef7ff; border: 1.5px dashed #9dc3ea; border-radius: 16px; padding: 22px; }
.help-box h4 { color: #0c4a8f; margin: 0 0 6px; font-size: 16px; }
.help-box p { color: var(--gray); font-size: 14px; margin: 0; line-height: 1.7; }
.help-box b { color: #b91c1c; }
