/* ===========================================================
   PTiS — ชั้นงานออกแบบของเว็บไซต์
   โหลดต่อจาก bootstrap.min.css (ใช้เฉพาะระบบ grid) และ font-awesome
   แก้สี ขนาดตัวอักษร และระยะห่างทั้งเว็บได้จากตัวแปรในบล็อก :root
   =========================================================== */

:root {
  --navy-900: #06203f;
  --navy-800: #0a2b5c;
  --navy-700: #12407f;
  --navy-50:  #eef3fa;
  --gold-600: #a97f1e;
  --gold-500: #c8a24a;
  --gold-100: #f6edd8;

  --ink:      #16202e;
  --muted:    #55637a;
  --line:     #dde4ec;
  --bg:       #ffffff;
  --bg-soft:  #f5f8fc;
  --card:     #ffffff;
  --head:     var(--navy-900);
  --hero-a:   #06203f;
  --hero-b:   #12407f;
  --foot:     #06203f;
  --foot-ink: #b7c7dc;
  --link:     var(--navy-700);

  --radius:   12px;
  --shadow:   0 1px 2px rgba(10,43,92,.06), 0 10px 30px rgba(10,43,92,.09);
  --wrap:     1280px;
}

/* ---------- ธีมกลางคืน ---------- */
:root[data-theme="dark"] {
  --navy-50:  #142338;
  --gold-600: #e2bd6a;
  --gold-500: #d9b263;
  --gold-100: #2a2416;

  --ink:      #e7eef8;
  --muted:    #9fb0c6;
  --line:     #28364a;
  --bg:       #0d1724;
  --bg-soft:  #121d2d;
  --card:     #15202f;
  --head:     #f2f6fb;
  --hero-a:   #0a1626;
  --hero-b:   #15314f;
  --foot:     #091320;
  --foot-ink: #9fb0c6;
  --link:     var(--gold-500);
  --shadow:   0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
}

/* ---------- พื้นฐาน ---------- */
* { box-sizing: border-box; }

/* ขนาดตัวอักษรยืดตามความกว้างจอ 17px บนมือถือ ถึง 20px บนจอกว้าง */
html { font-size: clamp(17px, 0.3125vw + 14px, 20px); scroll-behavior: smooth; }

body {
  font-family: "Noto Sans Thai", "Noto Sans SC", "Inter", -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.78;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

h1, h2, h3, h4, h5 {
  font-family: "Noto Sans Thai", "Noto Sans SC", "Inter", sans-serif;
  color: var(--head);
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 .6em;
}

h1 { font-size: 2.55rem; letter-spacing: -.015em; }
h2 { font-size: 1.85rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.06rem; }

p { margin: 0 0 1.15em; }
html[lang="th"] body { word-break: keep-all; overflow-wrap: break-word; }
.nw { white-space: nowrap; }
a { color: var(--link); text-decoration: none; transition: color .15s ease; }
a:hover, a:focus { color: var(--gold-600); text-decoration: underline; }

ul, ol { padding-left: 1.4rem; }
li { margin-bottom: .3rem; }

.container { max-width: var(--wrap); width: 100%; }

.lead-text { font-size: 1.2rem; color: var(--muted); }
.muted { color: var(--muted); }
.todo { background: #fff3cd; color: #7a5600; padding: 0 .35em; border-radius: 4px; }
:root[data-theme="dark"] .todo { background: #4a3c12; color: #ffe8a8; }

:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }

.scroll-progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 300; pointer-events: none; background: transparent; }
.scroll-progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--gold-600), var(--gold-500), var(--navy-700));
  box-shadow: 0 0 10px rgba(200,162,74,.5);
}

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 999; background: var(--navy-800); color: #fff; padding: .7rem 1.1rem; }
.skip-link:focus { left: 0; color: #fff; }

/* ---------- ลูกเล่นหัวข้อ ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .88rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--gold-600); margin-bottom: .6rem;
}
.eyebrow::before {
  content: ""; width: 26px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-500), transparent);
}
.section-navy .eyebrow, .hero .eyebrow { color: var(--gold-500); }

.section-head { max-width: 820px; margin-bottom: 2.6rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .eyebrow::before { display: none; }

.section-head h2, .section-head h1 { position: relative; padding-bottom: .5rem; }
.section-head h2::after, .section-head h1::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 82px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--gold-500), var(--navy-700));
  transform-origin: left; animation: rule-in .7s cubic-bezier(.2,.8,.3,1) both;
}
.section-head.center h2::after, .section-head.center h1::after { left: 50%; transform: translateX(-50%); }
@keyframes rule-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.section-head.center h2::after { animation: rule-in-c .7s cubic-bezier(.2,.8,.3,1) both; }
@keyframes rule-in-c { from { transform: translateX(-50%) scaleX(0); } to { transform: translateX(-50%) scaleX(1); } }

/* ค่อย ๆ ลอยขึ้นเมื่อเลื่อนถึง */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.3,1); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .section-head h2::after, .section-head h1::after { animation: none; }
  .hero::after, .hero-cover { animation: none; }
  .faq-item.is-open .faq-a { animation: none; }
  .brand:hover .brand-logo, .card-p:hover .card-icon { transform: none; }
}

