.feedback-breadcrumb {
  border-top: 1px solid #f1f1f1;
  background: #ffffff;
}

.feedback-breadcrumb__container {
  display: flex;
  width: min(
    calc(100% - 48px),
    var(--container-width, 1140px)
  );
  min-height: 58px;
  align-items: center;
  gap: 6px;
  margin-inline: auto;
  font-size: 12px;
  line-height: 1;
}

.feedback-breadcrumb__home,
.feedback-breadcrumb__separator {
  color: #777777;
  font-family: var(--font-brand);
  font-weight: 400;
  text-decoration: none;
}

.feedback-breadcrumb__separator {
  color: #404040;
}

.feedback-breadcrumb__home:hover,
.feedback-breadcrumb__home:focus-visible {
  color: #0098dc;
}

.feedback-breadcrumb__current {
  color: #0098dc;
  font-family: var(--font-brand-medium);
  font-weight: 400;
}

/* =========================================================
   Main form
   ========================================================= */

.customer-feedback {
  padding: 32px 0 88px;
  background: #ffffff;
}

.customer-feedback__container {
  width: min(calc(100% - 48px), 720px);
  margin-inline: auto;
}

.customer-feedback h1 {
  margin: 0;
  color: #0098dc;
  font-family: var(--font-brand);
  font-size: 36px;
  font-weight: 400;
  line-height: 1.1;
  text-align: center;
}

.customer-feedback-form {
  display: grid;
  gap: 38px;
  margin-top: 44px;

  /* ใช้ MuangthaicapModern-Regular ภายในฟอร์ม */
  font-family: var(--font-brand);
  font-weight: 400;
}

.customer-feedback-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.customer-feedback-form__field {
  display: grid;
  gap: 9px;
}

.customer-feedback-form__field > label,
.customer-feedback-form__rating > legend {
  margin: 0;
  padding: 0;
  color: #4c4946;
  font-family: var(--font-brand-medium);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
}

.customer-feedback-form__required {
  color: #e33131;
}

.customer-feedback-form input,
.customer-feedback-form select {
  box-sizing: border-box;
  width: 100%;
  height: 56px;
  min-height: 56px;
  padding: 0 22px;
  color: #4c4946;
  background: #ffffff;
  border: 1px solid #d4d6da;
  border-radius: 5px;
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  outline: none;
}

.customer-feedback-form input::placeholder {
  color: #8c8c8c;
  font-family: var(--font-brand);
  opacity: 1;
}

.customer-feedback-form input:focus,
.customer-feedback-form select:focus {
  border-color: #0098dc;
  box-shadow: 0 0 0 3px rgb(0 152 220 / 14%);
}

/* =========================================================
   Loan type multi-select
   ========================================================= */

.customer-feedback-form__loan-multiselect {
  position: relative;
  width: 100%;
}

.customer-feedback-form__loan-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  width: 100%;
  height: 56px;
  min-height: 56px;
  padding: 0 22px;
  color: #4c4946;
  background: #ffffff;
  border: 1px solid #d4d6da;
  border-radius: 5px;
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  outline: none;
}

.customer-feedback-form__loan-trigger:hover {
  border-color: #b8bcc2;
}

.customer-feedback-form__loan-trigger:focus-visible,
.customer-feedback-form__loan-multiselect.is-open
  .customer-feedback-form__loan-trigger {
  border-color: #0098dc;
  box-shadow: 0 0 0 3px rgb(0 152 220 / 14%);
}

