﻿/* หน้าติดต่อปรึกษากฎหมาย — ใช้โทเคนจาก site.css (รองรับโหมดมืดอัตโนมัติ) */
.ct-main { padding-bottom: clamp(56px, 9vw, 110px); min-height: 70vh; }
.ct-hero { text-align: center; padding: clamp(36px, 6vw, 72px) 0 clamp(24px, 4vw, 40px); }
.ct-hero h1 { font-size: clamp(34px, 6vw, 60px); }
.ct-hero .lead { margin-top: 14px; }

.ct-cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.ct-card { background: var(--bg-alt); border-radius: 28px; padding: clamp(22px, 3.4vw, 36px); }
.ct-card form[hidden], .ct-done[hidden] { display: none; }

.ct-row, .ct-grid2, .ct-grid3, .ct-set { margin: 0 0 20px; }
.ct-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ct-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ct-f { display: grid; gap: 6px; align-content: start; min-width: 0; }
.ct-f > label, .ct-set > legend { font-size: 15px; font-weight: 600; line-height: 1.4; }
.ct-f > label small { font-weight: 400; color: var(--ink-3); font-size: 13px; }
.ct-f em, .ct-set em, .ct-chk em { font-style: normal; color: var(--err); margin-left: 2px; }
.ct-set { border: 0; padding: 0; min-width: 0; }
.ct-set > legend { padding: 0; margin-bottom: 2px; }
.ct-set .ct-grid3 { margin-top: 10px; }
.ct-set .ct-f > label { font-weight: 500; font-size: 14px; color: var(--ink-2); }

.ct-card input[type=text], .ct-card input[type=tel], .ct-card input[type=email], .ct-card input[type=date], .ct-card select, .ct-card textarea {
  width: 100%; border: 0; background: var(--card); color: var(--ink); border-radius: 12px; padding: 12px 14px; font-size: 16px; line-height: 1.5;
  box-shadow: 0 0 0 1px var(--line) inset; transition: box-shadow .2s; font-family: inherit; }
.ct-card textarea { resize: vertical; min-height: 150px; line-height: 1.65; }
.ct-card input::placeholder, .ct-card textarea::placeholder { color: var(--ink-3); }
.ct-card input:hover, .ct-card select:hover, .ct-card textarea:hover { box-shadow: 0 0 0 1px var(--ink-3) inset; }
.ct-card input:focus-visible, .ct-card select:focus-visible, .ct-card textarea:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 55%, transparent); }
.ct-card [aria-invalid=true] { box-shadow: 0 0 0 2px var(--err) inset !important; }
.ct-card select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2386868b' stroke-width='2'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
.ct-card select option { color: #1d1d1f; background: #fff; }
.ct-card input[type=date] { min-height: 48px; }

.ct-hint, .ct-count { font-size: 13px; line-height: 1.55; color: var(--ink-3); }
.ct-meta { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.ct-count { flex: none; font-variant-numeric: tabular-nums; }
.ct-count.near { color: var(--crim); font-weight: 600; }
.ct-err { font-size: 13.5px; line-height: 1.5; color: var(--err); font-weight: 500; }
.ct-warn { font-size: 13.5px; line-height: 1.6; color: var(--ink); background: color-mix(in srgb, var(--crim) 11%, transparent); border-radius: 12px; padding: 9px 13px; }
.ct-warn[hidden], .ct-err[hidden] { display: none; }

.ct-alert { margin: 0 0 20px; padding: 14px 18px; border-radius: 16px; background: color-mix(in srgb, var(--err) 10%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--err) 35%, transparent) inset; font-size: 14.5px; line-height: 1.6; }
.ct-alert:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 60%, transparent); outline-offset: 2px; }
.ct-alert ul { margin: 6px 0 0; padding-left: 1.3em; }
.ct-alert a { color: var(--err); text-decoration: underline; text-underline-offset: 2px; }

.ct-consent { margin: 4px 0 22px; }
.ct-chk { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 14.5px; line-height: 1.65; color: var(--ink-2); }
.ct-chk input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--blue); cursor: pointer; }
.ct-chk a { text-decoration: underline; text-underline-offset: 2px; }
.ct-consent .ct-err { display: block; margin: 6px 0 0 34px; }

.ct-actions { display: flex; gap: 14px 18px; align-items: center; flex-wrap: wrap; }
.ct-actions .btn-pill { min-width: 170px; }
.ct-actions .btn-pill:disabled { opacity: .65; cursor: progress; transform: none; }
.ct-actions .btn-pill.busy::after { content: ''; width: 15px; height: 15px; margin-left: 10px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: ct-spin .8s linear infinite; }
.ct-status { margin: 0; font-size: 14.5px; color: var(--ink-2); min-height: 1.5em; }
.ct-status.err { color: var(--err); font-weight: 500; }
.ct-fine { margin: 14px 0 0; }
@keyframes ct-spin { to { transform: rotate(360deg); } }

