/* .banner-img {
  filter: grayscale(100%);
} */

body {
  font-family: "Kanit", sans-serif;
  background: #fff;
  padding: 20px;
  max-width: 900px;
  margin: auto;
}

h2 {
  margin-bottom: 20px;
  color: #333;
}

form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-header img {
  border-radius: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group-sim {
  display: flex;
  flex-direction: row;
  gap: 20px;
  justify-content: center;
  align-items: center;
}

label {
  font-weight: 600;
  margin-bottom: 6px;
  color: #222;
}

.d-grid.grid-d-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

input,
select {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 16px;
  background-color: #f9f9f9;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

/* video */
.img-section {
  margin-top: 20px;
}

.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.img-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 10px;
}

.img-container img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.img-text {
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 16px;
}

.img-video {
  border-radius: 8px;
  width: 100%;
  height: auto;
}

label.section-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 16px;
  display: block;
}
/* End Video */

input:focus,
select:focus {
  outline: none;
  border-color: #ff1b44;
  background-color: #fff;
}

.required::after {
  content: " *";
  color: red;
}

.row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.col-half {
  flex: 1 1 45%;
  min-width: 250px;
}

.col-half-d {
  flex: 1 1 1 30%;
  min-width: 260px;
  width: 286px;
}

button {
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  background-color: #0d6efd;
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: #0568fbcc;
}

.sim-options {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 10px;
}

.sim-option input[type="radio"] {
  margin-top: 8px;
  width: 15px;
  height: 15px;
  /* ปุ่มไว้ซ้าย */
  position: absolute;
  left: 10px;
  top: 10px;
}

.sim-option {
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: 0.3s;
  width: 180px;
  text-align: center;
  background-color: #f8f8f8;
  padding: 10px;
  position: relative;
}

.sim-option img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-top: 10px;
  padding: 3px;
}

.sim-option span {
  font-weight: 600;
  color: #333;
}

.sim-option.selected {
  border-color: #ff1b44;
  box-shadow: 0 0 8px rgba(255, 27, 68, 0.5);
  background-color: #fff0f3;
}

/* ▼ ลูกศรของ select ปกติ */
select.form-control {
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23999' d='M6 8L0 0h12L6 8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* ------------------------- */
/* ✅ SELECT2 Custom Styling */
/* ------------------------- */

.select2-container {
  width: 100% !important;
}

/* fix select2 ให้ขนาดเหมือนกับ select ปกติ */
.select2-container--default .select2-selection--single {
  height: 48px !important;
  padding: 12px !important;
  border-radius: 10px !important;
  border: 1px solid #ddd !important;
  background-color: #f9f9f9 !important;
  font-size: 16px !important;
  display: flex !important;
  align-items: center;
  box-sizing: border-box;
}

.select2-selection__rendered {
  line-height: 1.2 !important;
  padding-left: 0 !important;
}

.select2-selection__arrow {
  height: 100% !important;
}

/* ให้ .select2 อยู่ในกรอบเหมือน .col-half-d */
.form-group .select2-container {
  width: 100% !important;
}

/* ป้องกัน select2 ถูกขยายหรือหดผิดขนาด */
.col-half-d .select2-container {
  width: 100% !important;
  min-width: 260px !important;
  max-width: 286px !important;
}

textarea {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 16px;
  background-color: #f9f9f9;
  transition: border-color 0.3s;
  resize: vertical;
  font-family: "Segoe UI", sans-serif;
}

textarea:focus {
  outline: none;
  border-color: #ff1b44;
  background-color: #fff;
}

/* consent */
.form-check-label {
  display: flex;
  align-items: center;
  margin-top: 1rem;
  font-weight: 500;
}

.form-check-input {
  margin-right: 10px;
  transform: scale(1.2);
}

/* Mobile responsive */
@media (max-width: 600px) {
  .d-grid.grid-d-3 {
    grid-template-columns: 1fr;
  }

  .form-header h2 {
    font-size: 20px;
    text-align: center;
  }

  .col-half,
  .col-half-d {
    flex: 1 1 100%;
    min-width: unset;
    width: 100%;
  }

  .sim-options {
    flex-direction: row;
  }

  .sim-option {
    width: 30%;
    max-width: 100px;
  }

  .sim-option input[type="radio"] {
    margin-top: 8px;
    width: 10px;
    height: 10px;
    /* ปุ่มไว้ซ้าย */
    position: absolute;
    left: 10px;
    top: 10px;
  }

  /* video */
  .img-video {
    width: 40%;
  }

  /* consent */
  .consent-box {
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 1.2rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
    max-width: 700px;
    margin: 0 auto;
  }

  .form-check-label {
    display: flex;
    align-items: center;
    margin-top: 1rem;
    font-weight: 500;
  }

  .form-check-input {
    margin-right: 10px;
    transform: scale(1.2);
  }

  /* sim_back */
  .form-group-sim {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    align-items: center;
  }
  .form-group-sim img {
    width: 50%;
    border-radius: 8px;
  }
}
