/*
 * dr-house 聯絡頁片段（webapp/fragments/templates/fragments/contact.html）。
 * 全部掛在 .drh-contact 底下：這支 CSS 會載進 WordPress 頁面，不可以碰到佈景。
 * 佈景（Nifty）會幫 input／button／table 加樣式，所以下面先把會被影響的元素歸零。
 */
.drh-contact {
  --drh-navy: #222E41;
  --drh-teal: #057485;
  --drh-brass: #907850;
  --drh-paper: #FBF8F2;
  --drh-perforation: #b9a57f;
  --drh-muted: #4B5563;
  --drh-border: #b8bcc4;
  --drh-danger: #B42318;
  --drh-mist: #EEF3F4;
  --drh-serif: 'Noto Serif TC', 'PMingLiU', serif;
  color: var(--drh-navy);
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
  /* 聯絡頁用的佈景模板在手機上沒有左右留白（2026-10-03 正式站實測），片段自己留 */
  padding: 0 16px;
}
.drh-contact *, .drh-contact *::before, .drh-contact *::after { box-sizing: border-box; }
.drh-contact h2, .drh-contact h3, .drh-contact p, .drh-contact dl, .drh-contact dd, .drh-contact ol { margin: 0; }
/* 佈景直接對 h2／h3 設字型、底線與間距：style.css 的 `h1,h2… {font-family:Spartan}`，
   以及頁面內嵌的 `.bt-content h2 {border-bottom; margin; font-family:系統字}`。
   後者權重跟 `.drh-contact h2` 一樣、又出現得比較晚，所以這裡用 ID 壓過去。
   2026-10-03 在正式站測試頁看到：標題變細、下面多一條線。 */
#drh-contact h2, #drh-contact h3 {
  font-family: inherit; border: 0; padding: 0; margin: 0; background: none;
  text-transform: none; letter-spacing: normal;
}
#drh-contact h3.drh-h { font-family: var(--drh-serif); }
/* 佈景的內容區底下沒有留白，諮詢單會直接貼著頁尾（2026-10-03 站主在正式站看到） */
#drh-contact { margin-bottom: 56px; }
#drh-contact h2::before, #drh-contact h2::after,
#drh-contact h3::before, #drh-contact h3::after { content: none; display: none; }
.drh-contact ol { padding: 0; list-style: none; }
.drh-contact fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.drh-contact input, .drh-contact select, .drh-contact textarea, .drh-contact button {
  font: inherit; color: inherit; letter-spacing: normal; text-transform: none; box-shadow: none; margin: 0;
}
.drh-contact a { text-decoration: none; }
.drh-contact [hidden] { display: none !important; }
.drh-contact :focus-visible { outline: 3px solid var(--drh-teal); outline-offset: 2px; }
.drh-contact [tabindex="-1"]:focus { outline: none; }
.drh-num { font-family: 'League Spartan', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif; font-weight: 700; white-space: nowrap; }

/* ---------- LINE ---------- */
.drh-hero, .drh-hero-text { display: flex; flex-direction: column; gap: 16px; }
.drh-contact .drh-eyebrow { font-size: 13px; font-weight: 700; color: var(--drh-teal); }
.drh-contact .drh-title { font-size: 32px; line-height: 1.3; font-weight: 900; color: var(--drh-navy); }
.drh-contact .drh-lead { font-size: 16px; line-height: 1.8; }
.drh-line-card {
  display: grid; grid-template-columns: 104px minmax(0, 1fr); grid-template-areas: "btn btn" "qr meta";
  gap: 14px; padding: 0 14px 14px; background: #fff; border: 1.5px solid var(--drh-teal);
  border-radius: 14px; overflow: hidden;
}
.drh-line-btn {
  grid-area: btn; display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0 -14px; padding: 16px 20px; background: var(--drh-teal); color: #fff !important;
  font-size: 18px; font-weight: 900;
}
.drh-line-btn svg { flex-shrink: 0; }
.drh-line-card img { grid-area: qr; display: block; width: 104px; height: 104px; }
.drh-line-meta { grid-area: meta; display: flex; flex-direction: column; justify-content: center; gap: 6px; font-size: 14px; line-height: 1.6; }
.drh-contact .drh-hint { font-size: 13px; color: var(--drh-muted); }
.drh-strong { font-size: 16px; font-weight: 700; }
.drh-only-desk { display: none; }
/* 對話示意做成一支手機的螢幕（站主 2026-10-03：手機版也要有邊框，像螢幕裡的感覺）。
   手機版邊框 8px、電腦版 10px（見下方 960px） */
