/* ============================================================
   Pridi Banomyong Institute — Meeting Room Booking Form
   โทนสี: Classic Blue #0F4C81 | Off-white | Light Blue
   ============================================================ */

/* ─── Root Variables ─── */
:root {
  --pbi-blue:        #0F4C81;
  --pbi-blue-dark:   #0a3560;
  --pbi-blue-mid:    #1a6bb5;
  --pbi-blue-light:  #d6e8f7;
  --pbi-blue-pale:   #eef5fb;
  --pbi-offwhite:    #f7f5f0;
  --pbi-white:       #ffffff;
  --pbi-text:        #1a2533;
  --pbi-text-muted:  #4a5568;
  --pbi-border:      #b8d0e8;
  --pbi-border-dark: #7faed4;
  --pbi-radius:      8px;
  --pbi-radius-lg:   12px;
  --pbi-shadow:      0 1px 4px rgba(15, 76, 129, 0.08);
}

/* ─── Page Background ─── */
.main-wrapper {
  background: var(--pbi-offwhite);
  min-height: 100vh;
}

/* ─── Form Container ─── */
.webform-submission-meeting-room-booking-form {
  max-width: 680px;
  margin: 2.5rem auto;
  padding: 0 1rem 3rem;
  font-family: 'Sarabun', 'Noto Sans Thai', sans-serif;
  color: var(--pbi-text);
  line-height: 1.7;
}

/* ════════════════════════════════════════
   Page Wrapper Sections
   ════════════════════════════════════════ */
#edit-page1,
#edit-page2,
#edit-page3 {
  background: var(--pbi-white);
  border: 1px solid var(--pbi-border);
  border-radius: var(--pbi-radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--pbi-shadow);
  position: relative;
}

#edit-page1::before,
#edit-page2::before,
#edit-page3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--pbi-blue);
  border-radius: var(--pbi-radius-lg) 0 0 var(--pbi-radius-lg);
}

/* ════════════════════════════════════════
   Page 1 — วันและช่วงเวลา
   ════════════════════════════════════════ */

/* ─── Date field ─── */
.webform-submission-meeting-room-booking-form .js-webform-type-date > label,
.webform-submission-meeting-room-booking-form .js-form-item > label:not(.visually-hidden):not(.option) {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--pbi-text-muted);
  margin-bottom: 0.3rem;
}

.webform-submission-meeting-room-booking-form input.form-date {
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--pbi-border);
  border-radius: var(--pbi-radius);
  background: var(--pbi-white);
  color: var(--pbi-text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  appearance: none;
  -webkit-appearance: none;
}

.webform-submission-meeting-room-booking-form input.form-date:focus {
  outline: none;
  border-color: var(--pbi-blue);
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.12);
}

/* ─── Time slots fieldset ─── */
.webform-submission-meeting-room-booking-form fieldset.checkboxes--wrapper {
  border: 1.5px solid var(--pbi-blue-light);
  border-radius: var(--pbi-radius);
  padding: 1rem 1.25rem;
  margin: 1rem 0 0.5rem;
  background: var(--pbi-blue-pale);
}

.webform-submission-meeting-room-booking-form fieldset.checkboxes--wrapper legend {
  color: var(--pbi-blue);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0 0.5rem;
  letter-spacing: 0.02em;
}

/* Time slot grid layout */
#edit-time-hrs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem 1rem;
  margin-top: 0.5rem;
}

/* ─── Checkboxes ─── */
.webform-submission-meeting-room-booking-form .js-webform-type-checkbox.form-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.webform-submission-meeting-room-booking-form input.form-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 2px solid var(--pbi-border-dark);
  border-radius: 4px;
  background: var(--pbi-white);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}

.webform-submission-meeting-room-booking-form input.form-checkbox:checked {
  background: var(--pbi-blue);
  border-color: var(--pbi-blue);
}

.webform-submission-meeting-room-booking-form input.form-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.webform-submission-meeting-room-booking-form input.form-checkbox:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.15);
}

.webform-submission-meeting-room-booking-form label.option {
  font-size: 0.9rem;
  color: var(--pbi-text);
  cursor: pointer;
  line-height: 1.4;
}

/* ─── Field description ─── */
.webform-submission-meeting-room-booking-form .webform-element-description {
  font-size: 0.8rem;
  color: var(--pbi-blue-mid);
  margin-top: 0.6rem;
  font-style: italic;
}

/* ─── Calculated price display ─── */
.webform-submission-meeting-room-booking-form .js-webform-computed .form-type-item {
  background: var(--pbi-blue);
  border-radius: var(--pbi-radius);
  padding: 0.75rem 1.1rem;
  margin-top: 1rem;
  color:#fff;
}

