/* 里民小幫手 Design System — 里民端表單頁（store／survey／eventform／voucher）
   由平台核心同步到各里 assets/，請勿在各里手改；要調整請改 village-platform-core。
   規則：主文與表單主要操作 16px（也避免 iOS 聚焦時自動放大）、metadata 14px、可點控制項至少 44px、可見的鍵盤焦點。
   不改版面結構、不改資料與驗證邏輯；載入順序在各頁內嵌樣式之後，同權重下以這裡為準。 */
:root {
  --ds-font-body: 16px;
  --ds-font-meta: 14px;
  --ds-tap: 44px;
  --ds-focus: #1d4ed8;
}

:where(a, button, input, select, textarea, label[role="button"], [role="button"], [tabindex]):focus-visible {
  outline: 3px solid var(--ds-focus);
  outline-offset: 2px;
}

/* ── 輸入控制項：16px、至少 44px 高 ── */
input[type="text"], input[type="tel"], input[type="url"], input[type="number"],
.field input[type="text"], .field input[type="number"], .field textarea, .field select,
textarea, select {
  font-size: var(--ds-font-body);
  min-height: var(--ds-tap);
}
input::placeholder, textarea::placeholder { font-size: var(--ds-font-body); }
.option.other input[type="text"] {
  min-height: var(--ds-tap);
  font-size: var(--ds-font-body);
}
.option.other input[type="text"]:focus {
  outline: 3px solid var(--ds-focus) !important;
  outline-offset: 2px;
}

/* ── 文字層級 ── */
.field-label, .field-label .required, .error-text, .field-hint, .field-hint.hint-box,
.hint, .privacy-note, .brand-tag-empty, .brand-tag-option, .brand-tag-chip, .photo-add-btn,
.footer {
  font-size: var(--ds-font-meta);
}
body .site-branding-footer, body .privacy-note, body .privacy-note a { font-size: var(--ds-font-meta) !important; } /* GS 頁面內嵌 style 寫死 13px，需 !important */
.field-label { line-height: 1.5; }
.error-text { line-height: 1.5; font-weight: 600; }
.question-title { font-size: 17px; line-height: 1.5; overflow-wrap: anywhere; }
.option, .option span, .option label { font-size: var(--ds-font-body); min-width: 0; overflow-wrap: anywhere; }
.option { min-height: var(--ds-tap); align-items: center; }
.option input[type="radio"], .option input[type="checkbox"] { margin-top: 0; flex-shrink: 0; width: 20px; height: 20px; }
.status { font-size: var(--ds-font-body); line-height: 1.6; overflow-wrap: anywhere; }
h1 { overflow-wrap: anywhere; }
.subtitle { overflow-wrap: anywhere; }

/* ── 可點控制項 ── */
.brand-tag-option, .brand-tag-chip, .brand-tag-chip button, .brand-tag-add {
  min-height: var(--ds-tap);
  display: inline-flex;
  align-items: center;
}
.brand-tag-chip button { min-width: var(--ds-tap); justify-content: center; }
.photo-add-btn { min-height: var(--ds-tap); }
.scale-row button { font-size: var(--ds-font-body); }
.photo-preview-item .item-remove {
  width: var(--ds-tap); height: var(--ds-tap);
  top: 0; right: 0;
  border: 0; border-radius: 0; background: none; box-shadow: none;
}
.photo-preview-item .item-remove::before {
  content: "";
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: 1px solid rgba(59,130,246,.2);
  box-shadow: 0 2px 8px rgba(0,0,0,.10);
}
.photo-preview-item .item-remove:hover { transform: none; background: none; }
.privacy-note a, .footer a {
  min-height: var(--ds-tap);
  display: inline-flex;
  align-items: center;
}
.success-msg button, .submit-btn { min-height: var(--ds-tap); font-size: var(--ds-font-body); }

/* 報名表的提醒勾選（eventform）：整列可點、至少 44px */
.reminder-field label { min-height: var(--ds-tap); align-items: center; }
.reminder-field input[type="checkbox"] { width: 20px; height: 20px; margin-top: 0; flex-shrink: 0; }

/* 送出中／不可用不只靠顏色：按鈕文字會改成「送出中…」，這裡只補游標語意 */
.submit-btn:disabled { cursor: not-allowed; }

/* 問題有錯時：框線加粗並保持可見（不只靠顏色，訊息文字在上方狀態列） */
.question.invalid { border-color: #b91c1c; border-width: 2px; }

/* ── 憑證頁（voucher）：說明文字至少 14px；不改版型與即時時間動畫 ── */
.brand-sub, .cert-label, .cert-desc, .tip-box .tip-title, .tip-box .tip-text, .live-time,
.footer { font-size: var(--ds-font-meta); }
.btn { min-height: var(--ds-tap); font-size: var(--ds-font-body); }
@media (prefers-reduced-motion: reduce) {
  .voucher, .live-time .dot { animation: none; }
}
