/* 台拓 — 聯絡我們 ｜ 業務洽詢（線上表單頁）
   命名前綴：cbi-（contact business inquiry）
   依賴：about-history.css 提供 .ah-inner-header 與 _Breadcrumb 樣式
   本檔負責：Hero（含閃電浮水印）、表單區兩欄（左深色資訊欄＋右白色表單卡）、
            輸入框 / 條件式欄位 / 送出 / 成功狀態、響應式。
   來源：handoff 業務洽詢頁面專屬 <style>；token 由 styles.css 改為本檔自帶
        cbi- 變數；品牌紅維持 #E0121A 與全站一致。
*/

:root {
  --cbi-red: #E0121A;
  --cbi-red-dark: #B30E14;
  --cbi-red-soft: #FEE2E4;
  --cbi-ink: #0E0F11;
  --cbi-ink-2: #1A1B1F;
  --cbi-paper-2: #FAFAFB;
  --cbi-white: #FFFFFF;
  --cbi-muted: #6B7280;
  --cbi-muted-2: #9CA3AF;
  --cbi-border: #E5E7EB;
  --cbi-yellow: #FCD34D;
  --cbi-radius-lg: 22px;
  --cbi-shadow-card: 0 1px 2px rgba(15,17,21,.04), 0 8px 24px rgba(15,17,21,.06);
}

/* ============ 共用容器 ============ */
.cbi-container {
  width: min(1280px, calc(100% - 80px));
  margin-inline: auto;
}

/* ============ 共用：眉標（eyebrow）+ 黃色閃電 ============ */
.cbi-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; color: var(--cbi-red);
  letter-spacing: .04em;
  font-family: 'Noto Sans TC', sans-serif;
  margin-bottom: 22px;
}
.cbi-eyebrow .cbi-bolt {
  width: 14px; height: 14px;
  background: #FACC15;
  clip-path: polygon(40% 0, 100% 0, 60% 45%, 100% 45%, 0 100%, 40% 55%, 0 55%);
}

/* ============ Hero ============ */
.cbi-hero {
  position: relative;
  padding: 72px 0 220px;
  background:
    radial-gradient(ellipse 760px 520px at 12% 30%, #F4EFEC 0%, transparent 60%),
    linear-gradient(180deg, #F7F5F2 0%, #FBFAF8 100%);
  overflow: hidden;
}
.cbi-hero .cbi-bolt-watermark {
  position: absolute;
  right: -40px; top: 40px;
  width: 320px; height: 320px;
  color: var(--cbi-red);
  opacity: .05;
  transform: rotate(8deg);
  pointer-events: none;
}
.cbi-hero h1 {
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 800;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.12;
  letter-spacing: -.01em;
  margin: 0 0 20px;
  max-width: 510px;     /* 沿用設計稿換行寬度，改為響應式 max-width */
  color: var(--cbi-ink);
}
.cbi-hero p {
  font-size: 17px;
  line-height: 1.8;
  color: #3F4350;
  max-width: 560px;
  margin: 0;
  font-family: 'Noto Sans TC', sans-serif;
}

/* Hero 兩欄：左文字 + 右形象圖（圖欄寬與下方表單卡一致） */
.cbi-hero-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.35fr;
  gap: 36px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.cbi-hero-figure {
  align-self: center;
  display: flex;
}
.cbi-hero-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 1906 / 825;     /* 以原圖比例決定高度，完整顯示不裁切 */
  object-fit: cover;
  /* 覆寫 Voltz main.css 對所有 img 套的 max-height:100% 限制 */
  max-height: none;
  border: 1px solid var(--cbi-border);
  border-radius: var(--cbi-radius-lg);
  box-shadow: var(--cbi-shadow-card);
  background: #fff;
  overflow: hidden;
}

/* ============ 表單區（上移覆蓋 Hero） ============ */
.cbi-wrap {
  margin-top: -160px;
  padding-bottom: 110px;
  position: relative;
  z-index: 2;
}
.cbi-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.35fr;
  gap: 36px;
  align-items: stretch;
}

