/* ===== โครงหน้าเว็บรับสมัคร ===== */
body.site { background: #e9edf3; }
.shell { max-width: 1180px; margin: 0 auto; padding: 16px 16px 0; }

.banner {
  display: flex; align-items: center; gap: 20px; padding: 22px 26px; border-radius: 12px;
  color: #fff; position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 92% 20%, rgba(184,145,47,.35) 0, transparent 38%),
    linear-gradient(120deg, #0b2545 0%, #13315c 60%, #1d4677 100%);
  border-bottom: 5px solid var(--gold);
}
.banner::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 260px; height: 260px;
  border: 26px solid rgba(255,255,255,.06); border-radius: 50%;
}
.b-logos { display: flex; gap: 10px; flex-shrink: 0; position: relative; z-index: 1; }
.b-logos img { width: 84px; height: 84px; object-fit: contain; background: #fff; border-radius: 14px; padding: 6px; }
.b-logos.sm img { width: 52px; height: 52px; border-radius: 10px; padding: 4px; }
.b-text { position: relative; z-index: 1; }
.b-kicker { display: inline-block; background: var(--gold); color: #fff; font-weight: 700; font-size: 14px; padding: 2px 12px; border-radius: 99px; }
.banner h1 { margin: 6px 0 4px; font-size: 27px; line-height: 1.3; font-weight: 700; }
.b-sub { color: #d6deea; font-size: 14.5px; }

.menu-toggle { display: none; }
.layout { display: grid; grid-template-columns: 270px 1fr; gap: 18px; margin-top: 18px; align-items: start; }

/* sidebar */
.side { position: sticky; top: 12px; display: grid; gap: 12px; }
.nav { background: var(--navy); border-radius: 10px; padding: 6px; display: grid; gap: 4px; }
.nav a, .nav-h {
  display: block; color: #fff; text-decoration: none; padding: 11px 14px; border-radius: 7px;
  font-weight: 600; background: var(--navy-2);
}
.nav a:hover { background: #1d4677; }
.nav a.active { background: var(--gold); }
.nav-group { background: #fff; border-radius: 7px; overflow: hidden; }
.nav-group .nav-h { border-radius: 0; }
.nav-group a { background: #fff; color: var(--ink); font-weight: 500; border-radius: 0; border-top: 1px solid var(--line); }
.nav-group a:hover { background: var(--gold-soft); }
.nav-group a.active { background: var(--gold-soft); color: var(--navy); font-weight: 700; }
.nav a.nav-cta { background: #b3261e; }
.nav a.nav-cta:hover { background: #8f1d17; }
.nav a.nav-cta.active { background: var(--gold); }
.count-box { background: #f6d860; border: 4px solid var(--navy); border-radius: 10px; text-align: center; padding: 12px; font-weight: 700; color: var(--navy); font-size: 18px; }
.count-box b { display: block; font-size: 34px; line-height: 1.2; }
.count-box span { font-size: 16px; }
.status-box { text-align: center; font-weight: 700; padding: 10px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.status-box.on { color: var(--ok); border-color: #b9dfc8; background: #eef8f2; }
.status-box.off { color: var(--bad); border-color: #f3c1bd; background: #fdf0ef; }

/* content */
.content { min-width: 0; }
.content > section { background: #fff; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; margin-bottom: 18px; }
.page-h { background: var(--navy-2); color: #fff; font-size: 21px; font-weight: 700; padding: 14px 22px; border-bottom: 3px solid var(--gold); }
.page-b { padding: 20px 22px; }
.page-b h3 { margin: 20px 0 10px; font-size: 17px; color: var(--navy-2); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.page-b h3.sec { border: 0; padding: 0; }
.lead { font-size: 17px; margin: 0 0 14px; }
.prose ol { padding-left: 22px; } .prose li { margin-bottom: 6px; }
.note { background: var(--gold-soft); border-radius: 8px; padding: 10px 14px; font-size: 15px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpis div { background: var(--bg); border-radius: 10px; padding: 12px; border-left: 4px solid var(--gold); }
.kpis small { display: block; color: var(--muted); font-size: 13px; }
.kpis b { color: var(--navy); font-size: 17px; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 4px; justify-content: center; }
.btn.big { padding: 13px 28px; font-size: 17px; text-decoration: none; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.step { background: #f3f7fc; border: 1px solid #dbe5f1; border-radius: 12px; padding: 14px; display: grid; gap: 2px; }
.step .num { width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 21px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; border: 3px solid var(--gold); }
.step b { color: var(--navy); font-size: 16.5px; }
.step span { color: var(--muted); font-size: 14.5px; }

.cat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cat-card { border: 1px solid var(--line); border-top: 4px solid var(--gold); border-radius: 10px; padding: 14px; }
.cat-card b { font-size: 32px; color: var(--navy); } .cat-card span { color: var(--muted); margin-left: 4px; }
.cat-card p { margin: 4px 0 0; font-weight: 600; }

.tbl { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.tbl th { background: #f3f7fc; color: var(--navy); width: 26%; }
.tbl.benefit th { width: auto; background: var(--navy-2); color: #fff; }
.tbl.benefit td:last-child { text-align: center; font-weight: 700; color: var(--ok); white-space: nowrap; width: 18%; }
.docs { margin-top: 18px; background: #f6f7f9; border-radius: 10px; padding: 4px 20px 16px; }
.docs ol { padding-left: 22px; } .docs li { margin-bottom: 6px; }
.faq details { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.faq summary { font-weight: 700; color: var(--navy-2); cursor: pointer; }
.faq p { margin: 8px 0 0; }
.agree { margin-top: 18px; justify-content: center; text-align: left; max-width: 760px; margin-left: auto; margin-right: auto; }

.form-photo { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: start; }
.photo-pick { display: grid; gap: 8px; justify-items: center; text-align: center; }
.photo-prev { width: 120px; height: 160px; border: 2px dashed #9aa6b8; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; overflow: hidden; background: #fafbfc; }
.photo-prev img { width: 100%; height: 100%; object-fit: cover; }

.site-foot { display: flex; gap: 16px; align-items: center; background: var(--navy); color: #d6deea; border-radius: 10px 10px 0 0; padding: 18px 22px; font-size: 14.5px; margin-top: 4px; border-top: 4px solid var(--gold); }
.site-foot b { color: #fff; }

.doc-holder { display: flex; justify-content: center; padding: 0 0 18px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; display: none; }
  body.menu-open .side { display: grid; }
  .menu-toggle { display: block; width: 100%; margin-top: 12px; padding: 12px; border: 0; border-radius: 10px; background: var(--navy); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .steps, .cat-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .shell { padding: 8px 8px 0; }
  .banner { flex-direction: column; align-items: flex-start; padding: 16px; gap: 12px; }
  .b-logos img { width: 56px; height: 56px; border-radius: 10px; }
  .banner h1 { font-size: 20px; }
  .page-b { padding: 16px; }
  .steps, .cat-cards { grid-template-columns: 1fr; }
  .step { grid-template-columns: 46px 1fr; column-gap: 10px; }
  .step .num { grid-row: span 2; margin: 0; }
  .form-photo { grid-template-columns: 1fr; }
  .tbl th { width: 34%; }
  .site-foot { flex-direction: column; align-items: flex-start; }
}

.nb { display: inline-block; }

/* ===== เอกสาร A4 ===== */
.doc-tabs { display: flex; gap: 6px; justify-content: center; margin: 0 0 12px; flex-wrap: wrap; }
.doc-tabs button { appearance: none; border: 1px solid var(--navy); background: #fff; color: var(--navy); font: inherit; font-weight: 700; padding: 8px 18px; border-radius: 99px; cursor: pointer; }
.doc-tabs button.active { background: var(--navy); color: #fff; }
.hidden-doc { display: none; }
.doc-holder { flex-direction: column; align-items: center; }
.a4-wrap { position: relative; margin: 0 auto; }
.a4 {
  position: relative; width: 210mm; height: 297mm; background: #fff; color: #111; box-sizing: border-box;
  padding: 11mm 14mm 8mm; font-size: 14.6px; line-height: 1.62; transform-origin: top left;
  box-shadow: 0 2px 14px rgba(11,37,69,.18); display: flex; flex-direction: column; overflow: hidden;
}
.a4-head { display: flex; gap: 12px; align-items: flex-start; border-bottom: 2.5px solid var(--gold); padding-bottom: 8px; }
.a4-logos { display: flex; gap: 6px; flex-shrink: 0; }
.a4-logos img { width: 21mm; height: 21mm; object-fit: contain; }
.a4-title { flex: 1; min-width: 0; text-align: center; }
.a4-title .k { font-size: 21px; font-weight: 700; color: var(--navy); line-height: 1.35; }
.a4-title .k.big { font-size: 28px; letter-spacing: .5px; }
.a4-title .t { font-size: 15.5px; font-weight: 700; color: var(--navy-2); line-height: 1.4; }
.a4-title .s { font-size: 13.5px; color: #444; }
.a4-photo { width: 26mm; height: 34mm; border: 1px solid #888; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11px; color: #777; flex-shrink: 0; overflow: hidden; }
.a4-photo img, .card-photo img { width: 100%; height: 100%; object-fit: cover; }
.a4-meta { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 6px; }
.a4-no { border: 2px solid var(--navy); border-radius: 6px; padding: 2px 14px; display: flex; align-items: baseline; gap: 10px; }
.a4-no small { font-size: 12.5px; color: #555; } .a4-no b { font-size: 24px; letter-spacing: 2px; color: var(--navy); }
.a4-where { text-align: right; font-size: 13.5px; }
.a4 .ln { margin: 4px 0; text-align: left; }
.a4 .ln.ind { text-indent: 12mm; }
.a4 .fill { border-bottom: 1px dotted #555; padding: 0 4px; color: #0b3a8c; }
.a4-decl { border: 1px solid #999; border-radius: 4px; padding: 5px 12px; margin-top: 8px; font-size: 13.6px; line-height: 1.55; }
.a4-decl p { margin: 2px 0; }
.a4-sign { display: flex; justify-content: space-around; text-align: center; margin: 14px 0 8px; font-size: 14.2px; line-height: 1.75; }
.a4-staff { border: 1px dashed #888; border-radius: 4px; padding: 6px 12px; font-size: 13.5px; }
.a4-staff .row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 4px; }
.a4-note { margin-top: 8px; background: #f4ead2; border-radius: 4px; padding: 6px 12px; font-size: 13.5px; }
.a4-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 5px; display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: #666; line-height: 1.5; }
.a4 .stamp { z-index: 2; }

/* บัตรประจำตัวผู้เข้าสอบ */
.doc-card .card-main { display: flex; gap: 16px; margin-top: 14px; align-items: flex-start; border: 2.5px solid var(--navy); outline: 1px solid var(--gold); outline-offset: -7px; padding: 14px; border-radius: 4px; }
.card-photo { width: 40mm; height: 53mm; border: 1px solid #888; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12px; color: #777; flex-shrink: 0; overflow: hidden; }
.card-info { flex: 1; min-width: 0; }
.card-no { display: flex; align-items: baseline; gap: 10px; border-bottom: 2px solid var(--gold); padding-bottom: 4px; margin-bottom: 6px; }
.card-no small { font-size: 14px; color: #555; } .card-no b { font-size: 44px; letter-spacing: 4px; color: var(--navy); line-height: 1.15; }
.card-info table { border-collapse: collapse; width: 100%; font-size: 16.5px; line-height: 1.65; }
.card-info th { text-align: left; font-weight: 500; color: #555; width: 46mm; white-space: nowrap; padding: 1px 8px 1px 0; vertical-align: top; }
.card-info td.url { word-break: break-all; }
.card-left { display: grid; gap: 10px; justify-items: center; flex-shrink: 0; }
.card-qr { width: 30mm; height: 30mm; } .card-qr svg { width: 100%; height: 100%; }
.card-id { margin-top: 12px; text-align: center; background: var(--navy); color: #fff; padding: 7px 12px; border-radius: 4px; font-size: 15px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.card-rules { margin-top: 16px; font-size: 15.5px; line-height: 1.7; }
.card-rules ol { margin: 4px 0 0; padding-left: 22px; } .card-rules li { margin-bottom: 3px; }
.card-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.card-sign .box { border: 1px solid #999; border-radius: 4px; padding: 10px 14px; text-align: center; font-size: 14.5px; }
.card-sign .line { border-bottom: 1px dotted #444; height: 48px; margin: 4px 20px 4px; }
.card-sign .row { margin-top: 6px; }

@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  .banner, .menu-toggle, .side, .site-foot, .demo-bar, .content > section,
  .site-head, #app, #loginForm, #noAdmin, dialog { display: none !important; }
  .shell, main.wrap { max-width: none !important; padding: 0 !important; margin: 0 !important; }
  .layout { display: block !important; margin: 0 !important; }
  .print-area { display: block !important; }
  .doc-holder { display: block !important; padding: 0 !important; }
  .doc-tabs { display: none !important; }
  .a4-wrap, .a4-wrap.hidden-doc { display: block; width: 210mm !important; height: 297mm !important; margin: 0 !important; break-after: page; page-break-after: always; overflow: hidden; }
  .a4-wrap:last-child { break-after: auto; page-break-after: auto; }
  body[data-print="app"] .a4-wrap[data-kind="card"], body[data-print="card"] .a4-wrap[data-kind="app"] { display: none !important; }
  body[data-print="app"] .a4-wrap[data-kind="app"] { break-after: auto; page-break-after: auto; }
  .a4 { transform: none !important; box-shadow: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