/* ---------- แถบบนสุด ---------- */
.topbar { background: var(--navy-900); color: #c9d6e8; font-size: .92rem; padding: .5rem 0; }
:root[data-theme="dark"] .topbar { background: #061018; }
.topbar a { color: #c9d6e8; }
.topbar a:hover { color: #fff; text-decoration: none; }
.topbar-inner { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; justify-content: space-between; align-items: center; }
.topbar-contact a { margin-right: 1.2rem; white-space: nowrap; }
.topbar-channels span { margin-left: 1.2rem; white-space: nowrap; }
.topbar i { color: var(--gold-500); }

/* ---------- หัวเว็บและเมนู ---------- */
.site-header { background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100; }
.site-header > .container, .topbar > .container { max-width: 1420px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 80px; }

.brand { display: flex; align-items: center; gap: .75rem; line-height: 1.15; min-width: 0; }
.brand-text { min-width: 0; }
.brand-logo { width: auto; height: 64px; flex: 0 0 auto; display: block; transition: transform .35s cubic-bezier(.2,.8,.3,1); }
.brand-logo-dark { display: none; }
:root[data-theme="dark"] .brand-logo { display: none; }
:root[data-theme="dark"] .brand-logo-dark { display: block; }
.brand:hover .brand-logo { transform: scale(1.04); }
.brand:hover { text-decoration: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-mark { font-family: "Inter", sans-serif; font-size: 1.95rem; font-weight: 700; letter-spacing: .02em; color: var(--head); }
.brand-tag { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.primary-nav { display: flex; align-items: center; gap: 1.2rem; }
.primary-nav ul { display: flex; gap: 1.15rem; list-style: none; margin: 0; padding: 0; }
.primary-nav li { margin: 0; }
.primary-nav a { color: var(--ink); font-weight: 600; font-size: .95rem; white-space: nowrap; padding: .45rem 0; display: inline-block; position: relative; }
.primary-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 2px;
  background: var(--gold-500); transition: right .22s ease;
}
.primary-nav a:hover { text-decoration: none; }
.primary-nav a:hover::after { right: 0; }
.primary-nav li.active > a { color: var(--navy-700); }
:root[data-theme="dark"] .primary-nav li.active > a { color: var(--gold-500); }
.primary-nav li.active > a::after { right: 0; }

.nav-tools { display: flex; align-items: center; gap: .6rem; flex: 0 0 auto; }

/* สลับภาษา */
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-switch a {
  padding: .3rem .62rem; font-size: .84rem; font-weight: 700; color: var(--muted);
  letter-spacing: .03em;
}
.lang-switch a:hover { background: var(--navy-50); text-decoration: none; color: var(--ink); }
.lang-switch a.is-current { background: var(--navy-800); color: #fff; }
:root[data-theme="dark"] .lang-switch a.is-current { background: var(--gold-500); color: #0d1724; }

/* ปุ่มธีม */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--ink); font-size: 1rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: .15s ease;
}
.theme-toggle:hover { background: var(--navy-50); }
.theme-toggle .fa-sun-o { display: none; }
:root[data-theme="dark"] .theme-toggle .fa-sun-o { display: block; }
:root[data-theme="dark"] .theme-toggle .fa-moon-o { display: none; }

.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; width: 46px; height: 42px; padding: 9px 10px; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; transition: .2s ease; }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-block; font-weight: 700; font-size: 1.04rem;
  padding: .78rem 1.6rem; border-radius: var(--radius);
  border: 1px solid transparent; transition: transform .15s ease, background .15s ease, color .15s ease;
  white-space: normal;
}
.btn:hover, .btn:focus { text-decoration: none; transform: translateY(-1px); }
.btn-gold { background: var(--gold-500); color: #06203f; }
.btn-gold:hover, .btn-gold:focus { background: var(--gold-600); color: #fff; }
.btn-navy { background: var(--navy-800); color: #fff; }
.btn-navy:hover, .btn-navy:focus { background: var(--navy-700); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover, .btn-ghost:focus { background: var(--navy-50); color: var(--ink); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn-ghost-light:hover, .btn-ghost-light:focus { background: rgba(255,255,255,.14); color: #fff; }
.btn-lg { padding: .95rem 2rem; font-size: 1.12rem; }
.nav-cta { padding: .52rem 1rem; font-size: .9rem; white-space: nowrap; }
.primary-nav a.nav-cta { color: #06203f; }
.primary-nav a.nav-cta:hover, .primary-nav a.nav-cta:focus { color: #fff; }
.primary-nav a.nav-cta::after { display: none; }

/* ---------- ส่วนเนื้อหา ---------- */
.section { padding: 86px 0; }
.section-soft { background: var(--bg-soft); }
.section-navy { background: var(--navy-900); color: #d7e2f0; }
:root[data-theme="dark"] .section-navy { background: #091320; }
.section-navy h2, .section-navy h3 { color: #fff; }
.section-navy p, .section-navy li { color: #c3d1e4; }

/* ---------- ฮีโร่ ---------- */
.hero { background: linear-gradient(135deg, var(--hero-a) 0%, var(--hero-b) 100%); color: #fff; padding: 92px 0 84px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 80% 70% at 30% 20%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 20%, #000 20%, transparent 75%);
}
.hero::after {
  content: ""; position: absolute; right: -140px; top: -150px; width: 520px; height: 520px;
  border-radius: 50%; background: radial-gradient(circle, rgba(200,162,74,.26), transparent 66%);
  pointer-events: none; animation: glow-drift 9s ease-in-out infinite alternate;
}
@keyframes glow-drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-34px,26px,0) scale(1.1); } }
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: #fff; font-size: 2.72rem; max-width: 17.5em; }
.hero h1 .hl { color: var(--gold-500); }
.hero p { color: #cfdcee; font-size: 1.2rem; max-width: 58ch; }
.hero-claim { color: #fff; font-weight: 700; font-size: 1.32rem; line-height: 1.6;
  max-width: 30em; text-decoration: underline; text-decoration-color: var(--gold-500);
  text-decoration-thickness: 3px; text-underline-offset: 7px; margin-bottom: 1.3rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: .75rem; margin-top: 1.8rem; }
.hero-actions .btn { flex: 0 1 auto; }
.hero-actions .btn-lg { padding: .9rem 1.45rem; font-size: 1.05rem; }
.hero-cover { display: block; width: 100%; max-width: 330px; height: auto; margin: 0 auto 1.4rem; border-radius: 50%; box-shadow: 0 14px 44px rgba(0,0,0,.38); animation: cover-float 7s ease-in-out infinite alternate; }
@keyframes cover-float { from { transform: translateY(-7px); } to { transform: translateY(7px); } }
.hero-side { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); border-radius: 16px; padding: 1.6rem; }
.hero-side h3 { color: #fff; font-size: 1.12rem; }
.hero-side ul { list-style: none; padding: 0; margin: 0; }
.hero-side li { padding: .45rem 0 .45rem 1.8rem; position: relative; color: #dbe6f4; font-size: 1.02rem; }
.hero-side li::before { content: "\f00c"; font-family: FontAwesome; position: absolute; left: 0; color: var(--gold-500); font-size: .9rem; }

/* ---------- แถบตัวเลข ---------- */
.factbar { background: var(--bg); border-bottom: 1px solid var(--line); }
.fact { padding: 1.9rem 1rem; text-align: center; position: relative; }
.fact::after { content: ""; position: absolute; right: 0; top: 28%; bottom: 28%; width: 1px; background: var(--line); }
.row > div:last-child .fact::after { display: none; }
.fact-num { font-size: 2.45rem; font-weight: 700; color: var(--navy-700); line-height: 1.2; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .fact-num { color: var(--gold-500); }
.fact-label { font-size: 1rem; color: var(--muted); }

/* ---------- การ์ด ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 1.5rem; }
.card-p { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; height: 100%; transition: .2s ease; position: relative; overflow: hidden; }
.card-p::before {
  content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--gold-500), var(--navy-700)); transition: width .3s ease;
}
.card-p:hover { box-shadow: 0 2px 4px rgba(10,43,92,.06), 0 18px 44px rgba(10,43,92,.16); transform: translateY(-5px); border-color: var(--gold-500); }
:root[data-theme="dark"] .card-p:hover { box-shadow: 0 18px 44px rgba(0,0,0,.5); }
.card-p:hover::before { width: 100%; }
.card-p h3 { font-size: 1.14rem; margin-bottom: .5rem; }
.card-p p { color: var(--muted); font-size: 1.01rem; margin-bottom: 0; }
.card-icon {
  width: 56px; height: 56px; border-radius: 15px; position: relative;
  background: linear-gradient(145deg, var(--navy-700), var(--navy-900));
  color: var(--gold-500); display: flex; align-items: center; justify-content: center;
  font-size: 1.42rem; margin-bottom: 1.15rem;
  box-shadow: 0 6px 16px rgba(10,43,92,.26);
  transition: transform .3s cubic-bezier(.2,.8,.3,1), box-shadow .3s ease;
}
.card-icon::after {
  content: ""; position: absolute; inset: -3px; border-radius: 18px;
  border: 1.5px solid var(--gold-500); opacity: 0; transform: scale(.9);
  transition: opacity .3s ease, transform .3s ease;
}
.card-p:hover .card-icon { transform: translateY(-2px) rotate(-5deg); box-shadow: 0 10px 22px rgba(10,43,92,.34); }
.card-p:hover .card-icon::after { opacity: .75; transform: scale(1); }
:root[data-theme="dark"] .card-icon { background: linear-gradient(145deg, #1b3356, #0b1626); }
.card-link { display: inline-block; margin-top: 1rem; font-weight: 700; font-size: 1rem; }
.card-link i { transition: transform .25s ease; margin-left: .25rem; }
.card-p:hover .card-link i { transform: translateX(5px); }

/* ---------- การ์ดบริการพร้อมรูป ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 1.5rem; }
.svc-card {
  display: grid; grid-template-columns: 158px 1fr; gap: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: .22s ease; position: relative;
}
.svc-card:hover { transform: translateY(-4px); border-color: var(--gold-500); box-shadow: 0 2px 4px rgba(10,43,92,.06), 0 18px 40px rgba(10,43,92,.15); }
:root[data-theme="dark"] .svc-card:hover { box-shadow: 0 18px 40px rgba(0,0,0,.5); }
.svc-media { background: #fff; border-right: 1px solid var(--line); display: flex; align-items: center; justify-content: center; padding: .9rem .6rem; }
.svc-media img { width: 100%; height: auto; max-height: 330px; object-fit: contain; display: block; }
.svc-body { padding: 1.6rem 1.7rem; }
.svc-body h3 { font-size: 1.16rem; margin-bottom: .5rem; }
.svc-body p { color: var(--muted); font-size: 1.01rem; margin-bottom: 0; }
.svc-body .card-link { margin-top: .9rem; }
.svc-card:hover .card-link i { transform: translateX(5px); }

/* เครื่องหมาย มอก. สองแบบ */
.mark-row { display: flex; gap: 1.6rem; flex-wrap: wrap; margin: 1.4rem 0 0; }
.mark-item { text-align: center; }
.mark-item img { height: 104px; width: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .5rem .8rem; display: block; }
.mark-item span { display: block; margin-top: .5rem; font-size: .95rem; color: var(--muted); }

/* ---------- ประกาศไว้อาลัย ---------- */
.memorial-overlay {
  position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center;
  padding: 2.2rem 1.1rem; background: rgba(5,8,12,.86); backdrop-filter: blur(3px);
  overflow-y: auto; animation: memorial-fade .35s ease both;
}
.memorial-overlay[hidden] { display: none; }
@keyframes memorial-fade { from { opacity: 0; } to { opacity: 1; } }

.memorial-box {
  position: relative; width: 100%; max-width: 540px; margin: auto;
  background: #11131a; border: 1px solid rgba(214,198,160,.28); border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden;
  animation: memorial-rise .4s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes memorial-rise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }

.memorial-img { display: block; width: 100%; height: auto; }

.memorial-close {
  position: absolute; right: .55rem; top: .55rem; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3);
  background: rgba(0,0,0,.5); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: .18s ease;
}
.memorial-close:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.55); }

.memorial-foot { padding: 1.5rem 1.6rem 1.7rem; text-align: center; color: #e9e6df; background: #11131a; }
.memorial-homage { font-size: 1.06rem; margin-bottom: .55rem; color: #efe9dc; }
.memorial-by { font-size: 1rem; line-height: 1.75; color: #c9c4ba; margin-bottom: 1.2rem; }
.memorial-en { font-size: .92rem; color: #a7a298; }

.memorial-actions { display: flex; flex-direction: column; align-items: center; gap: .85rem; }
.memorial-check { display: inline-flex; align-items: center; gap: .5rem; font-size: .93rem; font-weight: 400; color: #a7a298; cursor: pointer; margin: 0; }
.memorial-check input { width: auto; margin: 0; }
.memorial-enter { background: #c8b792; color: #15171d; }
.memorial-enter:hover, .memorial-enter:focus { background: #ded0ae; color: #15171d; }

body.memorial-open { overflow: hidden; }

@media (max-width: 767px) {
  .memorial-overlay { padding: 1.1rem .8rem; }
  .memorial-foot { padding: 1.2rem 1.1rem 1.4rem; }
  .memorial-homage { font-size: 1rem; }
  .memorial-by { font-size: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
  .memorial-overlay, .memorial-box { animation: none; }
}

@media print { .memorial-overlay { display: none !important; } }

/* ---------- ไทม์ไลน์ขั้นตอนการให้บริการ ---------- */
.flow { list-style: none; margin: 0; padding: 0; position: relative; }
.flow-step {
  position: relative; display: grid; grid-template-columns: 78px 1fr; gap: 1.4rem;
  margin: 0 0 2.6rem; padding-bottom: .2rem;
}
.flow-step:last-child { margin-bottom: 0; }

/* เส้นเชื่อมระหว่างหมายเลข */
.flow-step::before {
  content: ""; position: absolute; left: 38px; top: 86px; bottom: -2.6rem; width: 2px;
  background: linear-gradient(180deg, var(--gold-500), var(--line) 85%);
}
.flow-step:last-child::before { display: none; }

.flow-num { position: relative; width: 78px; height: 78px; }
.flow-num span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 20px; font-family: "Inter", sans-serif; font-size: 1.62rem; font-weight: 700;
  color: var(--gold-500); background: linear-gradient(145deg, var(--navy-700), var(--navy-900));
  box-shadow: 0 8px 20px rgba(10,43,92,.28);
  transition: transform .3s cubic-bezier(.2,.8,.3,1), box-shadow .3s ease;
}
:root[data-theme="dark"] .flow-num span { background: linear-gradient(145deg, #1b3356, #0b1626); }
.flow-num::after {
  content: ""; position: absolute; inset: -5px; border-radius: 25px;
  border: 2px solid var(--gold-500); opacity: 0; transform: scale(.88);
  transition: opacity .3s ease, transform .3s ease;
}
.flow-step:hover .flow-num span { transform: translateY(-3px) rotate(-4deg); box-shadow: 0 14px 28px rgba(10,43,92,.36); }
.flow-step:hover .flow-num::after { opacity: .8; transform: scale(1); }

.flow-body { padding-top: .35rem; }
.flow-body h2 {
  font-size: 1.52rem; margin-bottom: .55rem; position: relative;
  padding-bottom: .45rem; transition: color .2s ease;
}
.flow-body h2::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 46px; border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-500), transparent);
  transition: width .35s cubic-bezier(.2,.8,.3,1);
}
.flow-step:hover .flow-body h2 { color: var(--navy-700); }
:root[data-theme="dark"] .flow-step:hover .flow-body h2 { color: var(--gold-500); }
.flow-step:hover .flow-body h2::after { width: 120px; }
.flow-body p:last-child { margin-bottom: 0; }
.flow-body .callout { margin-bottom: 0; }

@media (max-width: 767px) {
  .flow-step { grid-template-columns: 56px 1fr; gap: 1rem; margin-bottom: 2.1rem; }
  .flow-step::before { left: 27px; top: 64px; bottom: -2.1rem; }
  .flow-num { width: 56px; height: 56px; }
  .flow-num span { border-radius: 15px; font-size: 1.22rem; }
  .flow-body h2 { font-size: 1.28rem; }
}

/* ---------- ขั้นตอน ---------- */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.3rem; }
.step { position: relative; padding: 1.6rem 1.4rem 1.4rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: .2s ease; }
.step::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--gold-500), transparent); }
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.step::before { counter-increment: step; content: counter(step, decimal-leading-zero); font-family: "Inter", sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--gold-600); opacity: .55; display: block; margin-bottom: .4rem; line-height: 1; }
.step h3 { font-size: 1.08rem; margin-bottom: .35rem; }
.step p { font-size: 1rem; color: var(--muted); margin: 0; }
.step .when { display: block; margin-top: .7rem; font-size: .92rem; color: var(--navy-700); font-weight: 700; }
:root[data-theme="dark"] .step .when { color: var(--gold-500); }

/* ---------- ตาราง ---------- */
.table-p { width: 100%; border-collapse: collapse; background: var(--card); font-size: 1.02rem; }
.table-p th, .table-p td { padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-p thead th { background: var(--navy-50); color: var(--head); font-weight: 700; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- กล่องข้อความ ---------- */
.callout { border: 1px solid var(--line); border-left: 4px solid var(--gold-500); background: var(--gold-100); border-radius: 0 var(--radius) var(--radius) 0; padding: 1.35rem 1.6rem; margin: 1.8rem 0; }
.callout p:last-child { margin-bottom: 0; }
.callout ul { padding-left: 1.3rem; margin-bottom: 0; }
.callout h3 { font-size: 1.12rem; }
.callout-navy { background: var(--navy-50); border-left-color: var(--navy-700); }

/* ---------- รูปผัง ---------- */
.figure-p { margin: 0; }
.figure-p img { max-width: 100%; height: auto; display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem; }
.figure-p figcaption { font-size: .92rem; color: var(--muted); margin-top: .7rem; }

/* ---------- การ์ดขั้นตอนรายบริการ ---------- */
.proc-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.7rem 1.7rem 1.7rem 1.9rem; margin-bottom: 1.4rem; position: relative; overflow: hidden; transition: .2s ease; }
.proc-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--gold-500), var(--navy-700)); }
.proc-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.proc-card h3 { font-size: 1.15rem; margin-bottom: .9rem; }
.proc-list { margin: 0 0 .9rem; padding-left: 1.4rem; }
.proc-list li { padding: .25rem 0; font-size: 1.02rem; }
.proc-list .d { display: inline-block; margin-left: .4rem; padding: .08rem .55rem; background: var(--navy-50); color: var(--navy-700); border-radius: 999px; font-size: .88rem; font-weight: 700; white-space: nowrap; }
:root[data-theme="dark"] .proc-list .d { color: var(--gold-500); }

/* ---------- คำถามที่พบบ่อย ---------- */
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q { width: 100%; text-align: left; background: none; border: 0; padding: 1.25rem 2.8rem 1.25rem 0; font-size: 1.1rem; font-weight: 700; color: var(--head); position: relative; cursor: pointer; transition: color .18s ease; }
.faq-q:hover { color: var(--gold-600); }
.faq-q::after { content: "\f107"; font-family: FontAwesome; position: absolute; right: .3rem; top: 50%; margin-top: -.75rem;
  width: 1.6rem; height: 1.6rem; line-height: 1.6rem; text-align: center; border-radius: 50%;
  background: var(--navy-50); color: var(--gold-600); font-size: .95rem; transition: transform .25s ease, background .2s ease; }
.faq-item.is-open .faq-q::after { transform: rotate(180deg); background: var(--gold-500); color: #06203f; }
.faq-a { display: none; padding: 0 0 1.35rem; color: var(--muted); font-size: 1.03rem; }
.faq-a h4 { font-size: 1.03rem; color: var(--head); margin: 1.1rem 0 .45rem; }
.faq-a h4:first-child { margin-top: 0; }
.faq-a ul { margin: 0 0 .2rem; padding-left: 1.3rem; }
.faq-a li { margin-bottom: .45rem; }
.faq-item.is-open .faq-a { animation: faq-in .28s ease both; }
@keyframes faq-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.faq-item.is-open .faq-a { display: block; }

/* ---------- ฟอร์ม ---------- */
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 2rem; box-shadow: var(--shadow); }
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 700; font-size: 1.02rem; margin-bottom: .4rem; color: var(--head); }
.field .hint { font-weight: 400; color: var(--muted); font-size: .94rem; }
.field input, .field select, .field textarea { width: 100%; padding: .78rem .9rem; font-size: 1.05rem; font-family: inherit; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy-700); outline: 2px solid var(--navy-50); }
.field textarea { min-height: 130px; resize: vertical; }

/* ช่องแนบไฟล์ ใช้ปุ่มของเราเองเพื่อให้ข้อความเป็นภาษาเดียวกับหน้า */
.file-field { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.file-input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.file-btn {
  display: inline-block; margin: 0; cursor: pointer; font-weight: 700; font-size: 1rem;
  padding: .62rem 1.2rem; border-radius: 10px; border: 1px solid var(--line);
  background: var(--navy-50); color: var(--head); transition: .15s ease;
}
.file-btn:hover { border-color: var(--gold-500); color: var(--navy-700); }
:root[data-theme="dark"] .file-btn:hover { color: var(--gold-500); }
.file-input:focus-visible + .file-btn { outline: 3px solid var(--gold-500); outline-offset: 2px; }
.file-name { font-size: .98rem; color: var(--muted); word-break: break-all; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.check { display: flex; gap: .65rem; align-items: flex-start; font-size: 1rem; color: var(--muted); font-weight: 400; }
.check input { width: auto; margin-top: .4rem; }
.req { color: #c0392b; }
:root[data-theme="dark"] .req { color: #ff8a80; }
.form-msg { display: block; margin-bottom: 1rem; font-size: 1.02rem; }
.form-msg.is-error { color: #c0392b; font-weight: 700; }

/* ---------- ฟุตเตอร์ ---------- */
.site-footer { background: var(--foot); color: var(--foot-ink); padding: 64px 0 0; font-size: 1.02rem; }
.site-footer h4 { color: #fff; font-size: 1.08rem; margin-bottom: 1rem; }
.site-footer a { color: var(--foot-ink); }
.site-footer a:hover { color: var(--gold-500); text-decoration: none; }
.foot-logo { width: auto; height: 76px; max-width: 100%; margin-bottom: 1.1rem; display: block; }
.foot-note { font-size: .94rem; color: #8fa3bd; border-top: 1px solid rgba(255,255,255,.12); padding-top: 1rem; }
.foot-links, .foot-contact { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.foot-links li, .foot-contact li { padding: .3rem 0; margin: 0; }
.foot-contact i { color: var(--gold-500); width: 20px; }
.copyrights { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2.6rem; padding: 1.3rem 0; font-size: .92rem; color: #8fa3bd; }
.copyrights p { margin: 0 0 .3rem; }
.foot-updated { font-size: .88rem; }

.qr-row { display: flex; gap: 1rem; margin: 0 0 1.3rem; flex-wrap: wrap; }
.qr { display: flex; flex-direction: column; align-items: center; gap: .4rem; text-decoration: none; }
.qr img { width: 96px; height: 96px; background: #fff; padding: 6px; border-radius: 10px; display: block; }
.qr span { font-size: .9rem; font-weight: 700; color: var(--foot-ink); }
.qr:hover span { color: var(--gold-500); }
.qr:hover { text-decoration: none; }

.to-top { position: fixed; right: 20px; bottom: 20px; width: 48px; height: 48px; border-radius: 50%; background: var(--navy-800); color: #fff; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: .2s ease; z-index: 90; }
.to-top.is-visible { opacity: 1; pointer-events: auto; }
.to-top:hover { background: var(--gold-500); color: #06203f; transform: translateY(-3px); }
.to-top { box-shadow: 0 8px 22px rgba(10,43,92,.3); }

/* ---------- จอเล็ก ---------- */
@media (max-width: 1340px) {
  .primary-nav ul { gap: .9rem; }
  .primary-nav a { font-size: .9rem; }
  .brand-tag { max-width: 13em; }
}

@media (max-width: 991px) {
  .svc-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1199px) {
  .nav-toggle { display: block; }
  .primary-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: .5rem 1rem 1.4rem; display: none; box-shadow: var(--shadow);
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav ul { flex-direction: column; gap: 0; }
  .primary-nav li { border-bottom: 1px solid var(--line); }
  .primary-nav a { padding: .95rem 0; }
  .primary-nav a::after { display: none; }
  .nav-cta { margin-top: 1rem; text-align: center; font-size: 1rem; padding: .78rem 1.6rem; }
  .primary-nav a { font-size: 1.02rem; }
  .site-header { position: static; }
  .header-inner { position: relative; }
}

@media (max-width: 767px) {
  h1, .hero h1 { font-size: 2rem; }
  h2 { font-size: 1.58rem; }
  h3 { font-size: 1.14rem; }
  .lead-text { font-size: 1.1rem; }
  .brand-logo { width: 36px; height: 36px; }
  .brand { gap: .55rem; }
  .brand-mark { font-size: 1.55rem; }
  .brand-tag { font-size: .72rem; }
  .header-inner { min-height: 66px; gap: .5rem; }
  .nav-tools { gap: .35rem; }
  .lang-switch a { padding: .28rem .44rem; font-size: .76rem; }
  .theme-toggle { width: 36px; height: 36px; font-size: .92rem; }
  .nav-toggle { width: 42px; height: 38px; padding: 8px 9px; }
  .fact::after { display: none; }
  .fact-num { font-size: 2.1rem; }
  .section { padding: 54px 0; }
  .hero { padding: 58px 0 54px; }
  .field-row { grid-template-columns: 1fr; }
  .brand-logo { height: 40px; }
  .foot-logo { height: 50px; }
  .svc-card { grid-template-columns: 1fr; }
  .svc-media { border-right: 0; border-bottom: 1px solid var(--line); padding: 1.2rem; }
  .svc-media img { max-height: 260px; width: auto; max-width: 100%; }
  .topbar-channels { display: none; }
  .topbar-contact a { margin-right: .9rem; font-size: .86rem; }
  .hero-side { margin-top: 1.8rem; }
  .btn { width: 100%; text-align: center; }
  .nav-tools .btn { width: auto; }
}

@media print {
  .topbar, .site-header, .to-top, .site-footer { display: none; }
}
