/* 獎狀生成系統（外層灰藍圓角大卡由 contact.css 的 .contentBox:after 提供） */
.certArea {
  --cert-blue: #7BC8FF;
  --cert-blue-line: #A8D9FF;
  --cert-card: #FAFBFC;
  --cert-text: #444444;
  --cert-sub: #777777;
  --cert-require: #ED8D85;
  font-family: "Noto Sans TC", sans-serif;
  color: var(--cert-text);
}

.certVerify {
  background: var(--cert-card);
  border: 1px solid var(--cert-blue-line);
  border-radius: 36px;
  padding: 40px 64px;
  text-align: center;
}
.certVerifyTitle {
  color: var(--cert-blue);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.5;
  margin: 0 0 10px;
}
.certVerifyNote {
  color: var(--cert-sub);
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 30px;
}
.certForm { text-align: left; }
.certLabelRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.certLabel {
  font-size: 22px;
  font-weight: 500;
  line-height: 30px;
}
.certRequire {
  color: var(--cert-require);
  font-size: 18px;
  margin-right: 6px;
}
.certHint {
  color: var(--cert-sub);
  font-size: 16px;
  line-height: 1.5;
}
.certInputRow {
  display: flex;
  align-items: center;
  gap: 12px;
}
.certArea .certForm input.certInput {
  flex: 1 1 auto;
  min-width: 0;
  height: 60px;
  padding: 14px 24px;
  background: var(--cert-card);
  border: 1px solid #E0E3E5;
  border-radius: 10px;
  color: var(--cert-text);
  font-size: 20px;
  font-weight: 500;
  font-family: inherit;
  box-sizing: border-box;
}
.certArea .certForm input.certInput::placeholder { color: #B5B9BC; }
.certArea .certForm input.certInput:focus {
  outline: none;
  border-color: var(--cert-blue);
  box-shadow: 0 0 0 3px rgba(123, 200, 255, 0.35);
}
/* 格式錯誤或查無資料 */
.certArea .certForm input.certInput[aria-invalid="true"] { border-color: #D9534F; }
.certArea .certForm input.certInput[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.25); }
.certMessage {
  min-height: 24px;
  margin: 12px 0 0;
  color: #D9534F;
  font-size: 16px;
  line-height: 1.5;
}

.certBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex: 0 0 auto;
  min-width: 280px;
  height: 76px;
  padding: 0 32px;
  background: var(--cert-blue);
  border: 1px solid var(--cert-blue);
  border-radius: 999px;
  color: #FFFFFF;
  font-size: 20px;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: 3px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color .2s, border-color .2s, color .2s;
}
.certBtn:hover { background: #5DB6F5; border-color: #5DB6F5; color: #FFFFFF; }
.certBtn:focus-visible { outline: 3px solid #1E6FB0; outline-offset: 3px; }
.certBtn:disabled { opacity: .6; cursor: not-allowed; }
.certBtn[hidden] { display: none; }
.certBtnLine {
  gap: 10px;
  background: var(--cert-card);
  border-color: var(--cert-blue-line);
  color: var(--cert-sub);
}
.certBtnLine:hover { background: #FFFFFF; border-color: var(--cert-blue); color: var(--cert-text); }
.certIcon { width: 24px; height: 24px; flex: 0 0 24px; }

.certResult { margin-top: 66px; }
.certResult[hidden] { display: none; }
.certSliderBox {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 46px;
}
.certSlider {
  flex: 0 1 560px;
  min-width: 0;
  max-width: 560px;
}
.certSlide img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1086 / 1536;
  background: #FFFFFF;
  box-shadow: 0 6px 24px rgba(6, 21, 45, 0.12);
}
.certArrow {
  flex: 0 0 48px;
  width: 48px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 1px solid #666666;
  border-radius: 24px;
  color: #666666;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.certArrow:hover { background: #666666; color: #FFFFFF; }
.certArrow:focus-visible { outline: 3px solid #1E6FB0; outline-offset: 3px; }
.certArrow[hidden] { display: none; }
.certThumbs {
  max-width: 300px;
  margin: 25px auto 0;
}
.certThumbs[hidden] { display: none; }
.certThumb { padding: 0 8px; cursor: pointer; }
.certThumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1086 / 1536;
  background: #FFFFFF;
  opacity: .55;
  transition: opacity .2s;
}
.certThumb.slick-current img { opacity: 1; outline: 2px solid var(--cert-blue); }

.certActions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  margin-top: 60px;
}
.certActionRow {
  display: flex;
  justify-content: center;
  gap: 20px;
  width: 100%;
}
.certActionRow .certBtn,
.certActions > .certBtn { width: 460px; max-width: 100%; }

/* loading 遮罩 */
.certLoading {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 21, 45, 0.55);
}
.certLoading.show { display: flex; }
.certLoadingBox {
  min-width: 240px;
  padding: 32px 40px;
  background: #FFFFFF;
  border-radius: 24px;
  text-align: center;
  font-family: "Noto Sans TC", sans-serif;
}
.certSpinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border: 5px solid #E0E3E5;
  border-top-color: #7BC8FF;
  border-radius: 50%;
  animation: certSpin 0.9s linear infinite;
}
.certLoadingText {
  margin: 0;
  color: #444444;
  font-size: 18px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
@keyframes certSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .certSpinner { animation-duration: 2.4s; }
}

@media (max-width: 1024px) {
  .certVerify { padding: 32px 28px; }
  .certSliderBox { gap: 16px; }
  .certActionRow { flex-direction: column; align-items: center; }
}
@media (max-width: 640px) {
  .certVerify { padding: 24px 16px; border-radius: 24px; }
  .certVerifyTitle { font-size: 26px; }
  .certLabel { font-size: 18px; }
  .certHint { font-size: 14px; }
  .certInputRow { flex-direction: column; align-items: stretch; }
  .certBtn { min-width: 0; width: 100%; height: 60px; font-size: 18px; gap: 16px; letter-spacing: 2px; padding: 0 20px; }
  .certResult { margin-top: 40px; }
  .certSliderBox { gap: 8px; }
  .certArrow { flex-basis: 40px; width: 40px; height: 42px; }
  .certActions { margin-top: 36px; gap: 16px; }
}

/* 表彰內容轉圖用的畫面外容器（寬度與字級對應獎狀座標 1086x1536） */
.certBodyHolder {
  position: absolute;
  left: -99999px;
  top: 0;
  pointer-events: none;
}
.certBodyHtml {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  background: transparent;
  color: #333333;
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 48px;
  font-weight: 400;
  line-height: 77px;
  /* 字距不為 0 時 html2canvas 才會逐字定位，編輯器設定的字距與對齊才會準確 */
  letter-spacing: 0.01px;
  text-align: center;
  word-break: break-all;
}
.certBodyHtml p,
.certBodyHtml div,
.certBodyHtml h1, .certBodyHtml h2, .certBodyHtml h3,
.certBodyHtml h4, .certBodyHtml h5, .certBodyHtml h6,
.certBodyHtml ul, .certBodyHtml ol, .certBodyHtml li {
  margin: 0;
  padding: 0;
}
.certBodyHtml img { max-width: 100%; height: auto; vertical-align: middle; }
.certBodyHtml table { border-collapse: collapse; width: 100%; }