.customer-feedback-form__loan-multiselect.is-open
  .customer-feedback-form__loan-trigger {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.customer-feedback-form__loan-summary {
  display: block;
  min-width: 0;
  padding-right: 24px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-feedback-form__loan-arrow {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-top: 6px solid #0098dc;
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
  transition: transform 180ms ease;
}

.customer-feedback-form__loan-multiselect.is-open
  .customer-feedback-form__loan-arrow {
  transform: rotate(180deg);
}

.customer-feedback-form__loan-options {
  position: absolute;
  z-index: 30;
  top: calc(100% - 1px);
  right: 0;
  left: 0;
  box-sizing: border-box;
  max-height: 264px;
  overflow-x: hidden;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #d4d6da;
  border-radius: 0 0 5px 5px;
  box-shadow: 0 8px 18px rgb(0 0 0 / 10%);
}

.customer-feedback-form__loan-options[hidden] {
  display: none;
}

.customer-feedback-form__loan-option {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 56px;
  padding: 10px 22px;
  color: #4c4946;
  background: #ffffff;
  border-bottom: 1px solid #e1e2e4;
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
  cursor: pointer;
}

.customer-feedback-form__loan-option:last-child {
  border-bottom: 0;
}

.customer-feedback-form__loan-option:hover {
  background: #f6fbfe;
}

.customer-feedback-form
  .customer-feedback-form__loan-checkbox {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 17px;
  height: 17px;
  min-height: 0;
  margin: 0 14px 0 0;
  padding: 0;
  border-radius: 3px;
  box-shadow: none;
  accent-color: #1685e5;
  cursor: pointer;
}

.customer-feedback-form__loan-option-text {
  min-width: 0;
}

/* =========================================================
   Rating
   ========================================================= */

.customer-feedback-form__rating {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
}

.customer-feedback-form__stars {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10.5px;
}

.customer-feedback-form__star {
  margin: 0;
  padding: 0;
  color: #bfbfbf;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
  transition:
    color 180ms ease,
    transform 180ms ease;
}

.customer-feedback-form__star.is-selected,
.customer-feedback-form__star:focus-visible {
  color: #fff03d;
}

/* ระหว่าง hover ให้พักการแสดงผลค่าที่เคยคลิกไว้ก่อน */
.customer-feedback-form__stars.is-previewing
.customer-feedback-form__star {
  color: #bfbfbf;
}

/* แสดงดาวตั้งแต่ดวงแรกจนถึงดวงที่กำลัง hover */
.customer-feedback-form__stars.is-previewing
.customer-feedback-form__star.is-preview {
  color: #fff03d;
}

.customer-feedback-form__star:hover {
  transform: translateY(-2px);
}

.customer-feedback-form__star:focus-visible {
  outline: 2px solid #0098dc;
  outline-offset: 4px;
}

.customer-feedback-form__textarea-wrapper {
  position: relative;
}

.customer-feedback-form textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 230px;
  padding: 16px 18px 38px;
  color: #4c4946;
  background: #ffffff;
  border: 1px solid #d4d6da;
  border-radius: 5px;
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  outline: none;
  resize: vertical;
}

.customer-feedback-form textarea::placeholder {
  color: #8c8c8c;
  opacity: 1;
}

.customer-feedback-form textarea:focus {
  border-color: #0098dc;
  box-shadow: 0 0 0 3px rgb(0 152 220 / 14%);
}

.customer-feedback-form__counter {
  position: absolute;
  right: 14px;
  bottom: 11px;
  color: #777777;
  font-family: var(--font-brand);
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
}

.customer-feedback-form__avatars {
  margin: 0;
  padding: 0;
  border: 0;
}

.customer-feedback-form__avatars > legend {
  margin: 0 0 12px;
  padding: 0;
  color: #4c4946;
  font-family: var(--font-brand-medium);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
}

.customer-feedback-form__avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px 24px;
}

.customer-feedback-form__avatar-option {
  position: relative;
  min-width: 0;
}