.drh-chat { display: flex; flex-direction: column; gap: 10px; padding: 16px 12px 18px; background: var(--drh-mist); border: 8px solid var(--drh-navy); border-radius: 28px; font-size: 14px; line-height: 1.6; }
.drh-chat-label { font-size: 12px; color: var(--drh-muted); text-align: center; }
.drh-bubble { max-width: 82%; padding: 9px 13px; }
.drh-bubble-me { align-self: flex-end; background: var(--drh-teal); color: #fff; border-radius: 16px 16px 4px 16px; }
.drh-bubble-us { align-self: flex-start; background: #fff; border: 1px solid #dfe5e7; border-radius: 16px 16px 16px 4px; }
.drh-photo { align-self: flex-end; display: flex; align-items: center; justify-content: center; width: 120px; height: 78px; border-radius: 12px; background: #d7dde0; font-size: 12px; color: var(--drh-muted); }

/* ---------- 電話 ---------- */
.drh-lower { display: flex; flex-direction: column; gap: 28px; }
.drh-call { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; background: var(--drh-navy); color: #fff; border-radius: 14px; }
.drh-contact .drh-call h2 { font-size: 16px; font-weight: 700; color: #fff; }
.drh-tel { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #fff; color: var(--drh-navy) !important; border-radius: 10px; font-size: 13px; }
.drh-tel .drh-num { font-size: 22px; font-weight: 800; }
/* 佈景會直接給連結裡的 span 上色（手機版白底上變成白字、號碼看不見），所以 span 自己指定 */
.drh-contact .drh-tel span { color: var(--drh-navy) !important; }
.drh-hours { font-size: 13px; color: #C9D0DC; }
.drh-addr { display: none; padding-top: 16px; border-top: 1px solid #3b475c; font-size: 14px; line-height: 1.8; color: #E3E7EE; }

/* ---------- 諮詢單 ---------- */
.drh-contact .drh-slip-heading { margin-bottom: 12px !important; font-size: 15px; font-weight: 700; color: var(--drh-navy); }
.drh-slip { background: #fff; border: 1.5px solid var(--drh-brass); border-radius: 8px; overflow: hidden; }
.drh-stub { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: var(--drh-paper); border-bottom: 2px dashed var(--drh-perforation); }
.drh-contact .drh-stub-title { font-family: var(--drh-serif); font-size: 24px; font-weight: 900; }
.drh-stub-steps { display: none; }
.drh-saved-note { display: none; font-size: 12px; font-weight: 700; color: var(--drh-teal); }
.drh-saved .drh-saved-note { display: block; }
.drh-saved .drh-stub .drh-stamp { display: none; }
.drh-finished .drh-stub { display: none !important; }
.drh-stamp {
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0;
  width: 70px; height: 70px; border: 2.5px solid var(--drh-brass); border-radius: 50%;
  color: var(--drh-brass); transform: rotate(-12deg); text-align: center;
  font-family: var(--drh-serif); font-size: 14px; font-weight: 900; line-height: 1.2;
}
.drh-stamp small { font-size: 9px; font-weight: 400; letter-spacing: .15em; }
.drh-stub .drh-stamp small { display: none; }
.drh-slip-body { display: flex; flex-direction: column; gap: 16px; padding: 18px; }
.drh-progress { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.drh-progress li { height: 6px; border-radius: 3px; background: #dcdcd8; }
.drh-progress li.drh-on { background: var(--drh-navy); }
.drh-contact .drh-step-label { font-size: 14px; font-weight: 700; }
.drh-contact .drh-alert { padding: 10px 12px; background: #FDECEA; color: var(--drh-danger); border-radius: 8px; font-size: 14px; }
.drh-form, .drh-form fieldset { display: flex; flex-direction: column; gap: 18px; }
.drh-contact .drh-h { font-family: var(--drh-serif); font-size: 20px; font-weight: 900; line-height: 1.4; color: var(--drh-navy); }
.drh-consent-sum { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px 10px; font-size: 14px; }
.drh-consent-sum dt { font-weight: 700; }
.drh-fulltext { padding-top: 12px; border-top: 1px solid #e5e1d6; font-size: 13px; line-height: 1.8; color: #374151; }
.drh-fulltext summary { padding: 6px 0; font-size: 14px; font-weight: 700; color: var(--drh-teal); cursor: pointer; }
.drh-fulltext p { margin-top: 8px; }
/* 全文很長（九節），展開後放在可捲動的框裡，不把「下一步」推到好幾個螢幕之外 */
.drh-ft { max-height: 55vh; overflow-y: auto; margin-top: 8px; padding: 4px 12px 12px 0; }
.drh-contact .drh-ft-h2 { margin-top: 16px; font-size: 14px; font-weight: 700; color: var(--drh-navy); }
.drh-contact .drh-ft-h3 { margin-top: 10px; font-weight: 700; color: var(--drh-navy); }
.drh-contact .drh-ft ul, .drh-contact .drh-ft ol { margin: 6px 0 0; padding-left: 1.6em; }
.drh-contact .drh-ft ul { list-style: disc; }
.drh-contact .drh-ft ol { list-style: decimal; }
.drh-contact .drh-ft li { margin-top: 2px; }
/* 佈景對內容區的 p／li 設了 16px，全文會比小標題還大；用 ID 壓回來 */
#drh-contact .drh-ft p, #drh-contact .drh-ft li { font-size: 13px; line-height: 1.8; }
#drh-contact .drh-ft .drh-ft-h2 { font-size: 14px; }
/* 同一個原因：對話示意的泡泡是 p，被佈景放大成 16px */
#drh-contact .drh-chat p { font-size: 14px; line-height: 1.6; }
#drh-contact .drh-chat .drh-chat-label, #drh-contact .drh-chat .drh-photo { font-size: 12px; }
.drh-contact .drh-note, .drh-contact .drh-sub { font-size: 13px; color: var(--drh-muted); }
.drh-field { display: flex; flex-direction: column; gap: 8px; }
.drh-contact .drh-label { font-family: var(--drh-serif); font-size: 17px; font-weight: 700; }
.drh-label em { font-family: 'Noto Sans TC', sans-serif; font-style: normal; font-size: 13px; font-weight: 400; color: var(--drh-danger); }
.drh-field input[type=text], .drh-field input[type=tel], .drh-field select, .drh-field textarea {
  width: 100%; padding: 12px 14px; font-size: 16px; background: #fff;
  border: 1px solid var(--drh-border); border-radius: 8px;
}
.drh-field .drh-invalid { padding: 11px 13px; border: 2px solid var(--drh-danger); }
.drh-contact .drh-error { font-size: 13px; color: var(--drh-danger); }
.drh-choices { display: grid; gap: 8px; }
.drh-cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.drh-choice {
  display: flex; align-items: center; gap: 8px; padding: 11px 12px; font-size: 15px; background: #fff;
  border: 1.5px solid var(--drh-border); border-radius: 8px; cursor: pointer;
}
.drh-choice input { margin: 0; accent-color: var(--drh-navy); }
.drh-choice:has(input:checked) { background: var(--drh-navy); border-color: var(--drh-navy); color: #fff; font-weight: 700; }
.drh-choice:has(input:checked) input { accent-color: #fff; }
.drh-wide { grid-column: 1 / -1; }
.drh-contact .drh-tip { padding: 12px 14px; background: var(--drh-mist); border-radius: 8px; font-size: 14px; }
.drh-slots { width: calc(100% + 12px); margin: 0 -6px; border-collapse: separate; border-spacing: 6px; table-layout: fixed; font-size: 14px; }
.drh-contact .drh-slots th, .drh-contact .drh-slots td { padding: 0; border: 0; background: none; font-weight: 700; text-align: center; }
.drh-contact .drh-slots th small { display: block; font-size: 11px; font-weight: 400; color: var(--drh-muted); }
.drh-contact .drh-slots thead th:first-child, .drh-contact .drh-slots tbody th { width: 40px; text-align: left; }
.drh-slot { display: flex; align-items: center; justify-content: center; height: 44px; background: #fff; border: 1.5px solid var(--drh-border); border-radius: 8px; cursor: pointer; }
.drh-slot input { margin: 0; accent-color: #fff; }
.drh-slot:has(input:checked) { background: var(--drh-navy); border-color: var(--drh-navy); }
.drh-nav { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
.drh-nav .drh-back[hidden] + .drh-next { grid-column: 1 / -1; }
.drh-contact .drh-back { padding: 14px 8px; font-size: 16px; color: var(--drh-navy); background: #fff; border: 1.5px solid var(--drh-border); border-radius: 10px; cursor: pointer; }
.drh-contact .drh-next { padding: 14px 16px; font-size: 17px; font-weight: 700; color: #fff; background: var(--drh-navy); border: 0; border-radius: 10px; cursor: pointer; }
.drh-contact .drh-next.drh-submit { background: var(--drh-brass); }
.drh-contact .drh-nav button:disabled { opacity: .6; cursor: wait; }
.drh-contact .drh-skip { align-self: center; padding: 4px; font-size: 15px; color: var(--drh-teal); background: transparent; border: 0; text-decoration: underline; cursor: pointer; }
.drh-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- 完成 ---------- */
.drh-done { display: flex; flex-direction: column; gap: 16px; }
.drh-done-head {
  display: flex; flex-direction: column; align-items: center; gap: 8px; margin: -18px -18px 0;
  padding: 22px 18px 20px; background: var(--drh-paper); border-bottom: 2px dashed var(--drh-perforation); text-align: center;
}
.drh-stamp-done { width: 96px; height: 96px; font-size: 20px; }
.drh-done-number { font-size: 34px; font-weight: 800; }
.drh-done-sum { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 6px 10px; padding: 14px; background: var(--drh-paper); border-radius: 8px; font-size: 14px; }
.drh-done-sum dt { font-weight: 700; }
.drh-done-line { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid #e5e1d6; font-weight: 700; }
.drh-done-line .drh-line-btn { margin: 0; border-radius: 12px; font-size: 17px; }

/* ---------- 電腦版 ---------- */
@media (min-width: 960px) {
  .drh-contact { gap: 72px; padding: 0; }
  #drh-contact { margin-bottom: 96px; }
  .drh-hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: center; }
  .drh-contact .drh-title { font-size: 52px; line-height: 1.25; }
  .drh-contact .drh-lead { max-width: 520px; font-size: 18px; }
  .drh-line-card {
    grid-template-columns: 128px minmax(0, 1fr); grid-template-areas: "qr meta" "qr btn";
    gap: 10px 24px; max-width: 560px; padding: 18px; align-items: start;
  }
  .drh-line-card img { width: 128px; height: 128px; }
  .drh-line-btn { justify-self: start; margin: 0; padding: 12px 22px; border-radius: 10px; font-size: 17px; }
  .drh-only-desk { display: revert; }
  .drh-only-phone { display: none; }
  .drh-chat { justify-self: center; width: 340px; padding: 18px 14px 22px; border: 10px solid var(--drh-navy); border-radius: 36px; }
  .drh-lower { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 24px; align-items: start; }
  .drh-call { gap: 16px; padding: 36px 32px; }
  .drh-contact .drh-call h2 { font-size: 26px; font-weight: 900; }
  .drh-tel { flex-direction: column; align-items: flex-start; padding: 0; background: none; color: #fff !important; }
  .drh-contact .drh-tel span { color: #fff !important; }
  .drh-contact .drh-tel span:first-child { color: #C9D0DC !important; }
  .drh-tel .drh-num { font-size: 34px; }
  .drh-addr { display: block; }
  .drh-slip { display: flex; }
  .drh-stub {
    flex-direction: column; align-items: flex-start; justify-content: flex-start; flex-shrink: 0;
    width: 210px; gap: 18px; padding: 32px 24px; border-bottom: 0; border-right: 2px dashed var(--drh-perforation);
  }
  .drh-contact .drh-stub-title { font-size: 28px; }
  .drh-stub-steps { display: flex; flex-direction: column; gap: 10px; font-size: 15px; counter-reset: drhstep; }
  .drh-stub-steps li { display: flex; align-items: center; gap: 10px; color: #8a8f99; counter-increment: drhstep; }
  .drh-stub-steps li::before {
    content: counter(drhstep); display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border: 1.5px solid var(--drh-border); border-radius: 50%; font-size: 13px;
  }
  .drh-stub-steps li.drh-current { color: var(--drh-navy); font-weight: 700; }
  .drh-stub-steps li.drh-current::before { border: 2px solid var(--drh-navy); }
  .drh-stub-steps li.drh-done-step { color: var(--drh-muted); }
  .drh-stub-steps li.drh-done-step::before { content: '✓'; background: var(--drh-navy); border-color: var(--drh-navy); color: #fff; }
  .drh-stub .drh-stamp, .drh-saved .drh-stub .drh-stamp { display: flex; margin-top: auto; width: 104px; height: 104px; font-size: 18px; }
  .drh-stub .drh-stamp small { display: block; }
  .drh-slip-body { flex-grow: 1; min-width: 0; padding: 32px 40px; }
  .drh-progress { display: none; }
  .drh-slip-body .drh-choices.drh-cols-2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .drh-nav { display: flex; justify-content: flex-end; gap: 12px; }
  .drh-contact .drh-back { padding: 13px 28px; }
  .drh-contact .drh-next { padding: 13px 44px; }
  .drh-done-head { margin: -32px -40px 0; }
}
