/* 視覺與 EDM 對齊：teal #02c3c3、深灰藍字 #24343f、柔和底、圓角卡片。
   行動優先——EDM 的開信絕大多數在手機上。 */
:root {
  --teal: #02c3c3;
  --teal-ink: #037c7c;          /* teal 當文字時的可讀版本（AA on white） */
  --teal-wash: #eafafa;         /* 選中/強調的極淡底 */
  --ink: #24343f;
  --ink-strong: #111820;
  --muted: #6a757d;
  --line: #e9ebef;
  --field: #f4f6f8;
  --field-line: #d7dce1;
  --err: #d64545;
  --err-wash: #fdf1f0;
  --radius: 16px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 40px 16px 72px;
  background: linear-gradient(180deg, #eef1f4 0%, #e6eaee 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans TC',
               'PingFang TC', 'Microsoft JhengHei', sans-serif;
  line-height: 1.7;
}

.card {
  max-width: 592px;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--radius);
  padding: 40px 40px 36px;
  box-shadow: 0 1px 2px rgba(20, 30, 40, .04),
              0 12px 32px rgba(20, 30, 40, .10);
  /* 卡片頂端一條 teal 細帶當品牌錨點 */
  border-top: 4px solid var(--teal);
}

@media (max-width: 560px) {
  body { padding: 0 0 56px; }
  .card {
    border-radius: 0;
    border-top: 4px solid var(--teal);
    padding: 30px 22px 34px;
    box-shadow: none;
    min-height: 100vh;
  }
}

/* ---- 品牌標 ---- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--teal-ink);
  text-transform: none;
}
.brand-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-wash);
}

h1 {
  margin: 0 0 14px;
  font-size: 23px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink-strong);
  text-wrap: balance;           /* 讓標題兩行更均衡，避免尾字落單 */
}

.lede { margin: 0 0 4px; font-size: 15.5px; color: var(--ink); }

.foot { margin: 18px 0 0; font-size: 13px; color: var(--muted); }
.foot a { color: var(--teal-ink); }

.alert {
  margin: 22px 0 0;
  padding: 13px 15px;
  border-radius: 10px;
  background: var(--err-wash);
  border: 1px solid #f3cfcc;
  color: var(--err);
  font-size: 14px;
  font-weight: 600;
}

/* ---- 每一題 ----
   間距全放在標題「上方」，標題到自己的選項則貼著——題與題之間靠上方的留白分隔。
   （改用 div 而非 fieldset/legend：fieldset 的 padding-top 會跑到 legend 與內容之間，
   造成「下面空一段、上面貼著」的相反效果。） */
.q {
  padding: 34px 0 0;            /* 只在標題上方留白 */
}
.q:first-of-type { padding-top: 26px; }

.legend {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0 0 10px;            /* 標題貼著自己的選項 */
}

/* 題號做成 teal 小圓籤，給整份問卷節奏感；用 flex 對齊標題第一行 */
.num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  margin-top: 1px;
  border-radius: 8px;
  background: var(--teal-wash);
  color: var(--teal-ink);
  font-size: 13px;
  font-weight: 800;
}

.qt {
  flex: 1 1 auto;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-strong);
  line-height: 1.55;
}

.req {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--teal);
  color: var(--teal-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  vertical-align: 2px;
  white-space: nowrap;
}

/* note/err 緊貼在標題下方，與選項再留一點空隙 */
.note { margin: 0 0 8px; font-size: 13.5px; color: var(--muted); }
.err  { margin: 0 0 8px; font-size: 13.5px; color: var(--err); font-weight: 600; }

/* ---- 選項（整格可點，選中染色）---- */
label.opt {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 10px;
  padding: 11px 14px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  font-size: 15.5px;
  cursor: pointer;
  transition: border-color .12s, background-color .12s, box-shadow .12s;
}
label.opt:hover { border-color: #b9c0c7; background: #fbfcfd; }

/* 選中整格 teal 染色（:has 在現代瀏覽器可用；退化時仍有原生 accent-color 打勾） */
label.opt:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-wash);
  box-shadow: inset 0 0 0 1px var(--teal);
}

label.opt input[type=checkbox],
label.opt input[type=radio] {
  width: 20px; height: 20px;
  accent-color: var(--teal);
  flex: none;
  margin: 0;
}
label.opt > span { flex: 1 1 auto; }

/* 「其他 ___」的輸入框，跟在選項後面而不是飄一行 */
.opt-text {
  flex: 1 1 160px;
  min-width: 0;
  padding: 8px 11px;
  border: 1px solid var(--field-line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 15px;
}

/* ---- 文字輸入 ---- */
textarea,
input[type=text],
input[type=email] {
  width: 100%;
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid var(--field-line);
  border-radius: 11px;
  background: var(--field);
  font: inherit;
  font-size: 16px;               /* < 16px 時 iOS Safari 會自動放大頁面 */
  color: var(--ink);
  resize: vertical;
  transition: border-color .12s, background-color .12s, box-shadow .12s;
}
textarea { min-height: 108px; line-height: 1.6; }
textarea::placeholder,
input::placeholder { color: #9aa3ab; }

textarea:focus,
input[type=text]:focus,
input[type=email]:focus,
.opt-text:focus {
  outline: 0;
  background: #fff;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(2, 195, 195, .16);
}

/* ---- 送出 ---- */
button {
  width: 100%;
  margin-top: 34px;
  padding: 16px 30px;
  border: 0;
  border-radius: 12px;
  background: var(--teal);
  color: #06312f;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(2, 195, 195, .30);
  transition: transform .06s, box-shadow .12s, filter .12s;
}
button:hover { filter: brightness(.97); box-shadow: 0 8px 20px rgba(2, 195, 195, .38); }
button:active { transform: translateY(1px); box-shadow: 0 4px 10px rgba(2, 195, 195, .30); }

/* 蜜罐：真人看不到，機器人讀 DOM 會填 */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---- 感謝頁 ---- */
.done { text-align: left; }
.done h1 { margin-bottom: 12px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
