/* ==========================================================================
   ธีมฝั่งผู้สมัครสอบ (student/*) — 19 พ.ย. 2569
   โลกเดียวกับหน้าแบบสอบถาม (pali_survey): หมึกกรมท่า #1F2A44 บนกระดาษขาว
   ฟอนต์ Noto Sans Thai Looped (เนื้อหา) + Mali (หัวเรื่อง/ตัวเลข)
   สี = ความหมาย  บาลี = หญ้าฝรั่น · นักธรรม = ใบไม้ · ข้อมูลของฉัน = ฟ้า · แบบสอบถาม = เชอร์รี
   ทุกกฎอยู่ใต้ body.stu เท่านั้น — ไม่กระทบหน้าเจ้าหน้าที่ (/app) ที่ใช้ Vuexy ชุดเดียวกัน
   ========================================================================== */

body.stu {
	--ink: #1F2A44;
	--ink-soft: #46516F;
	--ink-faint: #7C86A2;
	--line: #E4E8F1;
	--line-strong: #D5DAE6;
	--canvas: #F5F6FA;
	--card: #FFFFFF;

	--saffron: #FF9F1C;  --saffron-deep: #A95F00; --saffron-tint: #FFF3E0;
	--sky: #3BA7F5;      --sky-deep: #0B5F9E;     --sky-tint: #E8F4FE;
	--leaf: #2FBF71;     --leaf-deep: #137A43;    --leaf-tint: #E6F7EE;
	--cherry: #FF5A7A;   --cherry-deep: #B0213F;  --cherry-tint: #FFE9EE;
	--grape: #A78BFA;    --grape-deep: #5B3FC4;   --grape-tint: #F1ECFF;
	--sun: #FFC93C;

	--r-sm: 10px; --r: 16px; --r-lg: 22px; --r-xl: 28px;
	--sh-1: 0 1px 2px rgba(31, 42, 68, .05), 0 6px 18px -10px rgba(31, 42, 68, .18);
	--sh-2: 0 2px 4px rgba(31, 42, 68, .05), 0 18px 36px -18px rgba(31, 42, 68, .32);
	--ease: cubic-bezier(.16, 1, .3, 1);

	--font: "Noto Sans Thai Looped", "Sarabun", Tahoma, sans-serif;
	--font-display: "Mali", "Noto Sans Thai Looped", sans-serif;

	background: var(--canvas) !important;
	color: var(--ink);
	font-family: var(--font);
	font-size: 1.05rem;
	line-height: 1.6;
}
/* พื้นหลังมีวงสีจาง ๆ มุมบน ให้ไม่แบนจนน่าเบื่อ */
body.stu::before {
	content: ""; position: fixed; inset: 0 0 auto 0; height: 420px; z-index: -1; pointer-events: none;
	background:
		radial-gradient(520px 260px at 8% -40px, rgba(255, 159, 28, .16), transparent 70%),
		radial-gradient(480px 260px at 92% -60px, rgba(59, 167, 245, .14), transparent 70%);
}
body.stu .font-sarabun,
body.stu h1, body.stu h2, body.stu h3, body.stu h4, body.stu h5, body.stu h6,
body.stu .card-title, body.stu .btn, body.stu .form-control, body.stu .form-select,
body.stu .dropdown-menu, body.stu .modal, body.stu .badge, body.stu table,
body.stu .select2-container, body.stu .swal2-popup { font-family: var(--font) !important; }
body.stu h1, body.stu h2, body.stu h3, body.stu h4, body.stu h5, body.stu h6 { color: var(--ink); }
body.stu a { color: var(--sky-deep); }
body.stu .text-muted { color: var(--ink-faint) !important; }

/* ---------- โครงหน้า: ยกเลิกเมนูข้าง/ระยะของ Vuexy ---------- */
body.stu .app-content.stu-main {
	margin: 0 auto !important; padding: 1.25rem 1rem 7rem !important;
	max-width: 1180px; min-height: auto; background: transparent;
}
body.stu .content-overlay, body.stu .header-navbar-shadow,
body.stu .sidenav-overlay, body.stu .drag-target { display: none !important; }
body.stu .footer {
	margin: 0 auto !important; max-width: 1180px; background: transparent !important;
	box-shadow: none; padding: 0 1rem 7rem !important; color: var(--ink-faint); font-size: .82rem;
}
body.stu .footer a { color: var(--ink-soft); }
body.stu .scroll-top { display: none !important; }
@media (min-width: 992px) {
	body.stu .app-content.stu-main { padding: 1.75rem 1.5rem 3rem !important; }
	body.stu .footer { padding-bottom: 2rem !important; }
}

