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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", sans-serif;
  min-height: 100vh;
  background: #fef5f4;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 48px;
  color: #3a2625;
}

/* LIFF init screen */
#liff-loading {
  position: fixed;
  inset: 0;
  background: #fef5f4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 9999;
  font-size: 1rem;
  color: #c96b68;
}

#liff-loading.hidden { display: none; }

/* Header banner */
.header-banner {
  width: 100%;
  background: linear-gradient(135deg, #F2AEAB 0%, #E89490 100%);
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
}

.header-logo {
  font-size: 2.2rem;
  margin-bottom: 2px;
}

/* Banner under LINE bar */
.banner-img {
  width: 70%;
  height: auto;
  display: block;
  margin: 0 auto 16px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(232,148,144,0.18);
}

.header-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  text-align: center;
  letter-spacing: 0.04em;
}

.header-sub {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.9);
  text-align: center;
}

/* Main content wrapper */
.main-wrap {
  width: 100%;
  max-width: 480px;
  padding: 0 16px;
}

/* LINE profile bar */
#top-user-bar {
  display: none;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: #fff;
  border: 1.5px solid #f4c8c5;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(232,148,144,0.12);
}

#top-user-bar.show { display: flex; }

.top-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #E89490;
  flex-shrink: 0;
}

.top-avatar-placeholder {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F2AEAB, #E89490);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.top-user-info { flex: 1; }

.top-greeting {
  font-size: 0.7rem;
  color: #a07a78;
}

.top-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #c96b68;
}

.top-line-badge {
  font-size: 0.67rem;
  color: #c96b68;
  background: #fdebe9;
  border-radius: 99px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* Form card */
.form-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 4px 24px rgba(232,148,144,0.15);
  margin-bottom: 16px;
}

.form-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #c96b68;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-card-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: linear-gradient(180deg, #F2AEAB, #E89490);
  border-radius: 2px;
}

/* Question blocks (Q1–Q4) */
.q-block {
  border: none;
  padding: 0;
  margin: 0 0 24px;
}

.q-block legend {
  font-size: 0.92rem;
  font-weight: 700;
  color: #c96b68;
  margin-bottom: 10px;
  line-height: 1.5;
  padding: 0;
  display: block;
  width: 100%;
}

.q-block legend .req {
  color: #e03030;
  font-size: 0.75rem;
  margin-left: 4px;
}

.opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid #f4d2d0;
  border-radius: 10px;
  background: #fff9f8;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 0.92rem;
  color: #3a2625;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  user-select: none;
}

.opt:last-child { margin-bottom: 0; }

.opt:hover {
  border-color: #E89490;
  background: #fff5f3;
}

.opt input[type="radio"],
.opt input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.opt-mark {
  width: 20px;
  height: 20px;
  border: 1.5px solid #d8a8a5;
  background: #fff;
  flex-shrink: 0;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.q-block:not(.multi) .opt-mark { border-radius: 50%; }
.q-block.multi .opt-mark      { border-radius: 5px; }

.opt input:checked ~ .opt-mark {
  border-color: #E89490;
  background: #E89490;
}

/* radio inner dot */
.q-block:not(.multi) .opt input:checked ~ .opt-mark::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

/* checkbox tick */
.q-block.multi .opt input:checked ~ .opt-mark::after {
  content: '';
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.opt:has(input:checked) {
  border-color: #E89490;
  background: #fef0ee;
  box-shadow: 0 0 0 3px rgba(242,174,171,0.18);
}

.opt-text { flex: 1; line-height: 1.4; }

/* Fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field:last-child { margin-bottom: 0; }

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #5a3a38;
  display: flex;
  align-items: center;
  gap: 4px;
}

.field label .req {
  color: #e03030;
  font-size: 0.75rem;
}

.field input,
.field select {
  padding: 11px 14px;
  border: 1.5px solid #f4d2d0;
  border-radius: 10px;
  font-size: 0.95rem;
  color: #3a2625;
  background: #fff9f8;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  font-family: inherit;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c96b68' stroke-width='2.5'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

.field input:focus,
.field select:focus {
  border-color: #E89490;
  box-shadow: 0 0 0 3px rgba(242,174,171,0.25);
  background: #fff;
}

.field input::placeholder { color: #d0a8a6; }

.field input:read-only {
  background: #fdebe9;
  color: #7a5a58;
  cursor: default;
}

/* Submit button */
.btn-submit {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #F2AEAB, #E89490);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.1s;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 16px rgba(232,148,144,0.35);
}

.btn-submit:hover { opacity: 0.9; }
.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* Error message */
.error-msg {
  font-size: 0.82rem;
  color: #d93030;
  margin-top: 10px;
  text-align: center;
  display: none;
  padding: 8px 12px;
  background: #fff0f0;
  border-radius: 8px;
}

/* Submit overlay */
.submit-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(90,40,38,0.55);
  align-items: center;
  justify-content: center;
  z-index: 999;
  flex-direction: column;
  gap: 14px;
  font-size: 1rem;
  color: #fff;
}

.submit-overlay.show { display: flex; }

/* Spinner */
.spinner {
  width: 40px; height: 40px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Thank you page */
#thank-you {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 16px;
  width: 100%;
  max-width: 480px;
  animation: fadeIn 0.4s ease;
}

#thank-you.show { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ty-card {
  width: 100%;
  background: #fff;
  border-radius: 20px;
  padding: 36px 24px;
  box-shadow: 0 8px 40px rgba(232,148,144,0.20);
  margin-bottom: 20px;
}

.ty-icon { font-size: 4rem; margin-bottom: 16px; }

.ty-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #c96b68;
  margin-bottom: 8px;
}

.ty-msg {
  font-size: 0.95rem;
  color: #5a3a38;
  line-height: 1.65;
}

.ty-divider {
  height: 1px;
  background: #f8e3e1;
  margin: 20px 0;
}

.ty-info {
  font-size: 0.85rem;
  color: #a07a78;
  line-height: 1.6;
}

/* Privacy note */
.privacy-note {
  font-size: 0.72rem;
  color: #b89695;
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}
