/* =======================================================================
   หน้าสมัครใช้งาน (public/signup.html · migration 0010) — เสริม /landing.css (ใช้ token สี / ปุ่ม / ส่วนหัว / ท้ายหน้าชุดเดียวกัน)
   ธีมสว่าง + มืดตาม prefers-color-scheme · ออกแบบที่ 375px ก่อน · ไม่เลื่อนข้าง
   สไตล์ฟอร์ม (การ์ด · ช่องกรอก · ข้อความผิด · ช่องติ๊ก · ช่องกับดัก · กล่องสำเร็จ) อยู่ไฟล์นี้ — หน้าแรกไม่มีฟอร์มแล้ว
     (ฟอร์มผู้สนใจเลิก 12 ต.ค. 2569 · หน้าสมัครเป็นหน้าเดียวที่ใช้) · tests/ui-signup.test.js ตรวจว่าทุก class / token ที่หน้านี้ใช้มีสไตล์
   ======================================================================= */

/* token ของฟอร์ม (landing.css ไม่มีแล้ว) · ตัวอักษร / ขอบผ่าน WCAG AA ทั้ง 2 ธีม */
:root {
  --field-line: #7c857e; /* ขอบช่องกรอก ≥ 3:1 กับพื้นขาว */
  --danger: #b42318;
  --danger-soft: #fdecea;
  --success-soft: #eef8dc;
}
@media (prefers-color-scheme: dark) {
  :root {
    --field-line: #6b746d;
    --danger: #ff8a80;
    --danger-soft: #2a1514;
    --success-soft: #1b2410;
  }
}

/* ---------- ฟอร์ม ---------- */
.lp-form-card {
  min-width: 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
@media (min-width: 48em) {
  .lp-form-card { padding: 28px; }
}
.lp-form { display: grid; gap: 14px; }
.lp-field { display: grid; gap: 6px; min-width: 0; }
.lp-field-row { display: grid; gap: 14px; }
@media (min-width: 35em) {
  .lp-field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.lp-field label { font-weight: 600; font-size: 0.9375rem; }
/* ช่องกรอกสูง ≥ 44px · ตัวอักษร 16px (iOS ไม่ซูมตอนแตะ) */
.lp input[type="text"],
.lp input[type="tel"],
.lp input[type="email"],
.lp input[type="password"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--field-line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.lp [aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
.lp-field-error { margin: 0; color: var(--danger); font-size: 0.875rem; font-weight: 600; }
.lp-field-error:empty { display: none; }
.lp-check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400 !important; cursor: pointer; }
.lp-check input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--green-deco); }
/* ช่องกับดัก: ซ่อนนอกจอ (คนไม่เห็น · ข้ามด้วย tab) — ห้ามเห็นบนจอ ไม่งั้นคนกรอกแล้วระบบถือเป็นบอท (ตอบสำเร็จแต่ไม่สร้างบัญชี) */
.lp-trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.lp-alert {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 600;
}
.lp-alert:empty { display: none; }
.lp-success {
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
}
.lp-success-title { margin: 0; font-size: 1.25rem; font-weight: 800; }
/* ปุ่มสมัครระหว่างรอสคริปต์ / ระหว่างส่ง */
.lp-btn:disabled,
.lp-btn[aria-busy="true"] { opacity: 0.6; cursor: not-allowed; filter: none; }

.su-section { padding-top: 32px; }
.su-grid { display: grid; grid-template-areas: "intro" "form" "after"; gap: 24px; align-items: start; }
.su-intro { grid-area: intro; min-width: 0; }
.su-card { grid-area: form; }
.su-after { grid-area: after; min-width: 0; }
@media (min-width: 56em) {
  .su-section { padding-top: 56px; }
  .su-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    grid-template-areas: "intro form" "after form";
    grid-template-rows: auto 1fr;
    gap: 8px 48px;
  }
}

.su-title { margin: 0 0 8px; font-size: clamp(1.625rem, 6vw, 2.25rem); font-weight: 800; line-height: 1.25; }
.su-lead { color: var(--ink-soft); font-size: 1.0625rem; }
.su-h2 { margin: 8px 0 10px; font-size: 1.125rem; font-weight: 800; }

.su-price {
  margin: 20px 0 0;
  padding: 16px 18px;
  background: var(--surface);
  border: 2px solid var(--green-deco);
  border-radius: var(--radius);
}
.su-price-line { margin: 0; line-height: 1.1; }
.su-price-num { font-size: 2.5rem; font-weight: 800; }
.su-price-unit { font-weight: 700; color: var(--ink-soft); }
.su-price-note { margin: 6px 0 0 !important; color: var(--green); font-weight: 700; font-size: 0.9375rem; }

.su-next { display: grid; gap: 10px; margin: 0 0 16px; padding: 0; list-style: none; counter-reset: su-next; }
.su-next li {
  position: relative;
  min-height: 32px;
  padding-left: 44px;
  color: var(--ink-soft);
  counter-increment: su-next;
}
.su-next li::before {
  content: counter(su-next);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 800;
}
.su-next strong { color: var(--ink); }
.su-need { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-alt); }

.su-help { margin: 0 !important; color: var(--muted); font-size: 0.875rem; }
.su-show { margin-top: 4px; font-size: 0.9375rem; }
.su-accept .lp-check span { line-height: 1.6; }
.su-login { margin: 4px 0 0 !important; text-align: center; }

/* เบราว์เซอร์นี้ล็อกอินบัญชีอื่นอยู่ → แจ้งก่อนสมัคร (signup.js checkSession) */
.su-session { display: grid; gap: 8px; margin: 0 0 16px; padding: 14px 16px; border: 2px solid var(--lime); border-radius: var(--radius-sm); background: var(--surface-alt); }
.su-session[hidden] { display: none; }
.su-session-title { margin: 0; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; }
.su-session-text { margin: 0; color: var(--ink-soft); }
.su-session-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.su-session-continue { background: var(--surface); color: var(--ink); border-color: var(--ink-soft); }