/* ---------- แถบบน ---------- */
.stu-top {
	position: sticky; top: 0; z-index: 1030;
	background: rgba(255, 255, 255, .86);
	backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
	border-bottom: 1px solid var(--line);
}
.stu-top-in {
	max-width: 1180px; margin: 0 auto; padding: .6rem 1rem;
	display: flex; align-items: center; gap: 1rem;
}
.stu-brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; flex-shrink: 0; }
.stu-brand img { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 2px 8px rgba(176, 33, 63, .25); }
.stu-brand span { display: flex; flex-direction: column; line-height: 1.15; }
.stu-brand b { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); font-weight: 700; }
.stu-brand small { font-size: .74rem; color: var(--ink-faint); }

.stu-nav { display: none; gap: .3rem; margin: 0 auto; }
@media (min-width: 992px) { .stu-nav { display: flex; } }
.stu-nav-link {
	display: inline-flex; align-items: center; gap: .5rem;
	padding: .5rem 1rem; border-radius: 999px; text-decoration: none;
	color: var(--ink-soft) !important; font-weight: 600; font-size: .98rem;
	transition: background .2s var(--ease), color .2s;
}
.stu-nav-link i { font-size: .95rem; opacity: .8; }
.stu-nav-link:hover { background: #EEF1F7; color: var(--ink) !important; }
.stu-nav-link.is-on { background: var(--ink); color: #fff !important; }
.stu-nav-link.is-on i { opacity: 1; }

.stu-user { margin-left: auto; }
@media (min-width: 992px) { .stu-user { margin-left: 0; } }
.stu-user-btn {
	display: flex; align-items: center; gap: .6rem; background: none; border: 0; padding: .2rem;
	border-radius: 999px; color: var(--ink);
}
.stu-user-btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.stu-user-name { font-weight: 600; font-size: .95rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stu-ava {
	position: relative; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
	display: grid; place-items: center; background: linear-gradient(135deg, var(--sun), var(--saffron));
	color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--line);
}
.stu-ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stu-user-menu { border-radius: var(--r) !important; border: 1px solid var(--line) !important; box-shadow: var(--sh-2) !important; padding: .4rem !important; min-width: 240px; }
.stu-user-head { padding: .6rem .8rem .5rem; display: flex; flex-direction: column; line-height: 1.35; }
.stu-user-head small { color: var(--ink-faint); }
.stu-user-menu .dropdown-item { border-radius: var(--r-sm); padding: .6rem .8rem; display: flex; gap: .6rem; align-items: center; font-weight: 500; }
.stu-user-menu .dropdown-item i { width: 18px; text-align: center; opacity: .75; }

/* ---------- แถบเมนูล่าง (มือถือ) ---------- */
.stu-tabbar {
	position: fixed; z-index: 1030; left: 0; right: 0; bottom: 0;
	display: grid; grid-template-columns: repeat(4, 1fr);
	background: rgba(255, 255, 255, .94);
	backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
	border-top: 1px solid var(--line);
	padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
}
@media (min-width: 992px) { .stu-tabbar { display: none; } }
.stu-tabbar a {
	display: flex; flex-direction: column; align-items: center; gap: .15rem;
	padding: .25rem .1rem; text-decoration: none; color: var(--ink-faint) !important;
	font-size: .76rem; font-weight: 600; min-height: 54px; justify-content: center;
}
.stu-tab-ic {
	width: 48px; height: 30px; border-radius: 999px; display: grid; place-items: center;
	font-size: 1.05rem; transition: background .25s var(--ease), color .25s;
}
.stu-tabbar a.is-on { color: var(--ink) !important; }
.stu-tabbar a.is-on .stu-tab-ic { background: var(--ink); color: #fff; }
.stu-tab-tx { white-space: nowrap; }

/* ---------- หัวหน้า ---------- */
.stu-pagehead { position: relative; margin: .25rem 0 1.25rem; }
.stu-pagehead h1 {
	font-family: var(--font-display) !important; font-weight: 700; font-size: 1.6rem;
	margin: 0; line-height: 1.35; color: var(--ink);
}
.stu-pagehead p { margin: .15rem 0 0; color: var(--ink-faint); font-size: .95rem; }
.stu-pagehead .top-loading { position: absolute; right: 0; top: .4rem; }
@media (min-width: 992px) { .stu-pagehead h1 { font-size: 1.9rem; } }

/* ---------- ชิ้นส่วน Bootstrap ให้นุ่มขึ้น ---------- */
body.stu .card {
	border: 1px solid var(--line) !important; border-radius: var(--r-lg) !important;
	box-shadow: var(--sh-1) !important; background: var(--card);
}
body.stu .card-header { background: transparent; border-bottom: 1px solid var(--line); padding: 1rem 1.25rem; }
body.stu .card-body { padding: 1.25rem; }
@media (min-width: 768px) { body.stu .card-body { padding: 1.5rem; } }
body.stu .card-title { font-weight: 700; color: var(--ink); }

body.stu .btn { border-radius: 999px; font-weight: 600; padding: .65rem 1.3rem; font-size: 1rem; letter-spacing: 0; transition: transform .15s var(--ease), box-shadow .2s, background .2s; }
body.stu .btn:active { transform: scale(.98); }
body.stu .btn-sm { padding: .4rem .9rem; font-size: .9rem; }
body.stu .btn-lg { padding: .85rem 1.6rem; font-size: 1.08rem; }
body.stu .btn-primary {
	background: var(--ink) !important; border-color: var(--ink) !important; color: #fff !important;
	box-shadow: 0 8px 18px -10px rgba(31, 42, 68, .7) !important;
}
body.stu .btn-primary:hover { background: #2C3A5C !important; box-shadow: 0 12px 22px -10px rgba(31, 42, 68, .75) !important; }
body.stu .btn-primary:disabled, body.stu .btn-primary.disabled { background: #AEB5C7 !important; border-color: #AEB5C7 !important; box-shadow: none !important; }
body.stu .btn-success { background: var(--leaf) !important; border-color: var(--leaf) !important; color: #fff !important; }
body.stu .btn-info { background: var(--sky) !important; border-color: var(--sky) !important; color: #fff !important; }
body.stu .btn-warning { background: var(--sun) !important; border-color: var(--sun) !important; color: var(--ink) !important; }
body.stu .btn-danger { background: var(--cherry-deep) !important; border-color: var(--cherry-deep) !important; }
body.stu .btn-outline-secondary { border-color: var(--line-strong) !important; color: var(--ink-soft) !important; background: #fff; }
body.stu .btn-outline-secondary:hover { background: #EEF1F7 !important; color: var(--ink) !important; }
body.stu .btn-outline-danger { border-color: #F3B7C3 !important; color: var(--cherry-deep) !important; background: #fff; }
body.stu .btn-outline-danger:hover { background: var(--cherry-tint) !important; }
body.stu .btn-outline-primary { border-color: var(--ink) !important; color: var(--ink) !important; }
body.stu .btn-outline-primary:hover { background: var(--ink) !important; color: #fff !important; }

body.stu .form-label, body.stu label { color: var(--ink-soft); font-weight: 600; font-size: .95rem; }
body.stu .form-control, body.stu .form-select,
body.stu .select2-container--default .select2-selection--single {
	border-radius: 12px !important; border: 1.5px solid var(--line-strong) !important;
	min-height: 48px; font-size: 1.02rem; color: var(--ink); background-color: #fff;
}
body.stu .form-control, body.stu .form-select { padding: .65rem .95rem; }
body.stu .form-control:focus, body.stu .form-select:focus,
body.stu .select2-container--focus .select2-selection--single,
body.stu .select2-container--open .select2-selection--single {
	border-color: var(--sky) !important; box-shadow: 0 0 0 4px rgba(59, 167, 245, .18) !important;
}
body.stu .form-control:disabled, body.stu .form-select:disabled, body.stu .form-control[readonly] { background-color: #F3F5F9 !important; color: var(--ink-soft); }
body.stu .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 45px !important; padding-left: .95rem; color: var(--ink); }
body.stu .select2-container--default .select2-selection--single .select2-selection__arrow { height: 45px !important; right: 8px; }
body.stu .select2-dropdown { border-radius: 12px !important; border-color: var(--line-strong) !important; overflow: hidden; box-shadow: var(--sh-2); }
body.stu .form-check-input { width: 1.25em; height: 1.25em; border: 1.5px solid var(--line-strong); }
body.stu .form-check-input:checked { background-color: var(--ink); border-color: var(--ink); }

body.stu .alert { border-radius: var(--r) !important; border: 1px solid transparent; box-shadow: none; padding: 1rem 1.15rem; }
body.stu .badge { border-radius: 999px; font-weight: 600; }
body.stu .modal-content { border-radius: var(--r-xl) !important; border: 0; box-shadow: 0 30px 60px -20px rgba(31, 42, 68, .45) !important; }
body.stu .modal-header { border-bottom: 1px solid var(--line); padding: 1.1rem 1.35rem; background: #fff; border-radius: var(--r-xl) var(--r-xl) 0 0; }
body.stu .modal-footer { border-top: 1px solid var(--line); }
body.stu .modal-backdrop.show { opacity: .45; background: #0E1528; }
/* มือถือ: เว้นท้าย modal ให้ปุ่มพ้นแถบเครื่องมือของ Safari ที่ลอยทับท้ายจอ — ชุดเดียวกับ app/css/staff-theme.css ส่วนที่ 4 */
@media (max-width: 575.98px) {
	body.stu .modal:not(.modal-slide-in) { --modal-gap-bottom: 140px; }
	body.stu .modal:not(.modal-slide-in) .modal-dialog:not([class*="modal-fullscreen"]) { margin-bottom: var(--modal-gap-bottom); }
	body.stu .modal:not(.modal-slide-in) .modal-dialog-centered:not([class*="modal-fullscreen"]) { min-height: calc(100% - .5rem - var(--modal-gap-bottom)); }
	body.stu .modal:not(.modal-slide-in) .modal-dialog-scrollable:not([class*="modal-fullscreen"]) { height: calc(100% - .5rem - var(--modal-gap-bottom)); }
}
body.stu .table > :not(caption) > * > * { padding: .8rem 1rem; border-color: var(--line); }
body.stu .table thead th { background: #F6F7FB; color: var(--ink-soft); font-weight: 700; text-transform: none; letter-spacing: 0; font-size: .9rem; }

/* SweetAlert ให้เข้าธีม */
body.stu .swal2-popup { border-radius: var(--r-xl) !important; padding: 1.5rem 1.25rem 1.35rem; }
body.stu .swal2-title { color: var(--ink) !important; font-family: var(--font-display) !important; font-weight: 700; }
body.stu .swal2-html-container { color: var(--ink-soft) !important; }
body.stu .swal2-styled { border-radius: 999px !important; font-weight: 600 !important; padding: .7rem 1.5rem !important; }
/* ไม่ใส่ !important — popup ที่ตั้ง confirmButtonColor เอง (เช่น ยืนยันยกเลิก = แดง) ต้องได้สีนั้น */
body.stu .swal2-styled.swal2-confirm { background: var(--ink); }

/* ---------- ชิ้นส่วนร่วมของธีม ---------- */
/* หัวข้อส่วน */
.stu-sec { display: flex; align-items: center; gap: .7rem; margin: 2rem 0 1rem; }
.stu-sec-ic {
	width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
	background: var(--t-tint, #EEF1F7); color: var(--t-deep, var(--ink)); font-size: 1rem;
}
.stu-sec h2 { margin: 0; font-family: var(--font-display) !important; font-size: 1.3rem; font-weight: 700; line-height: 1.35; }
.stu-sec small { display: block; color: var(--ink-faint); font-size: .85rem; font-family: var(--font); font-weight: 400; }
.stu-sec .stu-count { margin-left: auto; font-size: .8rem; font-weight: 600; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .2rem .7rem; white-space: nowrap; }

/* โทนสีตามความหมาย ใช้กับ data-tone="…" */
[data-tone="saffron"] { --t: var(--saffron); --t-deep: var(--saffron-deep); --t-tint: var(--saffron-tint); }
[data-tone="sky"]     { --t: var(--sky);     --t-deep: var(--sky-deep);     --t-tint: var(--sky-tint); }
[data-tone="leaf"]    { --t: var(--leaf);    --t-deep: var(--leaf-deep);    --t-tint: var(--leaf-tint); }
[data-tone="cherry"]  { --t: var(--cherry);  --t-deep: var(--cherry-deep);  --t-tint: var(--cherry-tint); }
[data-tone="grape"]   { --t: var(--grape);   --t-deep: var(--grape-deep);   --t-tint: var(--grape-tint); }
[data-tone="ink"]     { --t: var(--ink);     --t-deep: var(--ink);          --t-tint: #EEF1F7; }

/* ภาพเคลื่อนไหวตอนเปิดหน้า — ขึ้นทีละชิ้นนิดเดียว */
@media (prefers-reduced-motion: no-preference) {
	.stu-rise { animation: stuRise .6s var(--ease) both; }
	.stu-rise:nth-child(2) { animation-delay: .05s; }
	.stu-rise:nth-child(3) { animation-delay: .1s; }
	.stu-rise:nth-child(4) { animation-delay: .15s; }
	@keyframes stuRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}

/* ---------- ฟอร์มสมัครสอบ (editpali.php / editnugdham.php ใช้ร่วมกัน) ---------- */
/* แถบสถานะการสมัคร */
.reg-banner { display: flex; align-items: flex-start; gap: .9rem; border-radius: var(--r-lg); padding: 1rem 1.15rem; margin-bottom: 1rem; border: 1px solid; }
.reg-banner .rb-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; font-size: 1.2rem; background: #fff; }
.reg-banner .rb-body { flex: 1 1 auto; min-width: 0; line-height: 1.65; }
.reg-banner .rb-title { font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; display: block; margin-bottom: .15rem; }
.reg-banner .rb-sub { font-size: .94rem; }
.reg-banner a { font-weight: 600; }
.reg-done   { background: var(--leaf-tint);    border-color: #BDE9CF; }
.reg-done .rb-icon, .reg-done .rb-title { color: var(--leaf-deep); }
.reg-done .rb-sub { color: #33664A; }
.reg-open   { background: var(--saffron-tint); border-color: #FFD9A6; }
.reg-open .rb-icon, .reg-open .rb-title { color: var(--saffron-deep); }
.reg-open .rb-sub { color: #7A4A10; }
.reg-closed { background: var(--cherry-tint);  border-color: #F7C2CD; }
.reg-closed .rb-icon, .reg-closed .rb-title { color: var(--cherry-deep); }
.reg-closed .rb-sub { color: #7E3245; }
.status-chip { display: inline-flex; align-items: center; gap: .35rem; background: var(--leaf); color: #fff; font-weight: 700; font-size: .88rem; padding: .2rem .85rem; border-radius: 999px; }

/* ส่วนของฟอร์ม: ๑ ๒ ๓ */
body.stu .pali-card { border-radius: var(--r-xl) !important; }
.form-section { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.15rem 1.15rem 1.25rem; margin-bottom: 1rem; background: #fff; }
@media (min-width: 768px) { .form-section { padding: 1.35rem 1.5rem 1.5rem; } }
.form-section-alt { background: #FAFBFD; }
.form-section-head { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.form-section-head .bar { width: 10px; height: 26px; border-radius: 6px; background: linear-gradient(180deg, var(--t, var(--sky)), var(--grape)); flex-shrink: 0; }
.form-section-head h4 { margin: 0; font-family: var(--font-display) !important; font-size: 1.15rem; font-weight: 700; color: var(--ink); line-height: 1.4; }
.form-section-head small { color: var(--ink-faint); font-weight: 400; font-size: .85rem; font-family: var(--font); }
.form-section .sub-title { font-weight: 700; color: var(--ink); font-size: 1rem; margin: 0 0 .6rem; }
.form-section .sub-sep { border: 0; border-top: 1px dashed var(--line-strong); margin: 1.1rem 0; opacity: 1; }
body.stu .field-label { display: block; font-weight: 600; color: var(--ink-soft); font-size: .95rem; margin-bottom: .35rem; }
.field-hint { font-size: .85rem; color: var(--ink-faint); margin-top: .35rem; }
.field-row { display: grid; gap: 1rem; }
@media (min-width: 576px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field-row + .field-row { margin-top: 1rem; }
body.stu .btn-certi1, body.stu .btn-certi2 { margin-top: .6rem; padding: .45rem 1.1rem; font-size: .9rem; }
body.stu .btn-save-gold { background: var(--ink) !important; border: none !important; color: #fff !important; font-weight: 700; font-size: 1.08rem !important;
	padding: .9rem !important; border-radius: 999px !important; box-shadow: 0 14px 28px -14px rgba(31,42,68,.85); }
body.stu .btn-save-gold:hover { background: #2C3A5C !important; }