/* ช่องล่อบอท: นอกจอ ไม่ใช้ display:none เพื่อให้บอทยังเห็น */
.ct-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ส่งสำเร็จ */
.ct-done { text-align: center; padding: clamp(20px, 5vw, 44px) clamp(4px, 2vw, 16px); }
.ct-done { scroll-margin-top: 90px; }
.ct-done:focus-visible { outline: none; }
.ct-done h2 { font-size: clamp(26px, 4vw, 36px); margin: 14px 0 10px; }
.ct-done p { margin: 0 auto 10px; max-width: 32em; color: var(--ink-2); font-size: 16.5px; line-height: 1.7; }
.ct-done .ct-done-sub { font-size: 14.5px; }
.ct-done-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.ct-check { width: 72px; height: 72px; color: var(--ok); }
.ct-check .ring { stroke-dasharray: 140; stroke-dashoffset: 140; animation: ct-draw .7s var(--ease) forwards; }
.ct-check .tick { stroke-dasharray: 40; stroke-dashoffset: 40; animation: ct-draw .5s var(--ease) .5s forwards; }
@keyframes ct-draw { to { stroke-dashoffset: 0; } }

/* คอลัมน์ข้อมูลประกอบ */
.ct-aside { display: grid; gap: 14px; position: sticky; top: 64px; }
.ct-box { background: var(--bg-alt); border-radius: 24px; padding: 22px 24px; }
.ct-box h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 12px; }
.ct-box p { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--ink-2); }
.ct-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: cs; }
.ct-steps li { position: relative; padding-left: 38px; counter-increment: cs; display: grid; gap: 1px; font-size: 14.5px; line-height: 1.6; }
.ct-steps li::before { content: counter(cs); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.ct-steps span { color: var(--ink-2); }
.ct-list { margin: 0; padding-left: 1.2em; display: grid; gap: 7px; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.ct-list.plain { list-style: none; padding: 0; }
.ct-list.plain span { color: var(--ink-3); margin-right: 4px; }
.ct-urgent { background: color-mix(in srgb, var(--crim) 10%, var(--bg-alt)); }
.ct-urgent a b { font-size: 17px; }

@media (max-width: 900px) {
  .ct-cols { grid-template-columns: 1fr; }
  .ct-aside { position: static; }
}
@media (max-width: 640px) {
  .ct-grid2, .ct-grid3 { grid-template-columns: 1fr; }
  .ct-card { border-radius: 24px; }
  .ct-actions .btn-pill { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .ct-check .ring, .ct-check .tick { animation: none; stroke-dashoffset: 0; }
  .ct-actions .btn-pill.busy::after { animation-duration: 2s; }
}

/* ==========================================================================
   มือถือ (portrait) — ฟอร์มติดต่อปรึกษา: คอลัมน์เดียว ช่องกรอกใหญ่ กดนิ้วโป้งได้สบาย
   ========================================================================== */
@media (max-width: 900px) { .ct-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .ct-main { padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px)); }
  .ct-hero { padding: 28px 0 20px; }
  .ct-hero h1 { font-size: clamp(30px, 8.8vw, 40px); }
  .ct-cols { gap: 14px; }
  .ct-card { padding: 22px 16px 20px; border-radius: 24px; }
  .ct-row, .ct-grid2, .ct-grid3, .ct-set { margin-bottom: 18px; }
  .ct-f > label, .ct-set > legend { font-size: 16px; }
  .ct-set .ct-f > label { font-size: 15px; }
  .ct-f > label small { font-size: 14px; }
  .ct-card input[type=text], .ct-card input[type=tel], .ct-card input[type=email], .ct-card input[type=date], .ct-card select, .ct-card textarea { min-height: 52px; padding: 13px 14px; border-radius: 14px; font-size: 16px; }
  .ct-card input[type=date] { -webkit-appearance: none; appearance: none; display: block; min-height: 52px; }
  .ct-card textarea { min-height: 170px; }
  .ct-hint, .ct-count { font-size: 14px; }
  .ct-err, .ct-warn { font-size: 14.5px; }
  .ct-alert { font-size: 15px; padding: 14px 16px; }
  .ct-chk { font-size: 15.5px; gap: 14px; min-height: 44px; }
  .ct-chk input { width: 26px; height: 26px; margin-top: 0; }
  .ct-consent .ct-err { margin-left: 40px; }
  .ct-actions { flex-direction: column; align-items: stretch; gap: 12px; }
  .ct-actions .btn-pill { min-height: 54px; font-size: 18px; width: 100%; }
  .ct-status { text-align: center; }
  .ct-fine { font-size: 14px; }
  .ct-box { padding: 20px 18px; border-radius: 22px; }
  .ct-box p, .ct-steps li, .ct-list { font-size: 15.5px; }
  .ct-urgent a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
  .ct-done-actions .btn-pill { width: 100%; }
}

/* ไฮไลต์เล็กน้อยที่เหลือ: ลิงก์ในกล่องแจ้งข้อผิดพลาดของฟอร์ม และขอบจอที่มีรอยบากเมื่อหมุนจอ */
@media (max-width: 760px) {
  .ct-alert li { margin-bottom: 2px; }
  .ct-alert a { display: inline-block; padding: 10px 0; }
}