.customer-feedback-form__avatar-input {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.customer-feedback-form__avatar-label {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 50%;
  transition:
    border-color 180ms ease,
    transform 180ms ease;
}

.customer-feedback-form__avatar-label img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.customer-feedback-form__avatar-label:hover {
  transform: translateY(-2px);
}

.customer-feedback-form__avatar-check {
  position: absolute;
  right: -3px;
  bottom: 15px;
  display: none;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  color: #0098dc;
  background: #feef3d;
  border-radius: 50%;
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.customer-feedback-form__avatar-input:checked
+ .customer-feedback-form__avatar-label {
  border-color: #feef3d;
}

.customer-feedback-form__avatar-input:checked
+ .customer-feedback-form__avatar-label
.customer-feedback-form__avatar-check {
  display: flex;
}

.customer-feedback-form__avatar-input:focus-visible
+ .customer-feedback-form__avatar-label {
  outline: 2px solid #0098dc;
  outline-offset: 4px;
}

.customer-feedback-form__file-input {
  box-sizing: border-box;
  width: 100% !important;
  height: 52.8px !important;
  min-height: 52.8px !important;

  /*
   * เพิ่มพื้นที่รอบปุ่มเลือกไฟล์
   * จากเดิม 7px เป็น 11.4px
   */
  padding: 11.4px 10px !important;

  color: #4c4946;
  background: #ffffff;
  border: 1px solid #d4d6da;
  border-radius: 4px;
  font-family: var(--font-brand);
  font-size: 13.2px !important;
  line-height: 1;
  cursor: pointer;
}

.customer-feedback-form__file-input::file-selector-button {
  margin-right: 10px;
  padding: 5px 10px;
  color: #404040;
  background: #f4f4f4;
  border: 1px solid #a8a8a8;
  border-radius: 2px;
  font-family: var(--font-brand);
  font-size: 13.2px;
  line-height: 1;
  cursor: pointer;
}

.customer-feedback-form__file-help {
  margin: 1px 0 0;
  color: #4c4946;
  font-family: var(--font-brand);
  font-size: 13.2px;
  line-height: 1.4;
}

.customer-feedback-form__consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #4c4946;
  cursor: pointer;
}

.customer-feedback-form__consent-input {
  flex: 0 0 14px;
  width: 14px !important;
  height: 14px !important;
  min-height: 0 !important;
  margin: 2px 0 0;
  padding: 0 !important;
  accent-color: #0098dc;
  cursor: pointer;
}

.customer-feedback-form__consent-text {
  color: #4c4946;
  font-family: var(--font-brand);
  font-size: 13.2px;
  font-weight: 400;
  line-height: 1.45;
}

.customer-feedback-form__actions {
  display: flex;
  justify-content: center;
}

.customer-feedback-form__submit {
  width: min(100%, 308px);
  min-height: 42px;
  padding: 10px 24px;
  color: #0098dc;
  background: #feef3d;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-brand-medium);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.customer-feedback-form__submit:hover,
.customer-feedback-form__submit:focus-visible {
  color: #ffffff;
  background: #0098dc;
}

.customer-feedback-form__submit:focus-visible {
  outline: 2px solid #163f73;
  outline-offset: 4px;
}

.customer-feedback-form__honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.customer-feedback-form__notice {
  margin-top: 28px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: var(--font-brand);
  font-size: 13px;
  line-height: 1.45;
}

.customer-feedback-form__notice ul {
  margin: 0;
  padding-left: 20px;
}

.customer-feedback-form__notice--success {
  color: #176b38;
  background: #e9f8ef;
  border-color: #9ed5b0;
}

.customer-feedback-form__notice--error {
  color: #a12626;
  background: #fff0f0;
  border-color: #e6aaaa;
}

.customer-feedback-form__notice
+ .customer-feedback-form {
  margin-top: 24px;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 700px) {
  .feedback-breadcrumb__container,
  .customer-feedback__container {
    width: calc(100% - 32px);
  }

  .customer-feedback {
    padding-top: 28px;
  }

  .customer-feedback h1 {
    font-size: clamp(30px, 9vw, 36px);
  }

  .customer-feedback-form {
    gap: 30px;
    margin-top: 36px;
  }

  .customer-feedback-form__row {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .customer-feedback-form input,
  .customer-feedback-form select {
    padding-inline: 18px;
  }

  .customer-feedback-form__avatar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .customer-feedback-form__avatar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* =========================================================
   Submission success modal
   ========================================================= */

html.has-feedback-success-modal,
html.has-feedback-success-modal body {
  overflow: hidden;
}

.customer-feedback-success-modal {
  position: fixed;
  z-index: 10050;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgb(0 0 0 / 38%);
}

.customer-feedback-success-modal__dialog {
  display: flex;
  box-sizing: border-box;
  width: min(720px, 100%);
  max-height: calc(100dvh - 64px);
  align-items: center;
  flex-direction: column;
  overflow-y: auto;
  padding: 42px 56px 46px;
  color: #2f2f2f;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgb(0 0 0 / 24%);
  font-family: var(--font-brand);
  text-align: center;
}

.customer-feedback-success-modal__title {
  margin: 0;
  color: #2a2928;
  font-family: var(--font-brand);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.18;
}

.customer-feedback-success-modal__icon {
  display: block;
  width: 128px;
  height: 128px;
  flex: 0 0 auto;
  margin-top: 30px;
  color: #0098dc;
}

.customer-feedback-success-modal__message {
  max-width: 590px;
  margin: 32px 0 0;
  color: #5f5d5b;
  font-family: var(--font-brand);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.55;
}

.customer-feedback-success-modal__home {
  display: inline-flex;
  width: min(100%, 310px);
  min-height: 52px;
  align-items: center;
  justify-content: center;
  margin-top: 34px;
  padding: 12px 26px;
  color: #0098dc;
  background: #feef3d;
  border: 0;
  border-radius: 5px;
  font-family: var(--font-brand-medium);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.customer-feedback-success-modal__home:hover,
.customer-feedback-success-modal__home:focus-visible {
  color: #0098dc;
  background: #feef3d;
  outline: none;
}

.customer-feedback-success-modal__home:active {
  color: #ffffff;
  background: #0098dc;
  transform: translateY(1px);
}

@media (max-width: 900px) {
  .customer-feedback-success-modal {
    padding: 28px;
  }

  .customer-feedback-success-modal__dialog {
    width: min(620px, 100%);
    max-height: calc(100dvh - 56px);
    padding: 38px 42px 42px;
  }

  .customer-feedback-success-modal__title {
    font-size: 21.5px;
  }

  .customer-feedback-success-modal__icon {
    width: 116px;
    height: 116px;
    margin-top: 28px;
  }

  .customer-feedback-success-modal__message {
    margin-top: 28px;
    font-size: 18px;
  }
}

@media (max-width: 700px) {
  .customer-feedback-success-modal {
    padding: 18px;
  }

  .customer-feedback-success-modal__dialog {
    width: min(100%, 460px);
    max-height: calc(100dvh - 36px);
    padding: 32px 24px 30px;
    border-radius: 12px;
  }

  .customer-feedback-success-modal__title {
    font-size: 19px;
  }

  .customer-feedback-success-modal__icon {
    width: 104px;
    height: 104px;
    margin-top: 24px;
  }

  .customer-feedback-success-modal__message {
    margin-top: 24px;
    font-size: 16px;
    line-height: 1.6;
  }

  .customer-feedback-success-modal__home {
    width: 100%;
    min-height: 48px;
    margin-top: 28px;
    font-size: 17px;
  }
}

@media (max-width: 420px) {
  .customer-feedback-success-modal {
    padding: 14px;
  }

  .customer-feedback-success-modal__dialog {
    max-height: calc(100dvh - 28px);
    padding: 28px 18px 24px;
  }

  .customer-feedback-success-modal__title {
    font-size: 18px;
  }

  .customer-feedback-success-modal__icon {
    width: 92px;
    height: 92px;
    margin-top: 22px;
  }

  .customer-feedback-success-modal__message {
    margin-top: 22px;
    font-size: 15px;
  }

  .customer-feedback-success-modal__home {
    min-height: 46px;
    margin-top: 24px;
    font-size: 16px;
  }
}