/* ============ 左側深色資訊欄 ============ */
.cbi-aside {
  background: var(--cbi-ink);
  border-radius: var(--cbi-radius-lg);
  padding: 40px 36px;
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.06) 1px, transparent 1.6px),
    radial-gradient(130% 120% at 100% 0%, rgba(224,18,26,.22), transparent 50%);
  background-size: 22px 22px, 100% 100%;
  box-shadow: 0 20px 50px rgba(14,15,17,.18);
}
.cbi-aside > * { position: relative; z-index: 1; }
.cbi-aside .cbi-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--cbi-yellow);
  background: rgba(250,204,21,.12);
  padding: 6px 13px;
  border-radius: 999px;
  font-family: 'Manrope', sans-serif;
  margin-bottom: 22px;
}
.cbi-aside h2 {
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 800;
  font-size: 26px;
  line-height: 1.35;
  margin: 0 0 16px;
}
.cbi-aside .cbi-lead {
  font-size: 15px;
  line-height: 1.85;
  color: #B6B9C0;
  font-family: 'Noto Sans TC', sans-serif;
  margin: 0 0 32px;
}
.cbi-aside-contact {
  display: flex; flex-direction: column; gap: 18px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.cbi-aside-row {
  display: flex; align-items: flex-start; gap: 14px;
}
.cbi-aside-row .cbi-ico {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 11px;
  background: rgba(224,18,26,.18);
  color: #fff;
  display: grid; place-items: center;
}
.cbi-aside-row .cbi-ico svg { width: 19px; height: 19px; }
.cbi-aside-row .cbi-label {
  font-size: 11.5px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  color: #8A8E97;
  font-family: 'Manrope', sans-serif;
}
.cbi-aside-row .cbi-value {
  font-size: 16px; font-weight: 700;
  margin-top: 3px;
  font-family: 'Noto Sans TC', sans-serif;
  color: #fff;
  line-height: 1.5;
}
.cbi-aside-row .cbi-value a { color: inherit; }
.cbi-aside-row .cbi-value a:hover { color: var(--cbi-yellow); }

/* ============ 吉祥物（推至卡片底部、左右滿版貼齊圓角） ============ */
.cbi-aside-mascot {
  position: relative;
  margin: 24px -36px -40px;
  margin-top: auto;
  padding-top: 18px;
  text-align: center;
}
.cbi-aside-mascot img {
  position: relative;
  width: 220px;
  max-width: 72%;
  /* 覆寫 Voltz main.css 對所有 img 套的 max-height:100% 限制 */
  max-height: none;
  height: auto;
  margin: 0 auto;
  display: block;
}
.cbi-mascot-bubble {
  display: inline-block;
  position: relative;
  background: var(--cbi-yellow);
  color: var(--cbi-ink-2);
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 800;
  font-size: 14.5px;
  letter-spacing: .01em;
  padding: 11px 18px;
  border-radius: 14px;
  margin-bottom: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,.28);
}
.cbi-mascot-bubble::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -8px;
  transform: translateX(-50%);
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 9px solid var(--cbi-yellow);
}

/* ============ 右側表單卡 ============ */
.cbi-card {
  background: #fff;
  border: 1px solid var(--cbi-border);
  border-radius: var(--cbi-radius-lg);
  box-shadow: var(--cbi-shadow-card);
  padding: 44px 46px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.cbi-card .cbi-form-head {
  margin-bottom: 30px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--cbi-border);
}
.cbi-card .cbi-form-head h2 {
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 800;
  font-size: 24px;
  margin: 0 0 8px;
  color: var(--cbi-ink);
}
.cbi-card .cbi-form-head p {
  margin: 0;
  font-size: 14.5px;
  color: var(--cbi-muted);
  font-family: 'Noto Sans TC', sans-serif;
  line-height: 1.6;
}

.cbi-field { margin-bottom: 22px; }
.cbi-field > label {
  display: block;
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--cbi-ink);
  margin-bottom: 9px;
}
.cbi-field .cbi-req { color: var(--cbi-red); margin-left: 3px; }
.cbi-field .cbi-hint {
  font-weight: 500;
  font-size: 12.5px;
  color: var(--cbi-muted-2);
  margin-left: 8px;
}
/* 條件式欄位內的子標籤 */
.cbi-sublabel {
  display: block;
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--cbi-ink);
  margin-bottom: 8px;
}

/* 固定「聯絡事項」pill */
.cbi-subject-pill {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--cbi-red-soft);
  color: var(--cbi-red);
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 700;
  font-size: 16px;
  padding: 13px 20px;
  border-radius: 12px;
  border: 1px solid rgba(224,18,26,.18);
}
.cbi-subject-pill svg { width: 17px; height: 17px; }

/* 輸入框 / 下拉 */
.cbi-input, .cbi-select {
  width: 100%;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 15.5px;
  color: var(--cbi-ink);
  background: var(--cbi-paper-2);
  border: 1.5px solid var(--cbi-border);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
}
.cbi-input::placeholder { color: var(--cbi-muted-2); }
.cbi-textarea {
  resize: vertical;
  min-height: 160px;
  line-height: 1.7;
  font-family: 'Noto Sans TC', sans-serif;
}
.cbi-input:focus, .cbi-select:focus {
  outline: none;
  border-color: var(--cbi-red);
  background: #fff;
  box-shadow: 0 0 0 4px var(--cbi-red-soft);
}
.cbi-input.cbi-invalid, .cbi-select.cbi-invalid {
  border-color: var(--cbi-red);
  background: #FFF7F7;
}
.cbi-field-error {
  display: none;
  margin-top: 7px;
  font-size: 12.5px;
  color: var(--cbi-red);
  font-family: 'Noto Sans TC', sans-serif;
}
.cbi-field-error.cbi-show { display: block; }

