/* T-0032 — หน้าติดต่อ + หน้าขอบคุณ v2 (design-v2/Contact.dc.html)
   โหลดต่อจาก style.css — ใช้ token --v2-* จาก style.css, header/footer/bar ใช้ของ T-0028 ตามเดิม */

/* ---------- layout: ฟอร์มซ้าย + ช่องทางติดต่อขวา ---------- */
.ct-sec {
  background: var(--v2-soft);
  padding: 56px 0 96px;
}
.ct-grid {
  display: grid;
  /* T-0060: สัดส่วน/ระยะใหม่ — ฟอร์มการ์ดแคบกว่าครึ่งจอทุกความกว้าง ≥768 (ตรวจขอบแนวหัวเว็บ) */
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.ct-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 36px;
  display: grid;
  gap: 28px;
}

/* ---------- ฟิลด์ฟอร์ม ---------- */
.ct-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.ct-pair-lg { gap: 24px; }
.ct-label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 16px;
  color: var(--v2-ink);
}
.ct-hint {
  color: var(--v2-muted);
  font-weight: 400;
  font-size: 14px;
  margin-top: -6px;
}
.ct-hint-clay { color: var(--v2-clay); }
.ct-in {
  min-height: 52px;
  border: 1.5px solid var(--v2-line);
  border-radius: 12px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 17px;
  color: var(--v2-ink);
  background: #ffffff;
  transition: border-color .2s, box-shadow .2s;
}
.ct-in:focus {
  outline: none;
  border-color: var(--v2-navy);
  box-shadow: 0 0 0 4px rgba(28, 75, 128, .12);
}
.ct-in.is-bad { border-color: #a3401f; }
.ct-area {
  min-height: 0;
  padding: 12px 16px;
  resize: vertical;
  line-height: 1.75;
}
.ct-err {
  margin: -12px 0 0;
  color: #a3401f;
  font-size: 15px;
}

/* ---------- chips (radio จริง ใช้ได้ไม่ต้องมี JS) ---------- */
.ct-set {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.ct-legend {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 10px;
  padding: 0;
  color: var(--v2-ink);
}
.ct-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ct-radio {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.ct-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: 99px;
  padding: 0 16px;
  font-size: 15px;
  background: #ffffff;
  color: var(--v2-ink);
  border: 1.5px solid var(--v2-line);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.ct-chip:hover { border-color: var(--v2-navy); }
.ct-radio:checked + .ct-chip {
  background: var(--v2-navy);
  color: #ffffff;
  border-color: var(--v2-navy);
}
.ct-radio:focus-visible + .ct-chip {
  border-color: var(--v2-navy);
  box-shadow: 0 0 0 4px rgba(28, 75, 128, .12);
}

/* ---------- T-0059 — ดาวจำเป็น + ชิป "ดูเพิ่ม" + ส่วนพับรายละเอียด ---------- */
.ct-req { color: var(--v2-clay); font-weight: 700; }

.ct-more { width: 100%; }
.ct-more-sum {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 99px;
  border: 1.5px dashed var(--v2-navy);
  background: #ffffff;
  color: var(--v2-navy);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.ct-more-sum::-webkit-details-marker { display: none; }
.ct-more-sum:focus-visible {
  outline: 2px solid var(--v2-navy);
  outline-offset: 2px;
}
.ct-more-ic { transition: transform .2s; }
.ct-more[open] > summary { display: none; }
.ct-more[open] .ct-more-chips { margin-top: 8px; }

.ct-fold {
  border: 1.5px solid var(--v2-navy);
  border-radius: 16px;
  background: #ffffff;
}
.ct-fold-sum {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 16px;
  cursor: pointer;
  color: var(--v2-navy);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.5;
  list-style: none;
}
.ct-fold-sum::-webkit-details-marker { display: none; }
.ct-fold-sum:focus-visible {
  outline: 2px solid var(--v2-navy);
  outline-offset: 2px;
}
.ct-fold-txt { display: grid; }
.ct-fold-sub {
  font-weight: 400;
  font-size: 14px;
  color: var(--v2-muted);
}
.ct-fold-ic { flex: none; transition: transform .2s; }
.ct-fold[open] .ct-fold-ic { transform: rotate(45deg); }
.ct-fold-in {
  display: grid;
  gap: 16px;
  padding: 16px;
  border-top: 1.5px solid var(--v2-line);
}

/* ---------- กล่องแนบรูป ---------- */
.ct-photo {
  border: 1.5px dashed #c9d2de;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.ct-photo-ic { flex: none; }
.ct-photo-label {
  flex: 1;
  min-width: 200px;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
}
.ct-photo-label b { color: var(--v2-navy); font-weight: 700; }
.ct-hint-s { font-size: 14px; color: var(--v2-muted); }
.ct-file {
  display: block;
  margin-top: 8px;
  min-height: 44px;
  font-family: inherit;
  font-size: 14px;
}

/* ---------- ยินยอม + ปุ่มส่ง ---------- */
.ct-consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
  color: var(--v2-muted);
  cursor: pointer;
  min-height: 44px;
}
.ct-consent input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--v2-navy);
  flex: none;
}
.ct-submit {
  min-height: 56px;
  border: 0;
  background: var(--v2-clay);
  color: #ffffff;
  border-radius: 99px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  justify-self: start;
  width: fit-content;
  padding: 0 40px;
  transition: transform .2s cubic-bezier(.2, .7, .2, 1), box-shadow .2s;
}
.ct-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -10px rgba(185, 87, 53, .7);
}

/* ---------- คอลัมน์ขวา: ติดต่อตรง ---------- */
@media (min-width: 821px) {
  .ct-aside {
    position: sticky;
    top: 96px;
  }
}
.ct-aside { display: grid; gap: 16px; }
.ct-aside-h {
  font-size: 20px;
  margin: 0;
  color: var(--v2-ink);
}
.ct-way {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--v2-ink);
  background: #ffffff;
  border: 1.5px solid var(--v2-line);
  border-radius: 18px;
  padding: 18px 20px;
  transition: border-color .2s, transform .2s;
}
.ct-way:hover {
  border-color: var(--v2-navy);
  transform: translateX(4px);
}
.ct-way-ic {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.ct-way-ic-clay { background: var(--v2-clay-tint); }
.ct-way-ic-navy { background: #e4ecf6; }
.ct-way-txt b {
  display: block;
  font-size: 20px;
  line-height: 1.4;
}
.ct-way-txt span { font-size: 14px; color: var(--v2-muted); }
.ct-next {
  background: #ffffff;
  border-radius: 18px;
  padding: 24px;
  margin-top: 8px;
}
.ct-next-h {
  font-size: 18px;
  margin: 0 0 14px;
  color: var(--v2-ink);
}
.ct-next-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}
.ct-next-list li { display: flex; gap: 12px; }
.ct-next-list b { color: var(--v2-clay); font-weight: 700; flex: none; }
.ct-co {
  font-size: 14px;
  color: var(--v2-muted);
  margin: 4px 0 0;
}

/* ---------- หน้าขอบคุณ (sent state) ---------- */
.ty-sec {
  background: var(--v2-soft);
  padding: 88px 0 104px;
  animation: ty-fade .5s cubic-bezier(.2, .7, .2, 1) both;
}
.ty-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 32px;
  text-align: center;
}
.ty-tick {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--v2-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  animation: ty-pop .6s cubic-bezier(.2, .9, .3, 1.4) both;
}
.ty-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  text-align: left;
  margin-bottom: 40px;
}
.ty-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 22px;
}
.ty-card b { color: var(--v2-clay); font-weight: 700; }
.ty-card p { margin: 4px 0 0; }
.ty-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.ty-btn {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  background: var(--v2-clay);
  color: #ffffff;
  text-decoration: none;
  padding: 0 28px;
  border-radius: 99px;
  font-weight: 700;
  transition: transform .2s cubic-bezier(.2, .7, .2, 1), box-shadow .2s;
}
.ty-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -10px rgba(185, 87, 53, .7);
  color: #ffffff;
}
.ty-back {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  background: none;
  border: 0;
  color: var(--v2-muted);
  font-family: inherit;
  font-size: 15px;
  text-decoration: underline;
  cursor: pointer;
}
@keyframes ty-fade {
  from { opacity: 0; transform: translateY(.6em); }
  to { opacity: 1; transform: none; }
}
@keyframes ty-pop {
  from { transform: scale(.4); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ---------- มือถือ ≤820px (T-0059: ฟอร์มกระชับ เห็นครบจอเดียว) ---------- */
@media (max-width: 767px) {
  .ct-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 820px) {
  .ct-card { padding: 20px 16px; gap: 16px; }
  .ct-pair { grid-template-columns: 1fr 1fr; gap: 12px; }
  .ct-pair-lg { grid-template-columns: 1fr; gap: 16px; }
  .ct-label { font-size: 15px; gap: 4px; }
  .ct-in { min-height: 48px; font-size: 16px; }
  .ct-legend { font-size: 15px; margin-bottom: 8px; }
  .ct-chip { min-height: 44px; padding: 0 14px; }
  .ct-photo { padding: 14px; gap: 12px; }
  .ct-consent { font-size: 14px; }
  .ct-submit { width: 100%; min-height: 52px; padding: 0 24px; }
  .ty-wrap { padding: 0 var(--gutter); } /* T-0060: ขอบตามแนวหัวเว็บ */
  .ty-cards { grid-template-columns: 1fr; gap: 16px; }
  .ct-photo-label a, .ct-consent a {
    display: inline-block;
    padding-block: 11px;
    line-height: 1.6;
  }
}
@media (max-width: 359px) {
  .ct-pair { grid-template-columns: 1fr; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .ty-sec, .ty-tick { animation: none; }
  .ct-submit, .ty-btn, .ct-way { transition: none; }
}