.webform-submission-meeting-room-booking-form .js-webform-computed .form-type-item label {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85) !important;
  margin: 0;
  white-space: nowrap;
}

.webform-submission-meeting-room-booking-form .js-webform-computed .form-type-item label ~ * ,
.webform-submission-meeting-room-booking-form .js-webform-computed .form-type-item label + * {
  font-size: 1rem;
  font-weight: 700;
  color: var(--pbi-white) !important;
}

/* ════════════════════════════════════════
   Page 3 — สรุปค่าใช้จ่าย (Summary Table)
   ════════════════════════════════════════ */

/* wrapper ที่ Drupal render summary */
.webform-submission-meeting-room-booking-form .js-form-wrapper > table,
.webform-submission-meeting-room-booking-form [class*="summary"],
.webform-submission-meeting-room-booking-form [class*="total"],
.webform-submission-meeting-room-booking-form [class*="price-summary"] {
  width: 100%;
}

/* Override สีน้ำเงินเดิม — re-style เป็น card สะอาด */
.webform-submission-meeting-room-booking-form #edit-page3 > div[class*="markup"],
.webform-submission-meeting-room-booking-form #edit-page3 .js-webform-type-webform-markup {
  background: transparent !important;
}

/* Summary box — ดักทุก element ที่มีพื้นหลังสีน้ำเงินใน page3 */
#edit-page3 [style*="background"],
#edit-page3 table {
  background: transparent !important;
  color: var(--pbi-text) !important;
}

/* ════════════════════════════════════════
   Summary Card — สรุปค่าใช้จ่าย (Page 3)
   form-item-calculate-total
   ════════════════════════════════════════ */
.form-item-calculate-total {
  background: var(--pbi-white);
  border: 1px solid var(--pbi-border);
  border-radius: var(--pbi-radius-lg);
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
  box-shadow: var(--pbi-shadow);
}

.form-item-calculate-total > label {
  display: block;
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--pbi-blue) !important;
  margin-bottom: 0.5rem;
}

/* ─── วัน-เวลา ─── */
.booking-date-total {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--pbi-text);
  margin-bottom: 0.15rem;
}

.booking-time-total {
  font-size: 0.88rem;
  color: var(--pbi-text-muted);
  margin-bottom: 0.85rem;
}

/* ─── Summary Table ─── */
.form-item-calculate-total table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.form-item-calculate-total table td,
.form-item-calculate-total table th {
  padding: 0.6rem 0.85rem !important;
  border: 1px solid var(--pbi-border) !important;
  color: var(--pbi-text) !important;
  vertical-align: middle;
  line-height: 1.5;
}

/* แถวสลับสี */
.form-item-calculate-total table tbody tr:nth-child(odd) td {
  background: var(--pbi-blue-pale);
}

.form-item-calculate-total table tbody tr:nth-child(even) td {
  background: var(--pbi-white);
}

/* คอลัมน์ตัวเลขขวาสุด */
.form-item-calculate-total table td:last-child {
  text-align: right !important;
  font-weight: 700;
  color: var(--pbi-blue-dark) !important;
  white-space: nowrap;
}

/* คอลัมน์กลาง สูตรคำนวณ */
.form-item-calculate-total table td:nth-child(2) {
  text-align: right !important;
  color: var(--pbi-text-muted) !important;
}

/* แถว ยอดรวม */
.form-item-calculate-total table tr:last-child th {
  background: var(--pbi-blue) !important;
  color: var(--pbi-white) !important;
  font-weight: 700;
  border-color: var(--pbi-blue) !important;
  padding: 0.7rem 0.85rem !important;
}

.form-item-calculate-total table tr:last-child th:last-child {
  text-align: right !important;
  font-size: 1rem;
  white-space: nowrap;
}

/* ════════════════════════════════════════
   Page 2 — ตัวเลือกเพิ่มเติม
   ════════════════════════════════════════ */

/* ─── Facilities list ─── */
#edit-available-facilities p {
  color: var(--pbi-blue-dark) !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 0 0.5rem !important;
}

#edit-available-facilities ol {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  counter-reset: facility-counter;
}

#edit-available-facilities ol li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: var(--pbi-text);
  padding: 0.4rem 0.75rem;
  background: var(--pbi-blue-pale);
  border-radius: var(--pbi-radius);
  border-left: 3px solid var(--pbi-blue-light);
  counter-increment: facility-counter;
}

#edit-available-facilities ol li::before {
  content: counter(facility-counter);
  width: 20px;
  height: 20px;
  min-width: 20px;
  background: var(--pbi-blue);
  color: var(--pbi-white);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Select dropdown ─── */