/* 下拉自繪 chevron */
.cbi-select-wrap { position: relative; }
.cbi-select-wrap::after {
  content: "";
  position: absolute;
  right: 18px; top: 50%;
  width: 9px; height: 9px;
  border-right: 2px solid var(--cbi-muted);
  border-bottom: 2px solid var(--cbi-muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

/* 條件式區塊 */
.cbi-conditional {
  display: none;
  margin-top: 14px;
  animation: cbi-slideDown .25s ease;
}
.cbi-conditional.cbi-show { display: block; }
@keyframes cbi-slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 圖形驗證碼 */
.cbi-captcha-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.cbi-captcha-img {
  border: 1.5px solid var(--cbi-border);
  border-radius: 10px;
  background: var(--cbi-paper-2);
  display: block;
}
.cbi-captcha-refresh {
  flex: none;
  width: 42px; height: 42px;
  border: 1.5px solid var(--cbi-border);
  background: var(--cbi-paper-2);
  border-radius: 10px;
  cursor: pointer;
  color: var(--cbi-muted);
  display: grid;
  place-items: center;
  transition: border-color .15s, color .15s, transform .15s;
}
.cbi-captcha-refresh svg { width: 18px; height: 18px; }
.cbi-captcha-refresh:hover {
  border-color: var(--cbi-red);
  color: var(--cbi-red);
  transform: rotate(45deg);
}

/* 表單層級錯誤訊息（如頻率限制／寄送失敗） */
.cbi-form-error {
  display: none;
  margin-bottom: 22px;
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--cbi-red-soft);
  color: var(--cbi-red);
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}
.cbi-form-error.cbi-show { display: block; }

/* 送出 */
.cbi-form-actions {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.cbi-btn-submit {
  background: var(--cbi-red);
  color: #fff;
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 700;
  font-size: 16px;
  padding: 16px 32px;
  border: none;
  cursor: pointer;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background .15s, transform .15s;
}
.cbi-btn-submit:hover { background: var(--cbi-red-dark); transform: translateY(-1px); }
.cbi-btn-submit[disabled] { opacity: .6; cursor: not-allowed; transform: none; }
.cbi-btn-submit svg { width: 16px; height: 16px; }
.cbi-form-note {
  font-size: 13px;
  color: var(--cbi-muted);
  font-family: 'Noto Sans TC', sans-serif;
}

/* 成功狀態 */
.cbi-form-success {
  display: none;
  text-align: center;
  padding: 50px 20px 40px;
}
.cbi-form-success.cbi-show { display: block; }
.cbi-form-success .cbi-check {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: #D1FAE5;
  color: #1A6E3C;
  display: grid; place-items: center;
  margin: 0 auto 24px;
}
.cbi-form-success .cbi-check svg { width: 38px; height: 38px; }
.cbi-btn-reset {
  margin-top: 28px;
  background: #fff;
  color: var(--cbi-red);
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 26px;
  border: 1.5px solid var(--cbi-red);
  cursor: pointer;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: background .15s, color .15s, transform .15s;
}
.cbi-btn-reset:hover { background: var(--cbi-red); color: #fff; transform: translateY(-1px); }
.cbi-btn-reset svg { width: 15px; height: 15px; }
.cbi-form-success h2 {
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 800;
  font-size: 26px;
  color: var(--cbi-ink);
  margin: 0 0 12px;
}
.cbi-form-success p {
  font-size: 15.5px;
  color: var(--cbi-muted);
  font-family: 'Noto Sans TC', sans-serif;
  line-height: 1.75;
  max-width: 420px;
  margin: 0 auto;
}

/* ============ 響應式 ============ */
@media (max-width: 920px) {
  .cbi-grid { grid-template-columns: 1fr; gap: 24px; }
  .cbi-wrap { margin-top: -150px; }
  .cbi-hero-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  .cbi-hero { padding: 56px 0 200px; }
  .cbi-card { padding: 30px 22px 30px; }
  .cbi-aside { padding: 32px 26px; }
  .cbi-form-actions { gap: 12px; }
  .cbi-btn-submit { width: 100%; justify-content: center; }
}
