html {
  scroll-behavior: smooth;
}

section {
  scroll-margin-top: 80px; /* เว้นระยะไม่ให้ Navbar บังหัวข้อ */
}

:root {
  --navy: #0B2A5E;
  --navy-light: #163A7A;
  --gold: #C9991A;
  --gold-light: #E8B830;
  --blue: #1565C0;
  --blue-mid: #1E88E5;
  --light-bg: #F4F7FB;
  --white: #ffffff;
  --gray: #6B7280;
  --text: #1A1A2E;
  --border: #E2E8F0;
}

/* ระบบถวายความอาลัย */
.m-modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.93); z-index: 999999;
  display: flex; justify-content: center; align-items: center;
  overflow-y: auto; padding: 20px; box-sizing: border-box;
}
.m-modal-content {
  max-width: 550px; width: 100%; background: #1a1a1a; border: 1px solid #333;
  border-radius: 16px; padding: 24px; text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8); animation: mourningFadeIn 0.5s ease-out; box-sizing: border-box;
}
.m-royal-img {
  width: 100%; height: auto; max-height: 65vh; object-fit: contain; border-radius: 8px; margin-bottom: 24px;
}
.m-btn-group { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.m-btn {
  font-family: 'Prompt', sans-serif; padding: 14px 20px; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer; border: none; text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s ease; box-sizing: border-box;
}
.m-btn-gold { background-color: #A08040; color: #ffffff !important; }
.m-btn-gold:hover { background-color: #8A6D33; }
.m-btn-dark { background-color: #333333; color: #dddddd; }
.m-btn-dark:hover { background-color: #444444; color: #ffffff; }
.mourning-ribbon-tag {
  position: fixed; top: 0; right: 0; z-index: 99999; width: 90px; height: 90px; cursor: default; pointer-events: none;
}
.mourning-ribbon-tag img { width: 100%; height: 100%; object-fit: contain; }
@keyframes mourningFadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 480px) {
  .m-modal-content { padding: 16px; }
  .m-btn-group { grid-template-columns: 1fr; gap: 12px; }
  .m-btn { padding: 12px 16px; font-size: 14px; }
  .mourning-ribbon-tag { width: 65px; height: 65px; }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Sarabun', sans-serif; color: var(--text); background: var(--white); overflow-x: hidden; }

/* TOP BAR */
.topbar { background: var(--navy); color: rgba(255,255,255,0.75); font-size: 13px; padding: 6px 0; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.topbar a { color: rgba(255,255,255,0.75); text-decoration: none; margin-left: 16px; }
.topbar a:hover { color: var(--gold-light); }
.topbar-left { display: flex; align-items: center; gap: 6px; }

/* NAVBAR */
nav { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(0,0,0,0.07); }
.nav-inner { display: flex !important; justify-content: space-between !important; align-items: center !important; flex-wrap: nowrap !important; gap: 15px !important; width: 100% !important; padding: 12px 0; }
.logo-area { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; flex-shrink: 0; }
.logo-text h1 { font-family: 'Prompt', sans-serif; font-size: 17px; font-weight: 700; color: var(--navy); line-height: 1.2; margin: 0; }
.logo-text p { font-size: 11px; color: var(--gray); letter-spacing: 0.03em; text-transform: uppercase; margin: 0; }
.nav-links { display: flex !important; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links li a { text-decoration: none; color: var(--text); font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 6px; transition: all 0.2s; white-space: nowrap; }
.nav-links li a:hover { background: var(--light-bg); color: var(--navy); }
.nav-links li a.active { color: var(--navy); font-weight: 600; }

@media (max-width: 1200px) {
  .logo-text p { display: none !important; }
  .logo-text h1 { font-size: 15px !important; }
  .nav-links li a { font-size: 13px !important; padding: 6px 8px !important; }
}

/* HERO */
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 50%, #1565C0 100%); min-height: 520px; position: relative; display: flex; align-items: center; overflow: hidden; }
.hero-bg-pattern { position: absolute; inset: 0; background-image: radial-gradient(circle at 70% 50%, rgba(201,153,26,0.12) 0%, transparent 60%), repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 60px); }
.hero-content { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; padding: 60px 0; }
.hero-badge { display: inline-block; background: rgba(201,153,26,0.2); color: var(--gold-light); border: 1px solid rgba(201,153,26,0.4); font-size: 13px; font-weight: 500; padding: 5px 14px; border-radius: 20px; margin-bottom: 20px; letter-spacing: 0.04em; }
.hero-text h2 { font-family: 'Prompt', sans-serif; font-size: 44px; font-weight: 700; color: var(--white); line-height: 1.2; margin-bottom: 8px; }
.hero-text h2 span { color: var(--gold-light); }
.hero-text h3 { font-size: 22px; font-weight: 400; color: rgba(255,255,255,0.8); margin-bottom: 20px; }
.hero-text p { font-size: 16px; color: rgba(255,255,255,0.7); line-height: 1.8; margin-bottom: 32px; max-width: 480px; }
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }
.btn-primary { background: var(--gold); color: var(--navy); font-weight: 700; font-size: 15px; padding: 13px 30px; border-radius: 8px; text-decoration: none; transition: background 0.2s, transform 0.1s; display: inline-block; }
.btn-primary:hover { background: var(--gold-light); transform: translateY(-1px); }
.btn-outline-white { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,0.5); font-weight: 600; font-size: 15px; padding: 11px 28px; border-radius: 8px; text-decoration: none; transition: border-color 0.2s, background 0.2s; display: inline-block; }
.btn-outline-white:hover { border-color: var(--white); background: rgba(255,255,255,0.08); }
.hero-visual { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hero-stat-card { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); border-radius: 14px; padding: 22px 18px; backdrop-filter: blur(8px); text-align: center; }
.hero-stat-card:first-child { grid-column: 1 / -1; }
.hero-stat-card .num { font-family: 'Prompt', sans-serif; font-size: 36px; font-weight: 700; color: var(--gold-light); line-height: 1; margin-bottom: 6px; }
.hero-stat-card .label { font-size: 14px; color: rgba(255,255,255,0.75); }
.hero-stat-card.featured .num { font-size: 48px; }

/* QUICK LINKS */
.quick-links { background: var(--white); padding: 0; position: relative; z-index: 10; }
.quick-links-inner { background: var(--navy); border-radius: 0 0 16px 16px; display: grid; grid-template-columns: repeat(5, 1fr); overflow: hidden; }
.ql-item { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 22px 14px; color: rgba(255,255,255,0.8); text-decoration: none; font-size: 13px; font-weight: 500; gap: 10px; text-align: center; border-right: 1px solid rgba(255,255,255,0.08); transition: background 0.2s, color 0.2s; cursor: pointer; }
.ql-item:last-child { border-right: none; }
.ql-item:hover { background: rgba(255,255,255,0.08); color: var(--gold-light); }
.ql-icon { width: 44px; height: 44px; background: rgba(255,255,255,0.1); border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.ql-icon svg { width: 22px; height: 22px; fill: currentColor; }

/* SECTION */
.section { padding: 72px 0; }
.section-alt { background: var(--light-bg); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header .tag { display: inline-block; background: rgba(11,42,94,0.08); color: var(--navy); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 14px; border-radius: 20px; margin-bottom: 14px; }
.section-header h2 { font-family: 'Prompt', sans-serif; font-size: 34px; font-weight: 700; color: var(--navy); margin-bottom: 12px; }
.section-header p { font-size: 16px; color: var(--gray); max-width: 600px; margin: 0 auto; line-height: 1.7; }
.divider { width: 56px; height: 4px; background: var(--gold); border-radius: 2px; margin: 16px auto 0; }

/* ABOUT */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-image { border-radius: 16px; overflow: hidden; position: relative; height: 420px; background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px; color: white; }
.about-image-inner { text-align: center; padding: 32px; }
.about-badge-big { width: 100px; height: 100px; background: rgba(255,255,255,0.1); border: 3px solid var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.about-image h3 { font-family: 'Prompt', sans-serif; font-size: 22px; font-weight: 700; color: white; }
.about-image p { font-size: 14px; color: rgba(255,255,255,0.7); margin-top: 8px; }
.about-stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.mini-stat { background: rgba(255,255,255,0.1); border-radius: 10px; padding: 14px; text-align: center; }
.mini-stat .n { font-size: 22px; font-weight: 700; color: var(--gold-light); }
.mini-stat .l { font-size: 12px; color: rgba(255,255,255,0.7); }
.about-content h2 { font-family: 'Prompt', sans-serif; font-size: 32px; font-weight: 700; color: var(--navy); margin-bottom: 12px; line-height: 1.3; }
.about-content p { font-size: 15px; color: var(--gray); line-height: 1.9; margin-bottom: 16px; }
.about-points { list-style: none; margin: 24px 0; }
.about-points li { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; font-size: 15px; color: var(--text); }
.point-dot { width: 8px; height: 8px; background: var(--gold); border-radius: 50%; margin-top: 6px; flex-shrink: 0; }

/* SERVICES */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service-card { background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 28px; transition: all 0.2s; cursor: pointer; text-decoration: none; color: inherit; display: block; }
.service-card:hover { box-shadow: 0 8px 32px rgba(11,42,94,0.12); transform: translateY(-3px); border-color: rgba(11,42,94,0.15); }
.service-icon { width: 56px; height: 56px; background: rgba(11,42,94,0.08); border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.service-icon svg { width: 28px; height: 28px; }
.service-card h3 { font-family: 'Prompt', sans-serif; font-size: 17px; font-weight: 600; color: var(--navy); margin-bottom: 10px; }
.service-card p { font-size: 14px; color: var(--gray); line-height: 1.7; }
.service-card .learn-more { display: inline-flex; align-items: center; gap: 6px; color: var(--blue-mid); font-size: 14px; font-weight: 500; margin-top: 16px; }

/* EVENTS */
.events-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.event-card { background: var(--white); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; transition: all 0.2s; }
.event-card:hover { box-shadow: 0 8px 32px rgba(11,42,94,0.1); transform: translateY(-3px); }
.event-img { height: 180px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; color: white; position: relative; overflow: hidden; }
.event-img.bg1 { background: linear-gradient(135deg, #0B2A5E, #1565C0); }
.event-img.bg2 { background: linear-gradient(135deg, #1B4F2A, #2E7D32); }
.event-img.bg3 { background: linear-gradient(135deg, #7B1FA2, #9C27B0); }
.event-date-badge { position: absolute; top: 14px; left: 14px; background: var(--gold); color: var(--navy); border-radius: 8px; padding: 6px 12px; text-align: center; font-weight: 700; font-size: 13px; }
.event-date-badge .day { font-size: 22px; line-height: 1; display: block; font-family: 'Prompt', sans-serif; }
.event-body { padding: 20px; }
.event-tag { display: inline-block; background: rgba(11,42,94,0.08); color: var(--navy); font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 12px; margin-bottom: 10px; }
.btn-sm { background: var(--navy); color: white; font-size: 12px; font-weight: 500; padding: 6px 14px; border-radius: 6px; text-decoration: none; }

/* MEMBERSHIP */
.membership-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.membership-content .section-header { text-align: left; }
.membership-content .section-header .divider { margin-left: 0; }
.benefits-list { list-style: none; margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.benefit-item { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text); }
.benefit-check { width: 22px; height: 22px; background: rgba(11,42,94,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; color: var(--navy); }
.membership-cta { margin-top: 32px; display: flex; gap: 14px; }
.btn-navy { background: var(--navy); color: white; font-weight: 600; font-size: 15px; padding: 13px 28px; border-radius: 8px; text-decoration: none; transition: background 0.2s; display: inline-block; }
.btn-navy:hover { background: var(--navy-light); }
.btn-outline { background: transparent; color: var(--navy); border: 2px solid var(--navy); font-weight: 600; font-size: 15px; padding: 11px 26px; border-radius: 8px; text-decoration: none; transition: background 0.2s; display: inline-block; }
.btn-outline:hover { background: rgba(11,42,94,0.06); }
.membership-visual { background: linear-gradient(135deg, var(--navy) 0%, #1565C0 100%); border-radius: 20px; padding: 36px; color: white; }
.member-count { font-family: 'Prompt', sans-serif; font-size: 64px; font-weight: 700; color: var(--gold-light); line-height: 1; margin-bottom: 8px; }
.member-label { font-size: 16px; color: rgba(255,255,255,0.8); margin-bottom: 28px; }
.member-types { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mtype { background: rgba(255,255,255,0.1); border-radius: 12px; padding: 16px; text-align: center; }
.mtype .n { font-size: 26px; font-weight: 700; color: var(--gold-light); font-family: 'Prompt', sans-serif; }
.mtype .l { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 4px; }

/* NEWS */
.news-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; }
.news-list { display: flex; flex-direction: column; gap: 14px; }
.news-item { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; gap: 14px; transition: box-shadow 0.2s; }
.news-item:hover { box-shadow: 0 4px 16px rgba(11,42,94,0.08); }
.news-item-date { background: var(--navy); color: white; border-radius: 8px; padding: 8px 10px; text-align: center; flex-shrink: 0; font-family: 'Prompt', sans-serif; }
.news-item-date .day { font-size: 20px; font-weight: 700; line-height: 1; }
.news-item-date .month { font-size: 11px; opacity: 0.8; }
.news-item-body h4 { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; margin-bottom: 6px; }
.news-item-body p { font-size: 12px; color: var(--gray); line-height: 1.6; }

/* SPONSORS */
.sponsors { padding: 48px 0; background: var(--white); }
.sponsors-label { text-align: center; font-size: 13px; font-weight: 600; color: var(--gray); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 28px; }
.sponsors-row { display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap; }
.sponsor-logo { width: 180px; background: var(--light-bg); border: 1px solid var(--border); border-radius: 12px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.sponsor-logo:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: rgba(11,42,94,0.2); }

/* COMMITTEE */
.committee-grid-top { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; max-width: 650px; margin: 0 auto 30px auto; }
.committee-grid-members { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.committee-card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 20px 10px; text-align: center; transition: all 0.2s; }
.committee-card:hover { transform: translateY(-5px); box-shadow: 0 8px 24px rgba(11,42,94,0.1); }
.committee-img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; border: 3px solid var(--light-bg); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.committee-name { font-family: 'Prompt', sans-serif; font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 4px; line-height: 1.3; }
.committee-position { font-size: 12px; color: var(--gold); font-weight: 500; line-height: 1.2; }
.committee-grid-top .committee-card { padding: 30px 20px; }
.committee-grid-top .committee-img { width: 140px; height: 140px; margin-bottom: 16px; }
.committee-grid-top .committee-name { font-size: 18px; }
.committee-grid-top .committee-position { font-size: 14px; }
@media (max-width: 1100px) { .committee-grid-members { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px) {
  .committee-grid-top { grid-template-columns: 1fr; max-width: 350px; }
  .committee-grid-members { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 576px) { .committee-grid-members { grid-template-columns: repeat(2, 1fr); } }

/* CONTACT */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.contact-info h3 { font-family: 'Prompt', sans-serif; font-size: 24px; font-weight: 700; color: var(--navy); margin-bottom: 24px; }
.contact-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.contact-icon { width: 42px; height: 42px; background: rgba(11,42,94,0.08); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-icon svg { width: 20px; height: 20px; color: var(--navy); }
.contact-row h4 { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.contact-row p { font-size: 14px; color: var(--gray); line-height: 1.6; }
.contact-form { background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 32px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 7px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-family: 'Sarabun', sans-serif; font-size: 15px; color: var(--text); background: var(--light-bg); transition: border-color 0.2s; outline: none;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--navy); background: white; }
.form-group textarea { height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* FOOTER */
footer { background: var(--navy); color: rgba(255,255,255,0.8); }
.footer-top { padding: 56px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand h3 { font-family: 'Prompt', sans-serif; font-size: 18px; font-weight: 700; color: white; margin-bottom: 8px; }
.footer-brand p { font-size: 13px; line-height: 1.8; color: rgba(255,255,255,0.6); margin-bottom: 20px; }
.social-links { display: flex; gap: 10px; }
.social-btn { width: 36px; height: 36px; background: rgba(255,255,255,0.1); border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: background 0.2s; text-decoration: none; color: white; }
.social-btn:hover { background: var(--gold); color: var(--navy); }
.footer-col h4 { font-family: 'Prompt', sans-serif; font-size: 15px; font-weight: 600; color: white; margin-bottom: 18px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: rgba(255,255,255,0.65); text-decoration: none; font-size: 13px; transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--gold-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 20px 0; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: rgba(255,255,255,0.45); }

/* FLOATING SIDEBAR */
.float-sidebar { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 200; display: flex; flex-direction: column; gap: 2px; }
.fsb-btn { background: var(--navy); color: white; width: 64px; height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; font-size: 10px; font-weight: 500; gap: 4px; text-align: center; transition: all 0.2s; border-radius: 8px 0 0 8px; }
.fsb-btn:hover { background: var(--gold); color: var(--navy); width: 76px; }
.fsb-btn svg { width: 20px; height: 20px; }

/* MODAL AUTH */
.auth-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); z-index: 999999; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.auth-modal-overlay.active { opacity: 1; visibility: visible; }
.auth-modal-content { background: #fff; border-radius: 16px; width: 100%; max-width: 420px; margin: 0 20px; overflow: hidden; transform: scale(0.95); transition: all 0.3s ease; position: relative; box-shadow: 0 20px 50px rgba(0,0,0,0.3); }
.auth-modal-overlay.active .auth-modal-content { transform: scale(1); }
.auth-close-btn { position: absolute; top: 12px; right: 15px; background: none; border: none; font-size: 28px; color: rgba(255,255,255,0.7); cursor: pointer; z-index: 10; line-height: 1; }
.auth-close-btn:hover { color: #fff; }
.auth-header { background: var(--navy); text-align: center; padding: 30px 20px 20px; border-bottom: 4px solid var(--gold); }
.auth-header h2 { color: #fff; font-size: 20px; margin-bottom: 5px; font-family: 'Prompt', sans-serif; font-weight: 700; }
.auth-header p { color: var(--gold-light); font-size: 13px; font-family: 'Prompt', sans-serif; }
.auth-tabs { display: flex; background: var(--light-bg); border-bottom: 1px solid var(--border); }
.auth-tab { flex: 1; padding: 14px 0; border: none; background: none; font-family: 'Prompt', sans-serif; font-size: 14px; font-weight: 600; color: var(--gray); cursor: pointer; border-bottom: 2px solid transparent; }
.auth-tab.active { color: var(--navy); border-bottom-color: var(--navy); background: #fff; }
.auth-body { padding: 25px; }
.auth-form { display: none; }
.auth-form.active { display: block; animation: authFadeIn 0.3s; }
@keyframes authFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.auth-form .form-group { margin-bottom: 15px; text-align: left; }
.auth-form label { display: block; font-size: 13px; color: var(--text); font-weight: 600; margin-bottom: 6px; }
.auth-form input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: var(--light-bg); outline: none; box-sizing: border-box; }
.auth-form input:focus { border-color: var(--navy); background: #fff; }
.auth-btn { width: 100%; padding: 12px; border: none; border-radius: 8px; font-family: 'Prompt', sans-serif; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 10px; display: flex; justify-content: center; align-items: center; gap: 8px; }
.auth-btn-primary { background: var(--navy); color: #fff; }
.auth-btn-gold { background: var(--gold); color: var(--navy); }
.auth-alert { background: rgba(201,153,26,0.1); border: 1px solid rgba(201,153,26,0.3); border-radius: 8px; padding: 10px; text-align: center; font-size: 12px; color: #8A6D33; margin-bottom: 15px; font-weight: 600; }
.auth-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; }
.auth-footer a { color: var(--navy); font-weight: 600; text-decoration: none; }
.swal2-container { z-index: 9999999 !important; }

@media (max-width: 992px) {
  .events-grid, .news-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .events-grid, .news-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 10px; }
  .social-links { justify-content: center; }
  .hero-content { grid-template-columns: 1fr; }
  .quick-links-inner { grid-template-columns: 1fr; }
}

/* ============================================================
   📱 MOBILE RESPONSIVE OPTIMIZATION (หน้าจอน้อยกว่า 768px)
   ============================================================ */
@media (max-width: 768px) {
  
  /* 1. จัดการแถบลอยด้านขวา ไม่ให้บดบังเนื้อหาและฟอร์ม */
  .float-sidebar {
    display: none !important; /* ซ่อนบนมือถือเพื่อคืนพื้นที่หน้าจอ 100% */
  }

  /* 2. เมนูด้านบน: ให้ปัดเลื่อนซ้าย-ขวาได้ ไม่ตกบรรทัดซ้อนกัน */
  .nav-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 0;
  }
  .nav-links {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    width: 100%;
    padding: 8px 0 4px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* ซ่อน scrollbar */
  }
  .nav-links::-webkit-scrollbar {
    display: none;
  }
  .nav-links li {
    margin-right: 14px;
    flex-shrink: 0;
  }

  /* 3. ส่วนหัวเว็บ (Hero Section) และตัวเลขสถิติ */
  .hero-content {
    flex-direction: column;
    text-align: center;
    padding-top: 20px;
  }
  .hero-btns {
    justify-content: center;
    flex-direction: column;
    width: 100%;
  }
  .hero-btns a {
    width: 100%;
    margin-bottom: 8px;
    text-align: center;
  }
  .hero-visual {
    margin-top: 30px;
    width: 100%;
  }

  /* 4. Quick Links (ปุ่มทางลัด 5 ปุ่มใต้ Hero) */
  .quick-links-inner {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important; /* จัด 2 คอลัมน์ */
    gap: 10px !important;
  }
  .quick-links-inner .ql-item:last-child {
    grid-column: span 2; /* ปุ่มสุดท้ายให้เต็มความกว้าง */
  }

  /* 5. ส่วนสิทธิประโยชน์และสมาชิกภาพ (.membership-grid) */
  .membership-grid {
    grid-template-columns: 1fr !important; /* สลับเป็นแนวตั้ง */
    gap: 30px !important;
  }
  .membership-visual {
    order: 2; /* เอาตัวเลขสถิติลงไปอยู่ด้านล่าง */
  }
  .membership-content {
    order: 1;
  }

  /* 6. แถบตรารับรองมาตรฐานสากล (Google, TechSoup, Goodstack) */
  .trust-badge-item {
    width: 100%;
    justify-content: center;
  }

  /* 7. แบบฟอร์มติดต่อเรา (Contact Form) */
  .contact-grid {
    grid-template-columns: 1fr !important;
  }
  .form-row {
    flex-direction: column !important;
    gap: 0 !important;
  }
}