.webform-submission-meeting-room-booking-form .js-webform-type-select > label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--pbi-text-muted);
  margin-bottom: 0.3rem;
}

.webform-submission-meeting-room-booking-form select.form-select {
  padding: 0.55rem 2rem 0.55rem 0.85rem;
  border: 1.5px solid var(--pbi-border);
  border-radius: var(--pbi-radius);
  background: var(--pbi-white);
  color: var(--pbi-text);
  font-size: 0.95rem;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230F4C81' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  min-width: 180px;
}

.webform-submission-meeting-room-booking-form select.form-select:focus {
  outline: none;
  border-color: var(--pbi-blue);
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.12);
}

/* field suffix "ชุด" */
.webform-submission-meeting-room-booking-form .field-suffix {
  font-size: 0.9rem;
  color: var(--pbi-text-muted);
  margin-left: 0.4rem;
}

/* ════════════════════════════════════════
   Page 3 — รายละเอียดผู้ติดต่อ
   ════════════════════════════════════════ */
.webform-submission-meeting-room-booking-form input.form-text,
.webform-submission-meeting-room-booking-form input.form-email,
.webform-submission-meeting-room-booking-form input.form-tel,
.webform-submission-meeting-room-booking-form textarea.form-textarea {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--pbi-border);
  border-radius: var(--pbi-radius);
  background: var(--pbi-white);
  color: var(--pbi-text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

.webform-submission-meeting-room-booking-form input.form-text:focus,
.webform-submission-meeting-room-booking-form input.form-email:focus,
.webform-submission-meeting-room-booking-form input.form-tel:focus,
.webform-submission-meeting-room-booking-form textarea.form-textarea:focus {
  outline: none;
  border-color: var(--pbi-blue);
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.12);
}

/* ════════════════════════════════════════
   Action Buttons
   ════════════════════════════════════════ */
.webform-submission-meeting-room-booking-form .form-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Next button */
.webform-submission-meeting-room-booking-form input.webform-button--next {
  background: var(--pbi-blue);
  color: var(--pbi-white);
  border: 2px solid var(--pbi-blue);
  border-radius: var(--pbi-radius);
  padding: 0.85rem 3rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.18s ease, transform 0.12s ease;
}

.webform-submission-meeting-room-booking-form input.webform-button--next:hover {
  background: var(--pbi-blue-dark);
  border-color: var(--pbi-blue-dark);
}

.webform-submission-meeting-room-booking-form input.webform-button--next:active {
  transform: scale(0.98);
}

/* Previous button */
.webform-submission-meeting-room-booking-form input.webform-button--previous {
  background: var(--pbi-white);
  color: var(--pbi-text-muted);
  border: 2px solid var(--pbi-border);
  border-radius: var(--pbi-radius);
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.webform-submission-meeting-room-booking-form input.webform-button--previous:hover {
  background: var(--pbi-offwhite);
  border-color: var(--pbi-border-dark);
}

.webform-submission-meeting-room-booking-form input.webform-button--previous:active {
  transform: scale(0.98);
}

/* Submit button (page 3) */
.webform-submission-meeting-room-booking-form input.webform-button--submit,
.webform-submission-meeting-room-booking-form input.button--primary {
  background: var(--pbi-blue);
  color: var(--pbi-white);
  border: 2px solid var(--pbi-blue);
  border-radius: var(--pbi-radius);
  padding: 0.85rem 3rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.18s ease, transform 0.12s ease;
}

.webform-submission-meeting-room-booking-form input.webform-button--submit:hover,
.webform-submission-meeting-room-booking-form input.button--primary:hover {
  background: var(--pbi-blue-dark);
  border-color: var(--pbi-blue-dark);
}

/* ─── Form item spacing ─── */
.webform-submission-meeting-room-booking-form .js-form-item {
  margin-bottom: 1rem;
}

.webform-submission-meeting-room-booking-form .js-form-item:last-child {
  margin-bottom: 0;
}

/* ─── Visually hidden ─── */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ════════════════════════════════════════
   Responsive
   ════════════════════════════════════════ */
@media (max-width: 600px) {
  .webform-submission-meeting-room-booking-form {
    margin: 1rem auto;
    padding: 0 0.5rem 2rem;
  }

  #edit-page1,
  #edit-page2,
  #edit-page3 {
    padding: 1.25rem 1rem;
  }

  #edit-time-hrs {
    grid-template-columns: repeat(2, 1fr);
  }

  .webform-submission-meeting-room-booking-form input.webform-button--next,
  .webform-submission-meeting-room-booking-form input.webform-button--previous,
  .webform-submission-meeting-room-booking-form input.webform-button--submit {
    width: 100%;
    padding: 0.85rem 1rem;
  }
}