
/* =============================
   ฟอนต์และโครงสร้างพื้นฐาน
============================= */
.body {
  font-family: "Sarabun", Arial, sans-serif;
}

/* =============================
   Highlight & Validation
============================= */
/* --- Error Highlight --- */
.field-error-highlight {
  border-color: #dc3545 !important;
  border-width: 2px !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
  animation: shake 0.5s ease-in-out;
}
.field-error-highlight input[type="radio"],
.field-error-highlight input[type="checkbox"] { 
    border: 2px solid #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
    background-color: #fff !important;
}
.field-error-highlight .form-check {
    border: 2px solid #dc3545 !important;
    border-radius: 0.375rem;
    padding: 0.5rem;
    background-color: rgba(220, 53, 69, 0.05);
}
.field-error-highlight .form-check-label {
    color: #dc3545 !important;
    font-weight: 600;
}
input[type="radio"].field-error-highlight {
    accent-color: #dc3545 !important;
    border: 2px solid #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}
input[type="checkbox"].field-error-highlight {
    accent-color: #dc3545 !important;
    border: 2px solid #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* --- Validation สีเขียว/แดง --- */
.form-check.is-valid {
    /* เอา border ออก */
    border: none !important;
    border-radius: 0.375rem;
    padding: 0.5rem;
    background-color: transparent;
}
.form-check.is-valid .form-check-label {
    color: #198754 !important;
    font-weight: 600;
}
input[type="radio"].is-valid,
input[type="checkbox"].is-valid {
    accent-color: #198754 !important;
    /* เอา border และ box-shadow ออก */
    border: none !important;
    box-shadow: none !important;
}
.form-check.is-invalid {
    /* เอา border ออก */
    border: none !important;
    border-radius: 0.375rem;
    padding: 0.5rem;
    background-color: transparent;
}
.form-check.is-invalid .form-check-label {
    color: #dc3545 !important;
    font-weight: 600;
}
input[type="radio"].is-invalid,
input[type="checkbox"].is-invalid {
    accent-color: #dc3545 !important;
    /* เอา border และ box-shadow ออก */
    border: none !important;
    box-shadow: none !important;
}

/* --- Shake animation --- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* =============================
   SweetAlert2 Custom Styles
============================= */
.swal-wide {
  max-width: 90vw !important;
  width: 90% !important;
}
.swal-title {
  font-size: 1.2rem !important;
  font-weight: bold !important;
}
.swal-content {
  font-size: 1rem !important;
  line-height: 1.4 !important;
}
@media (max-width: 768px) {
  .swal-wide { max-width: 95vw !important; width: 95% !important; }
  .swal-title { font-size: 1.1rem !important; }
  .swal-content { font-size: 0.9rem !important; }
}
@media (max-width: 576px) {
  .swal-wide { max-width: 98vw !important; width: 98% !important; }
  .swal-title { font-size: 1rem !important; }
  .swal-content { font-size: 0.85rem !important; }
}

/* =============================
   Header & Section Header
============================= */
  /* ===== Header Container ===== */
  .pd {
    background: linear-gradient(135deg, #007bff, #0056b3);
    padding: 20px 0;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: fadeInDown 0.6s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px; /* ระยะห่างระหว่างไอคอนและข้อความ */  
  }

  /* ===== Title Text ===== */
  .pd h3 {
    /* font-family: "Poppins", sans-serif; */
    font-family: "Sarabun", Arial, sans-serif;
    font-size: 28px;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  }

  /* ===== เพิ่มเส้นขีดใต้แบบ Glow Effect ===== */
  .pd::after {
    content: "";
    width: 120px;
    height: 4px;
    background: white;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    box-shadow: 0px 0px 8px rgba(255, 255, 255, 0.6);
  }

  /* ===== Animation Effect ===== */
  @keyframes fadeInDown {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }


  

/* ===ปิด head CSS (ชื่อหัวข้อใหญ่) === */




/* styles.css */
body {
  background-color: rgba(225, 225, 225, 0.518);
  font-family: "Sarabun", Arial, sans-serif;
  font-size: 15px;
  color: #000033;
}

.form-session {
  margin-bottom: 20px;
}

.form-session .invalid-feedback {
  display: none; /* Default state is hidden */
}

.form-session .is-valid {
  border-color: #198754; /* Bootstrap success color */
  background-color: #d4edda; /* Light green background */
}

.form-session .is-invalid {
  border-color: #dc3545; /* Bootstrap danger color */
  background-color: #f8d7da; /* Light red background */
}

.form-session .invalid-feedback.d-block {
  display: block; /* Show feedback when invalid */
}

.navbar-custom {
  /* background-color: DodgerBlue;*/
  background: linear-gradient(to right, #1e90ff, #87cefa);
  color: white; /* สีข้อความ */
  box-shadow: 0 3px 5px rgba(0, 0, 51, 0.8);
  padding-bottom: 3px;
}
blockquote {
  margin-bottom: 0.5rem;
}
.data {
  text-align: justify;
  text-indent: 50px;
  font-size: 15px;
  margin-left: 10px;
  margin-right: 10px;
}

.holder {
  height: 150px;
  width: 130px;
  border: 1px solid #4682b4;
  border-radius: 5px;
  text-align: center;
  margin-top: -3px;
  box-shadow: 0px -3px 6px 2px rgba(0, 0, 0, 0.2);
}
.img_preview {
  max-width: 128px;
  max-height: 147.5px;
  min-width: 128px;
  min-height: 147.5px;
  border-radius: 5px;
  text-align: center;
}
input[type="file"] {
  margin-top: 5px;
  display: none;
}

.custom-file-upload {
  border: 1px solid #0066ff;
  display: inline-block;
  padding: 5px 10px;
  cursor: pointer;
  background-color: DodgerBlue;
  border-radius: 4px;
  font-size: 14px;
  width: 120px;
  text-align: center;
}
.inline {
  display: inline; /* the default for span */
  width: 100px;
  height: 100px;
  padding: 5px;
}
.button_e:hover {
  background-color: #0066cc;
}
.data {
  text-align: justify;
  text-indent: 30px;
  font-size: 14px;
  margin-left: 5px;
  margin-right: 5px;
}

/* Header and body   */

.section-header {
  background-color: #0380d3 !important;
  color: #fff;
  padding: 12px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 10px 10px 0 0;
}

.job_header {
  background: linear-gradient(to right, #1e90ff, #87cefa);
  border-radius: 5px 5px 0 0;
  font-size: 15px;
  font-weight: bold;
  /*padding: 10px;*/
  padding-top: 10px;
  box-shadow: 0 5px 5px rgba(0, 0, 0, 0.35);
  color: #000033;
  height: 38px;
}
.job_headers {
  background: linear-gradient(to right, #1e90ff, #87cefa);
  border-radius: 5px 5px 0 0;
  font-size: 15px;
  font-weight: bold;
  padding: 10px;
  box-shadow: 0 5px 5px rgba(0, 0, 0, 0.35);
  color: #000033;
  height: auto;
}
.job_headers_dt {
  background: linear-gradient(to right, #1e90ff, #87cefa);
  border-radius: 5px 5px 0 0;
  font-size: 16px;
  font-weight: bold;
  padding: 10px;
  box-shadow: 0 5px 5px rgba(0, 0, 0, 0.35);
  color: #000033;
  height: auto;
  text-align: center;
}
.span_header {
  margin-bottom: 5px;
}
.section-body {
  background-color: #f8f8ff;
  padding: 15px;
  box-shadow: 0 5px 5px rgba(0, 0, 0, 0.35);
  border-radius: 0 0 5px 5px;
}

.form-group {
  margin-bottom: 7px;
}

.section-divider {
  border-top: 1px dashed #8c8b8b;
}

.button-group {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.button-group .btn {
  margin-left: 7px;
}

.required {
  color: red;
}

.invalid-feedback {
  color: red;
  font-size: 0.875em;
}

input,
select,
option,
textarea {
  font-size: 14px;
  color: #000033;
  opacity: 0.8;
}
.font_option {
  font-size: 14px;
  color: #000033;
  opacity: 0.8;
}

input[type="text"],
input[type="date"] {
  font-size: 14px;
  color: #000033;
  opacity: 0.8;
}
.font_bt {
  font-size: 14.5px;
}
.font_h {
  font-size: 16px;
}

.margin_bt {
  margin-bottom: 5px;
  position: relative;
}

.form-control::placeholder {
  /* Chrome, Firefox, Opera, Safari 10.1+ */
  color: #000033;
  opacity: 0.8; /* Firefox */
}


/* Glyph, by Harry Roberts */

hr.style-eight {
  overflow: visible; /* For IE */
  padding: 0;
  border: none;
  border-top: medium double #000033;
  /* color: #000033;*/
  text-align: center;
  margin-bottom: -8px;
}
hr.style-eight:after {
  content: "ประวัติส่วนตัว";
  display: inline-block;
  position: relative;
  top: -1em;
  font-size: 15px;
  padding: 0 0.25em;
  background: white;
  color: #000033;
}
hr.style-one {
  border-top: 1px dashed #000033;
  opacity: 0.2;
}
.bt_attact {
  margin-top: -7px;
}



/*อัพโหลดรูปถ่าย*/
/* .imagePreview {
  width: 150px;
  height: 160px;
  background-position: center center;
  background: url(../../images/avatar.png);
  background-color: #fff;
  background-size: cover;
  background-repeat: no-repeat;
  display: inline-block;
  border-radius: 5px 5px 0px 0px;
  box-shadow: 0px -3px 6px 2px rgba(0, 0, 0, 0.2);
} */

#previewImg {
  width: 150px;
  height: 160px;
  display: none;
  border-radius: 5px 5px 0px 0px;
}
#img_upload {
  width: 0px;
  height: 0px;
  overflow: hidden;
}
.btn-primary-pic {
  width: 150px;
  display: block;
  border-radius: 0px 0px 5px 5px;
  box-shadow: 0px 4px 6px 2px rgba(0, 0, 0, 0.2);
  margin-top: -5px;
  font-size: 14px;
}

/* ซ่อนหน้ากรอกเพิ่มเติม  */
.hidden {
  display: none;
}

/* แต่งปุ่ม  */
.btn-blue-theme {
  background-color: #007bff; /* Bootstrap Primary Blue */
  border: none;
  color: white;
  font-weight: bold;
  padding: 5px 10px;
  font-size: 10px;
  border-radius: 8px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.btn-blue-theme:hover {
  background-color: #0056b3; /* Darker shade of blue */
  box-shadow: 0px 4px 15px rgba(0, 123, 255, 0.4);
}

.btn-blue-theme:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
}

/*pdpa style*/
.pdpa_style {
  border: none;
  /*background-color: none; */
  background-color: #f8f8ff;
  color: #0066cc;
  text-decoration: underline;
}
.pdpa_style:hover {
  color: #033a70;
  border: none;
  background-color: none;
  text-decoration: underline;
}


.button_view {
  background-color: #0066cc;
  border: none;
  font-size: 12.5px;
  color: white;
  text-align: center;
  display: inline-block;
  border-radius: 3px;
  margin-left: 0px;
  height: 23px;
  width: 68px;
}
.button_edit {
  background-color: #d2691e;
  border: none;
  font-size: 12.5px;
  color: white;
  text-align: center;
  display: inline-block;
  border-radius: 3px;
  margin-left: 0px;
  height: 23px;
  width: 60px;
}
.button_h:hover {
  background-color: #0047b3;
}
.button_e:hover {
  background-color: #a0522d;
}



/* ปรับแต่งเพิ่มเติมให้ดูหรูหราและทันสมัยยิ่งขึ้น */

/* พื้นหลังส่วนฟอร์มให้ดูเรียบหรูขึ้น */
.section-body {
  background-color: #ffffff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
}

/* ปรับแต่ง Section header ให้ดูทันสมัย */
.section-header {
  background-color: #0380d3 !important;
  color: #fff;
  padding: 12px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 10px 10px 0 0;
}

/* ปรับแต่ง Input และ Select */
.form-control,
.form-select {
  border-radius: 6px;
  border: 1px solid #bcdcff;
  transition: all 0.3s ease;
  box-shadow: none;
}

.form-control:focus,
.form-select:focus {
  border-color: #0380d3;
  box-shadow: 0 0 8px rgba(41, 128, 185, 0.4);
}

/* ปรับแต่ง Label */
.form-label {
  color: #34495e;
  font-weight: 600;
}

/* ปรับแต่ง placeholder */
.form-control::placeholder {
  color: #a6a6a6;
}

/* ปรับแต่ง Button ทั่วไป */
.btn-primary,
.btn-primary-pic,
.btn-primary-file {
  background: linear-gradient(120deg, #0380d3, #0380d3);
  border: none;
  font-weight: bold;
  border-radius: 8px;
  box-shadow: 0 3px 6px rgba(30, 144, 255, 0.3);
  transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-primary-pic:hover,
.btn-primary-file:hover {
  box-shadow: 0 4px 12px rgba(30, 144, 255, 0.5);
  transform: translateY(-2px);
}

/* ปรับแต่งภาพที่อัพโหลดให้มีเงาชัดขึ้น */
.imagePreview,
#previewImg {
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* ปรับแต่งเส้นคั่น */
hr.style-eight:after {
  background: #ffffff;
  font-weight: 600;
  color: #2980b9;
}

/* Responsive ปรับขนาดบนมือถือ */
@media (max-width: 768px) {
  .section-body {
    padding: 15px;
  }

  .section-header {
    font-size: 16px;
    padding: 10px;
  }

  .form-control,
  .form-select {
    font-size: 13px;
  }
}

/* responsive ปรับขนาดกรอบรูปถ่าย ของ tablet */

@media (max-width: 1024px) {
  /* ใช้เฉพาะกับช่องอัปโหลดรูปเท่านั้น */
  .upload-photo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%; /* ให้เต็มพื้นที่ */
  }

  /* ปรับขนาดของกล่องอัปโหลดรูป */
  .upload-photo-section .imgUp {
    width: 150px;
    margin-bottom: 20px; /* เพิ่มระยะห่างจากฟอร์ม */
  }

  /* ปรับขนาดของรูปตัวอย่าง */
  .upload-photo-section .imagePreview,
  .upload-photo-section #previewImg {
    width: 150px;
    height: 170px;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.15);
  }

  /* ปรับปุ่มอัปโหลดให้เหมาะสม */
  .upload-photo-section .btn-primary-pic {
    width: 150px;
    border-radius: 6px;
    font-size: 14px;
  }

  /* ป้องกันการชนกันของกล่องรูปและช่อง Input */
  .upload-photo-section .form-session {
    margin-top: 10px;
  }
}


@media screen and (min-device-width: 820px) and (max-device-width: 1180px) and (orientation: landscape) {
  
  /* STEP indicator: make it wrap & center */
  .step {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 20px auto;
  }

  .step-item {
    min-width: 100px;
    margin-bottom: 10px;
  }

  /* Section body: reduce width, center content */
  .section-body {
    padding: 20px;
    max-width: 100%;
    margin: auto;
  }

  /* Form fields: avoid horizontal crowding */
  .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  /* Image upload section: center & resize if needed */
  .upload-photo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .upload-photo-section .imgUp {
    width: 150px;
    margin-bottom: 10px;
  }

  .upload-photo-section .imagePreview,
  .upload-photo-section #previewImg {
    width: 150px;
    height: 170px;
  }

  .upload-photo-section .btn-primary-pic {
    width: 150px;
    font-size: 14px;
  }

  /* Optional: tweak input width if too stretched */
  input[type="text"],
  input[type="date"],
  select {
    max-width: 100%;
  }

}

/* Performance Optimized Single Page Form Styles */

/* Smooth scrolling for better UX */
html {
    scroll-behavior: smooth;
}

/* Optimized form layout for single page */
.form-session {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.form-session:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Section headers with better visual hierarchy - REBUILD */
.section-header {
  background-color: #0380d3 !important;
  color: #fff;
  padding: 1rem 1.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  border-radius: 10px 10px 0 0;
  margin-bottom: 0.5rem;
  box-shadow: 0 4px 12px rgba(30, 144, 255, 0.10);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  letter-spacing: 0.5px;
}
.section-header i {
  font-size: 1.3rem;
  color: #b3e0ff;
}

/* ปุ่มอัพโหลดไฟล์ - ใช้ตัวแปร CSS โทนน้ำเงินล้วน ไม่มี gradient ไม่มีม่วง */
.btn-primary-file {
  background-color: var(--primary-blue) !important;
  color: #fff !important;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  padding: 1rem 2.2rem;
  font-size: 1.08rem;
  box-shadow: 0 2px 10px rgba(0, 86, 179, 0.10);
  transition: background 0.18s, box-shadow 0.18s, transform 0.13s;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  outline: none;
  position: relative;
  overflow: hidden;
}
.btn-primary-file i {
  color: #e3f2fd;
  font-size: 1.25rem;
  transition: color 0.18s;
}
.btn-primary-file:hover, .btn-primary-file:focus {
  background-color: #003d82 !important;
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(0, 86, 179, 0.18);
  transform: translateY(-2px) scale(1.04);
}
.btn-primary-file:active {
  background-color: #001f4d !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(0, 86, 179, 0.10);
  transform: scale(0.98);
}

/* Progress indicator for form completion */
.form-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #f0f0f0;
    z-index: 1000;
}

.form-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
    width: 0%;
}

/* Optimized form controls */
.form-control, .form-select {
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.75rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

/* File upload styling */
.btn-primary-file {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary-file:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Submit button optimization */
#session_end {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

#session_end:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

#session_end:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading animation */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress modal styling */
.progress {
    height: 8px;
    border-radius: 4px;
    background: #f0f0f0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

/* Form validation styling */
.is-valid {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Responsive design improvements */
@media (max-width: 768px) {
    .form-session {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .section-header {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    #session_end {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* Performance optimizations */
.form-control, .form-select, .btn {
    will-change: transform;
}

/* Reduce layout shifts */
.form-control, .form-select {
    min-height: 44px; /* Better touch targets */
}

/* Optimize for mobile performance */
@media (max-width: 576px) {
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .row {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }
    
    .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-6, .col-md-12 {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

/* Accessibility improvements */
.form-control:focus, .form-select:focus, .btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-control, .form-select {
        border-width: 3px;
    }
    
    .btn {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .form-control, .form-select, .btn, .progress-bar {
        transition: none;
    }
    
    .form-session:hover {
        transform: none;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
}

/* Print styles */
@media print {
    .form-session {
        border: 1px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .btn {
        display: none;
    }
}

/* ยกเลิก border/padding/background-color ของ container radio/checkbox */
.field-error-highlight .form-check,
.form-check.is-invalid,
.form-check.is-valid {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* ยืนยันว่า input radio/checkbox สามารถกดได้ */
input[type="radio"], input[type="checkbox"] {
    pointer-events: auto !important;
    position: static !important;
    z-index: 1 !important;
}

/* สำหรับ label ของ radio/checkbox ให้สีตามสถานะ */
.form-check-input.is-valid ~ .form-check-label {
    color: #198754 !important;
    font-weight: 600;
}
.form-check-input.is-invalid ~ .form-check-label {
    color: #dc3545 !important;
    font-weight: 600;
}

/* ซ่อน/โชว์ invalid-feedback ตาม Bootstrap */
.invalid-feedback {
    display: none;
}
input.is-invalid ~ .invalid-feedback,
select.is-invalid ~ .invalid-feedback,
textarea.is-invalid ~ .invalid-feedback,
.form-check-input.is-invalid ~ .invalid-feedback {
    display: block;
}

/* --- RADIO/CHECKBOX VALIDATION --- */
input[type="radio"].is-valid,
input[type="checkbox"].is-valid {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    accent-color: #198754 !important;
}
input[type="radio"].is-invalid,
input[type="checkbox"].is-invalid {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    accent-color: #dc3545 !important;
}

/* --- Minimal Camera Icon + Text for Empty Preview --- */
.imagePreview {
  position: relative;
  width: 160px;
  height: 200px;
  border-radius: 12px;
  background: #f7fbff;
  box-shadow: 0 2px 12px rgba(0,123,255,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 1.2rem;
  border: 2px dashed #90caf9;
  color: #b0b8c1;
  font-size: 2.2rem;
  transition: border-color 0.2s, background 0.2s;
  gap: 0.3rem;
  cursor: pointer;
}
.imagePreview .camera-icon {
  font-size: 3.2rem;
  color: #90caf9;
  margin-bottom: 0.2rem;
  opacity: 0.85;
}
.imagePreview .upload-main-text {
  font-size: 1.08rem;
  color: #2196f3;
  font-weight: 600;
  margin-bottom: 0.1rem;
  text-align: center;
  letter-spacing: 0.2px;
}
.imagePreview .upload-sub-text {
  font-size: 0.98rem;
  color: #b0b8c1;
  font-weight: 400;
  text-align: center;
  margin-bottom: 0;
}
.imagePreview .no-image-text { display: none; }
.imagePreview:hover {
  border-color: #2196f3;
  background: #e3f2fd;
}
.imagePreview.has-image .camera-icon,
.imagePreview.has-image .upload-main-text,
.imagePreview.has-image .upload-sub-text {
  display: none;
}
.imagePreview.has-image #previewImg {
  display: block;
}
#previewImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: none;
  position: absolute;
  left: 0; top: 0;
  z-index: 2;
}

/* ปุ่มอัปโหลดและข้อความเงื่อนไข */
.btn-primary-pic {
  width: 100%;
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
}
.upload-photo-hint {
  color: #8a99b3;
  font-size: 0.98rem;
  margin-top: 0.2rem;
  text-align: center;
}
.imagePreview .upload-hint-text {
  word-break: break-word;
  white-space: normal;
  padding-left: 8px;
  padding-right: 8px;
  font-size: 0.98rem;
  line-height: 1.3;
  display: block;
  text-align: center;
}
@media (max-width: 1024px) {
  .imagePreview .upload-hint-text { font-size: 0.92rem; padding-left: 4px; padding-right: 4px; }
}
@media (max-width: 768px) {
  .imagePreview .upload-hint-text { font-size: 0.85rem; padding-left: 2px; padding-right: 2px; }
}
@media (max-width: 480px) {
  .imagePreview .upload-hint-text { font-size: 0.7rem; padding-left: 1px; padding-right: 1px; }
}

/* Responsive spacing for all devices */
@media (max-width: 1200px) {
  .imagePreview { width: 140px; height: 175px; }
  .imgUp { width: 150px; }
}
@media (max-width: 1024px) {
  .imagePreview { width: 120px; height: 150px; }
  .imgUp { width: 120px; }
  .btn-primary-pic { font-size: 0.97rem; padding: 0.6rem 0; margin-top: 0.8rem; }
  .imagePreview .camera-icon { font-size: 2.2rem; }
  .imagePreview .upload-main-text { font-size: 0.98rem; padding: 0 4px; }
  .imagePreview .upload-sub-text { font-size: 0.85rem; padding: 0 4px; }
}
@media (max-width: 768px) {
  .imagePreview { width: 100px; height: 125px; }
  .imgUp { width: 100px; }
  .btn-primary-pic { font-size: 0.95rem; padding: 0.5rem 0; margin-top: 0.7rem; }
  .imagePreview .camera-icon { font-size: 1.5rem; }
  .imagePreview .upload-main-text { font-size: 0.85rem; padding: 0 2px; }
  .imagePreview .upload-sub-text { font-size: 0.7rem; padding: 0 2px; }
}
@media (max-width: 480px) {
  .imagePreview { width: 80px; height: 100px; }
  .imgUp { width: 80px; }
  .btn-primary-pic { font-size: 0.92rem; padding: 0.4rem 0; margin-top: 0.5rem; }
  .imagePreview .camera-icon { font-size: 1.1rem; }
  .imagePreview .upload-main-text { font-size: 0.7rem; padding: 0 1px; }
  .imagePreview .upload-sub-text { font-size: 0.6rem; padding: 0 1px; }
}
.imagePreview { cursor: pointer; }
.imagePreview:hover, .imagePreview:focus { border-color: #1976d2; background: #e3f2fd; }
@media (max-width: 768px) { .btn-primary-pic { display: none; } }

/* ปรับ .row.form-row-5 ให้ gap สมดุลทุกอุปกรณ์ */
.row.form-row-5 { gap: 18px; }
@media (max-width: 1024px) { .row.form-row-5 { gap: 12px; } }
@media (max-width: 768px) { .row.form-row-5 { gap: 8px; } }
@media (max-width: 480px) { .row.form-row-5 { gap: 5px; } }

@media (min-width: 1025px) {
  .btn-primary-pic {
    min-width: 100px;
    max-width: 150px;
    width: auto;
    display: inline-flex;
    justify-content: center;
    padding-left: 1rem;
    padding-right: 1rem;
    font-size: 1rem;
  }
}

/* === 2-Column Layout for Photo+Form (Desktop) === */
.form-row-5 {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}
.form-col-photo {
  width: 200px;
  min-width: 160px;
  max-width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.imgUp {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.form-col-5 {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
@media (max-width: 1024px) {
  .form-row-5 { flex-direction: column; gap: 12px; }
  .form-col-photo, .form-col-5 { width: 100%; max-width: 100%; }
  .form-col-5 { flex-direction: column; gap: 10px; }
}
@media (max-width: 768px) {
  .form-row-5 { gap: 8px; }
  .form-col-5 { gap: 6px; }
}
@media (max-width: 480px) {
  .form-row-5 { gap: 5px; }
  .form-col-5 { gap: 4px; }
}

.imagePreview {
  height: 220px;
  padding-top: 16px;
  padding-bottom: 12px;
}
.imagePreview .upload-hint-text {
  line-height: 1.5;
  min-height: 2.5em;
}

/* === Enhanced Section Header Design === */
.section-header {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.15);
    position: relative;
    overflow: hidden;
}

.section-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.header-content i {
    color: #ffffff;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
    border-radius: 50%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.header-content span {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.header-content .file-requirements {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    font-weight: 400;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

/* Responsive Design for Header */
@media (max-width: 576px) {
    .section-header {
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .header-content i {
        font-size: 1rem;
        padding: 0.4rem;
    }
    
    .header-content span {
        font-size: 1rem;
    }
    
    .header-content .file-requirements {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
        align-self: flex-start;
    }
}

@media (max-width: 768px) {
    .section-header {
        padding: 0.875rem 1.25rem;
        margin-bottom: 1.25rem;
    }
    
    .header-content {
        gap: 0.625rem;
    }
    
    .header-content i {
        font-size: 1.1rem;
        padding: 0.45rem;
    }
    
    .header-content span {
        font-size: 1.05rem;
    }
    
    .header-content .file-requirements {
        font-size: 0.725rem;
        padding: 0.225rem 0.45rem;
    }
}

@media (min-width: 769px) {
    .section-header {
        padding: 1rem 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .header-content {
        gap: 0.75rem;
    }
    
    .header-content i {
        font-size: 1.2rem;
        padding: 0.5rem;
    }
    
    .header-content span {
        font-size: 1.1rem;
    }
    
    .header-content .file-requirements {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Hover effects */
.section-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.2);
    transition: all 0.3s ease;
}

.section-header:hover .header-content i {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* Focus states for accessibility */
.section-header:focus-within {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .section-header {
        background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
        box-shadow: 0 4px 12px rgba(25, 118, 210, 0.25);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .section-header {
        border: 2px solid #ffffff;
    }
    
    .header-content .file-requirements {
        background: rgba(255, 255, 255, 0.3);
        border: 1px solid #ffffff;
    }
}

/* === Optimized Upload Section Design === */

.form-radio-responsive {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  align-items: center;
}

.form-radio-responsive .form-check {
  min-width: 120px;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

@media (max-width: 576px) {
  .form-radio-responsive {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
  .form-radio-responsive .form-check {
    min-width: 0;
    width: 100%;
  }
}
