/* LIFF 預約登記表 — 手機優先 */
:root {
  --brand: #f472b6;        /* 少女粉 */
  --brand-dark: #ec5fa8;
  --bg: #fdf2f8;
  --card: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #d1d5db;
  --danger: #e11d48;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: linear-gradient(170deg, #fdf2f8 0%, #fff8fb 35%, #fdf0f7 70%, #fce7f3 100%) fixed;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: 40px;
}

.app-header {
  background: linear-gradient(120deg, #fbcfe8 0%, #f9a8d4 25%, #f472b6 60%, #ec4899 100%);
  color: #fff;
  padding: 20px 16px 16px;
  text-align: center;
}
.app-header h1 { font-size: 20px; font-weight: 700; }
.app-header .subtitle { font-size: 13px; opacity: 0.9; margin-top: 2px; }

main { max-width: 480px; margin: 0 auto; padding: 12px 12px 0; }

.card {
  background: linear-gradient(175deg, #ffffff 0%, #fffafc 70%, #fff5f9 100%);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(236, 72, 153, 0.08);
  border: 1px solid rgba(244, 114, 182, 0.12);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #fbcfe8, #f472b6, #ec4899, #f9a8d4);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 4px solid transparent;
  border-image: linear-gradient(180deg, #f9a8d4, #ec4899) 1;
  background: linear-gradient(90deg, #ec4899, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 2px; }

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.req { color: var(--danger); }
.hint { font-size: 12px; font-weight: 400; color: var(--text-light); }

select, input[type="text"], input[type="date"] {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font-size: 16px;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  appearance: none;
  -webkit-appearance: none;
}
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
select:disabled {
  background-color: #f3f4f6;
  color: var(--text-light);
}
select:focus, input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.18);
}
select.invalid, input.invalid, .seg-group.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}
.seg-group.invalid { border-radius: 10px; }

/* 按鈕組（來源、訊息類別） */
.seg-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.seg-btn {
  flex: 1;
  min-width: 64px;
  min-height: 44px;
  padding: 10px 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
}
.seg-btn.active {
  background: linear-gradient(135deg, #f9a8d4, #f472b6 55%, #ec4899);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.35);
}

/* 送出按鈕 */
.submit-bar { padding: 8px 0 24px; }
.btn-primary {
  width: 100%;
  min-height: 50px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #f9a8d4 0%, #f472b6 45%, #ec4899 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35);
  transition: filter .15s, box-shadow .15s;
}
.btn-primary:active { filter: brightness(0.92); box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3); }
.btn-primary:disabled { background: #d1d5db; box-shadow: none; cursor: not-allowed; }

.btn-secondary {
  width: 100%;
  min-height: 50px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}

/* 確認彈窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: #fff;
  width: 100%;
  max-width: 480px;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp .25s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.modal h3 { font-size: 17px; text-align: center; margin-bottom: 14px; }

.summary {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.summary .row {
  display: flex;
  padding: 10px 12px;
  font-size: 14.5px;
  border-bottom: 1px solid #f0f1f3;
}
.summary .row:last-child { border-bottom: none; }
.summary .row:nth-child(odd) { background: linear-gradient(90deg, #fdf5f9, #fef9fb); }
.summary dt { width: 88px; flex-shrink: 0; color: var(--text-light); }
.summary dd { flex: 1; font-weight: 600; word-break: break-all; }

.modal-actions { display: flex; gap: 10px; }

/* 成功畫面 */
.modal.success { text-align: center; border-radius: 16px; margin: 0 16px 30vh; }
.modal-overlay:has(.success) { align-items: center; }
.success-icon {
  width: 64px; height: 64px;
  margin: 4px auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f9a8d4, #ec4899);
  color: #fff;
  font-size: 36px;
  line-height: 64px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.4);
}
.modal.success p { color: var(--text-light); font-size: 14px; margin-bottom: 16px; }
