/* ===========================================================
   custom-style.css
   - Form Validation Error 樣式（jquery-validation 配對）
   - Submit Loader（送出中遮罩）
   - Success/Error Popup（送出成功/失敗彈窗）
   - Submit button loading 狀態
   =========================================================== */

/* ---------- Form Validation Error 訊息 ----------
   JS 設定為 errorElement: "span", errorClass: "error-message"
   原 HTML head 內 <style> 只針對 label.error，已不再使用。
*/
form#wf-form-Contact-Form span.error-message {
  display: block;
  width: auto;
  margin: 6px 0 14px;
  padding: 6px 12px;
  font-family: "Noto Sans TC", "Open Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: #fff;
  background-color: #d33b3b;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

/* input 本身（出錯時加上的紅框） */
form#wf-form-Contact-Form input.error,
form#wf-form-Contact-Form textarea.error,
form#wf-form-Contact-Form select.error {
  border: 1px solid #d33b3b !important;
  background-color: rgba(211, 59, 59, 0.06) !important;
  outline: none;
}

/* 隱藏的 checkbox（contact-time[] / contact-room[] / contact-privacy）
   本身設定 opacity:0、position:absolute，加 .error 不會影響視覺，
   故只針對 visible 的 input 顯示紅框，checkbox 群組由 .error-message 表達錯誤。 */


/* ---------- Submit Button: loading 狀態 ---------- */
.contact-from-submit-button.loading {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  filter: saturate(0.6);
}

/* ---------- Submit Loader Overlay ---------- */
.submit-loader-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 23, 49, 0.78);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.submit-loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 28px 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.submit-loader-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #f1cf00;
  animation: submit-loader-spin 0.9s linear infinite;
}

.submit-loader-text {
  font-family: "Noto Sans TC", "Open Sans", sans-serif;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

@keyframes submit-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Form Popup（共用 overlay） ---------- */
.popup-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  padding: 20px;
  box-sizing: border-box;
}

.popup-content {
  background: #fff;
  border-radius: 16px;
  padding: 40px 32px 32px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  position: relative;
  font-family: "Noto Sans TC", "Open Sans", sans-serif;
}

.popup-content h3 {
  margin: 12px 0 12px;
  font-size: 22px;
  font-weight: 700;
  color: #001731;
  line-height: 1.4;
}

.popup-content p {
  margin: 0 0 24px;
  font-size: 15px;
  color: #4a5763;
  line-height: 1.7;
}

/* ---------- Popup Icons ---------- */
.success-icon,
.error-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  margin: 0 auto;
}

.success-icon {
  background: #2ea66c;
  box-shadow: 0 6px 18px rgba(46, 166, 108, 0.35);
}

.error-icon {
  background: #d33b3b;
  box-shadow: 0 6px 18px rgba(211, 59, 59, 0.35);
}

/* ---------- Popup Close Button ---------- */
.popup-close {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  outline: none;
  cursor: pointer;
  background: #001731;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 12px 36px;
  border-radius: 999px;
  transition: background-color 0.2s ease, transform 0.15s ease;
  min-width: 140px;
}

.popup-close:hover {
  background: #01234b;
  transform: translateY(-1px);
}

.popup-close:active {
  transform: translateY(0);
}

.popup-error .popup-close {
  background: #d33b3b;
}

.popup-error .popup-close:hover {
  background: #b32f2f;
}

/* ---------- 行動裝置調整 ---------- */
@media (max-width: 480px) {
  .popup-content {
    padding: 32px 22px 24px;
    border-radius: 14px;
  }
  .popup-content h3 {
    font-size: 19px;
  }
  .popup-content p {
    font-size: 14px;
  }
  .success-icon,
  .error-icon {
    width: 60px;
    height: 60px;
    font-size: 32px;
  }
  .submit-loader-box {
    padding: 22px 28px;
  }
}
