/* ============================================================
   FIVE G Youth Camp — หน้าลงทะเบียน (index.php)
   ต้องโหลด base.css ก่อนไฟล์นี้
   ============================================================ */

/* ── กำหนดปิดรับสมัครบนหัวฟอร์ม ─────────────────────────────── */

.deadline-note{
  display: inline-block;
  margin-top: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  border-radius: 999px;
  font-size: 12.5px;
  background: rgba(74,125,255,0.12);
  border: 1px solid rgba(74,125,255,0.3);
  color: #bdd0ff;
}
.deadline-note.urgent{
  background: rgba(255,138,61,0.12);
  border-color: rgba(255,138,61,0.35);
  color: #ffc79a;
  font-weight: 600;
}

/* ── หน้าจอเมื่อปิดรับลงทะเบียน ─────────────────────────────── */

.closed-state{
  display: none;
  background: var(--card);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.6);
}
.closed-state.show{ display: block; }

.closed-ring{
  width: 54px; height: 54px;
  margin: 0 auto var(--sp-4);
  border-radius: 50%;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.35);
  color: var(--red-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.closed-state h2{
  font-family: 'Anuphan', sans-serif;
  font-size: 20px;
  margin: 0 0 var(--sp-2);
}
.closed-state p{
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
}
.closed-state .closed-help{
  color: var(--faint);
  font-size: 12.5px;
  margin-top: var(--sp-4);
}

/* ── แถบสเตป ────────────────────────────────────────────────
   บอกสามอย่างพร้อมกัน: อยู่ขั้นไหน · เหลืออีกกี่ขั้น · ขั้นไหนกรอกครบแล้ว
   ของเดิมเป็นแถบเปอร์เซ็นต์ ซึ่งบอกแค่ "ยังไม่เสร็จ" ไม่ได้บอกว่าเหลืออะไร
   ซ่อนไว้ด้วย hidden จนกว่า JS จะเปิด — ไม่มี JS ฟอร์มเป็นหน้าเดียวยาวตามเดิม */

.stepper{ margin-bottom: var(--sp-5); }
.stepper ol{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.st{
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding-top: var(--sp-1);
  color: var(--faint);
  cursor: default;
}
/* ขั้นที่เคยไปถึงแล้ว กดย้อนกลับไปแก้ได้ */
.st.is-open{ cursor: pointer; }

/* เส้นเชื่อมระหว่างจุด วาดจากจุดนี้ไปทางซ้าย จะได้ไม่มีเส้นโผล่หัวท้าย
   หยุดที่ขอบวงกลมพอดี (รัศมี 13px + เว้น 4px) ไม่ลากลอดใต้วงกลม
   เพราะพื้นหลังวงกลมเป็น rgba โปร่งแสง เส้นที่ลอดอยู่ข้างใต้จะทะลุออกมา
   เห็นเป็นขีดพาดกลางเครื่องหมายถูก */
.st + .st::before{
  content: '';
  position: absolute;
  top: calc(var(--sp-1) + 12px);
  right: calc(50% + 17px);
  left: calc(-50% + 17px);
  height: 2px;
  border-radius: 2px;
  background: var(--field-border);
}
.st.is-done::before, .st.is-now::before{ background: rgba(74,125,255,0.45); }

.st-dot{
  position: relative;
  z-index: 1;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--field);
  border: 1px solid var(--field-border);
  font-family: 'Anuphan', sans-serif;
  font-weight: 700;
  font-size: 12px;
  transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.st-name{
  font-size: 11.5px;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: break-word;
  min-width: 0;
}

/* ขั้นที่กำลังกรอก — เด่นที่สุดบนแถบ */
.st.is-now .st-dot{
  background: rgba(74,125,255,0.16);
  border-color: var(--electric-blue);
  color: var(--electric-blue);
  box-shadow: 0 0 0 4px rgba(74,125,255,0.12);
}
.st.is-now .st-name{ color: var(--white); font-weight: 600; }

/* ขั้นที่ผ่านแล้วและกรอกครบ — เปลี่ยนเลขเป็นเครื่องหมายถูก
   ใช้ CSS วาดเอาเอง ไม่แตะ DOM จะได้ไม่ต้องสลับข้อความไปมาในสคริปต์ */
.st.is-done .st-dot{
  background: rgba(60,203,127,0.14);
  border-color: rgba(60,203,127,0.45);
  color: transparent;
}
.st.is-done .st-dot::after{
  content: '';
  position: absolute;
  width: 5px; height: 9px;
  margin-top: -2px;
  border-right: 2px solid var(--g4);
  border-bottom: 2px solid var(--g4);
  transform: rotate(45deg);
}
.st.is-done .st-name{ color: var(--muted); }

.stepper-now{
  margin: var(--sp-3) 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ── การ์ดหนึ่งหมวด ─────────────────────────────────────────
   ก่อนหน้านี้ห้าหมวดไหลติดกันเป็นพืดเดียว ไม่มีอะไรบอกว่าหมวดหนึ่งจบตรงไหน */
.step{ animation: step-in .22s ease both; }
@keyframes step-in{
  from{ opacity: 0; transform: translateY(6px); }
  to{ opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce){
  .step{ animation: none; }
}

/* ── ปุ่มเดินสเตป ───────────────────────────────────────────
   อยู่ใต้หมวดที่กำลังกรอก คือตรงที่มือหยุดพิมพ์พอดี
   "ถัดไป" กินพื้นที่มากกว่าเพราะเป็นทางที่คนเก้าในสิบจะไป */
/* ปุ่มย้อนกลับกว้างเท่าข้อความ ที่เหลือยกให้ปุ่มที่พาไปข้างหน้า
   (ถัดไป หรือ ส่งข้อมูล) ซึ่งเป็นทางที่คนเก้าในสิบจะกด
   ขั้นแรกไม่มีปุ่มย้อนกลับ ขั้นสุดท้ายไม่มีปุ่มถัดไป — flex จัดให้เอง
   ไม่มีขั้นไหนที่ปุ่มลอยอยู่ครึ่งแถวแล้วอีกครึ่งว่างเปล่า */
.step-nav{
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.step-nav > .ghost{ flex: 0 0 auto; }
.step-nav > .next,
.step-nav > .submit-btn{ flex: 1 1 auto; width: auto; }

.step-btn{
  min-height: var(--control-height, 48px);
  padding: var(--sp-3) var(--sp-5);
  border-radius: 12px;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s ease, border-color .15s ease, background .15s ease;
}
.step-btn.next{
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--electric-blue), #7b5cff);
  box-shadow: 0 10px 24px -12px rgba(74,125,255,0.9);
}
.step-btn.next:hover{ filter: brightness(1.08); }
.step-btn.ghost{
  background: transparent;
  border: 1px solid var(--field-border);
  color: var(--muted);
}
.step-btn.ghost:hover{ border-color: var(--field-border-focus); color: var(--white); }
/* ── การ์ดข้อมูลสุขภาพ (โทนแดง) ─────────────────────────────── */

.card-health{ border-color: rgba(239,68,68,0.28); }
.num-health{
  background: rgba(239,68,68,0.14) !important;
  border-color: rgba(239,68,68,0.4) !important;
  color: var(--red) !important;
}

/* ── ช่องกรอกข้อมูล ────────────────────────────────────────── */

.field{ margin-bottom: var(--sp-4); }
.field:last-child{ margin-bottom: 0; }

.field-label{
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: var(--sp-2);
}
.field-label .req{ color: var(--red); margin-left: var(--sp-1); }
.field-label .opt{ color: var(--faint); font-weight: 400; margin-left: var(--sp-1); }

/* password เพิ่มเข้ามาตอนทำฟอร์มลงทะเบียนทีมงาน ซึ่งเป็นหน้าแรกที่มีช่องรหัสผ่าน
   ฟอร์มของเด็กไม่มีช่องนี้ กฎเดิมจึงไม่ครอบคลุม แล้วช่องรหัสผ่านออกมาแคบกว่าช่องอื่น */
input[type=text],
input[type=tel],
input[type=date],
input[type=password],
select,
textarea{
  width: 100%;
  background: var(--field);
  border: 1px solid var(--field-border);
  border-radius: 10px;
  padding: var(--sp-3) var(--sp-3);
  font-family: 'IBM Plex Sans Thai', sans-serif;
  font-size: 14.5px;
  color: var(--white);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder{ color: var(--faint); }

input:focus, select:focus, textarea:focus{
  border-color: var(--field-border-focus);
  box-shadow: 0 0 0 3px rgba(74,125,255,0.18);
}

textarea{
  resize: vertical;
  min-height: 64px;
  font-family: 'IBM Plex Sans Thai', sans-serif;
}

select{
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239a9aab' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: var(--sp-6);
}
select:invalid, select option[value=""]{ color: var(--faint); }

/* ── ช่องวันที่ วัน / เดือน / ปี พ.ศ. ───────────────────────────
   สามช่องในแถวเดียวเสมอ ไม่แตกบรรทัดไม่ว่าจอแคบแค่ไหน
   เพราะลำดับที่คนอ่านคือ วัน → เดือน → ปี ติดกัน พอแตกเป็นสองบรรทัด
   สายตาต้องกระโดดกลับขึ้นไปอ่านใหม่ และดูเหมือนคนละคำถามสองคำถาม

   ไม่แบ่งสามส่วนเท่ากัน — "กุมภาพันธ์" ยาวกว่า "31" หลายเท่า
   ถ้าเท่ากันหมด ช่องเดือนจะตัดคำทิ้งทั้งที่ช่องวันเหลือที่ว่างครึ่งช่อง */
.date-parts{ display: flex; gap: var(--sp-2); }
.date-parts select:nth-child(1){ flex: 0 1 22%; }
.date-parts select:nth-child(2){ flex: 1 1 46%; }
.date-parts select:nth-child(3){ flex: 0 1 32%; }

/* ลูกศรของ select กินที่ทางขวา ต้องเผื่อ padding ให้พอ ไม่งั้นตัวหนังสือ
   ไปซ้อนลูกศร — แต่เผื่อมากไปช่องเดือนก็ตัดคำ จึงบีบทั้งลูกศรและระยะเผื่อ
   ให้แคบกว่า select ปกติ เฉพาะในกล่องนี้

   min-width: 0 จำเป็นกับ flex item ที่เป็น select — ค่าตั้งต้นคือ auto
   ซึ่งแปลว่า "ห้ามแคบกว่าเนื้อหา" สามช่องจึงดันกันจนล้นออกนอกกล่อง */
.date-parts select{
  min-width: 0;
  padding-left: var(--sp-2);
  padding-right: 22px;
  background-position: right 6px center;
  text-overflow: ellipsis;
}

/* ── ฟอร์มนี้ของใคร ─────────────────────────────────────────────
   สองฟอร์มใช้หน้าตาชุดเดียวกัน ทีมงานจึงกรอกผิดฟอร์มกันจริง
   กล่องนี้อยู่บนสุดของทั้งสองฟอร์ม คนละสี — ฟ้าสำหรับฟอร์มเด็ก
   เหลืองสำหรับฟอร์มทีมงาน คนที่เปิดสองลิงก์สลับกันจะเห็นว่าไม่ใช่หน้าเดียวกัน */
.audience{
  margin: 0 0 var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border-left: 4px solid;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.audience b{ color: var(--white); font-size: 15px; }
.audience a{ color: inherit; text-decoration: underline; }
.audience-kid{ border-color: #4a7dff; background: rgba(74,125,255,0.10); }
.audience-staff{ border-color: var(--g3); background: rgba(244,196,48,0.10); }

/* อายุ ณ วันค่าย ใต้ช่องวันเกิด — ตัวเล็ก สีจาง เพราะเป็นข้อมูลยืนยัน
   ไม่ใช่คำเตือน ว่างไว้จนกว่าจะเลือกครบสามช่อง จึงไม่กินที่ตอนยังไม่กรอก */
.date-age{ margin: var(--sp-1) 0 0; font-size: 13px; color: var(--muted); min-height: 1.2em; }

/* ช่องยืนยันเมื่ออายุไม่เข้ากับชั้น — สีเหลืองเตือน ไม่ใช่สีแดง
   เพราะยังไม่ใช่ความผิด แค่ต้องดูอีกครั้ง (เด็กซ้ำชั้น/ข้ามชั้นมีจริง) */
.age-confirm{
  padding: var(--sp-3);
  border: 1px solid rgba(244,196,48,0.45);
  border-radius: var(--r-md);
  background: rgba(244,196,48,0.08);
}
.age-warn{ margin: 0 0 var(--sp-2); font-size: 14px; color: var(--g3); line-height: 1.5; }

/* จอแคบสุดที่ยังเจอจริง (iPhone SE = 320px)
   ที่ความกว้างนั้นสามช่องรวมกันเหลือ 254px ซึ่งพอดีตัว วัดแล้วต้องบีบ
   ทั้งระยะห่างและที่เผื่อลูกศรลงอีก ไม่งั้นข้อความบอกใบ้ "วัน" กับ "ปี พ.ศ."
   โดนตัดตั้งแต่ยังไม่ได้เลือกอะไร ซึ่งเป็นสิ่งที่คนเห็นก่อนเสมอ

   สัดส่วนต่างจากจอปกติด้วย — เดือนมีที่เหลือเฟือที่ 320px จึงยกให้วันกับปี
   ยังเป็นแถวเดียวเหมือนเดิม ไม่แตกบรรทัด */
@media (max-width: 360px){
  .date-parts{ gap: var(--sp-1); }
  .date-parts select{ padding-left: var(--sp-1); padding-right: 19px; background-position: right 4px center; }
  .date-parts select:nth-child(1){ flex: 0 1 23%; }
  .date-parts select:nth-child(2){ flex: 1 1 43%; }
  .date-parts select:nth-child(3){ flex: 0 1 34%; }
}

.hint{
  font-size: 12px;
  color: var(--faint);
  margin-top: var(--sp-1);
  line-height: 1.5;
}

.grid-2{ display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
@media (max-width: 480px){ .grid-2{ grid-template-columns: 1fr; } }

/* ── ตัวเลือกแบบปุ่ม (เพศ / ไซส์เสื้อ) ──────────────────────── */

.radio-row{ display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.radio-opt{ flex: 1 1 0; min-width: 64px; position: relative; }
.radio-opt input{
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  width: 100%; height: 100%;
  appearance: none;
  -webkit-appearance: none;
}
.radio-opt .box{
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--field-border);
  background: var(--field);
  border-radius: 10px;
  padding: var(--sp-3) var(--sp-1);
  text-align: center;
  font-size: 14px;
  white-space: nowrap;
  color: var(--muted);
  transition: all .15s ease;
}
.radio-opt input:checked + .box{
  border-color: var(--electric-blue);
  background: rgba(74,125,255,0.12);
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(74,125,255,0.14);
}
.radio-opt input:focus-visible + .box{
  border-color: var(--field-border-focus);
  box-shadow: 0 0 0 3px rgba(74,125,255,0.3);
}

/* ── ปุ่มเลือกเพศ ──────────────────────────────────────────────
   ใส่สัญลักษณ์ ♂ ♀ ให้กวาดตาเจอเร็วกว่าอ่านตัวหนังสือ
   และให้สีต่างกันตอนเลือกแล้ว จะได้เห็นชัดว่าเลือกอะไรไว้         */

.gender-row .box{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-1);
}
.gender-row .sym{
  font-size: 19px;
  line-height: 1;
  color: var(--faint);
  transition: color .15s ease;
}

/* ชาย = ฟ้า */
.gender-row .radio-opt:first-child input:checked + .box{
  border-color: #5aa9ff;
  background: rgba(90,169,255,0.14);
  box-shadow: 0 0 0 3px rgba(90,169,255,0.16);
}
.gender-row .radio-opt:first-child input:checked + .box .sym{ color: #7cc0ff; }

/* หญิง = ชมพู */
.gender-row .radio-opt:last-child input:checked + .box{
  border-color: #f472b6;
  background: rgba(244,114,182,0.14);
  box-shadow: 0 0 0 3px rgba(244,114,182,0.16);
}
.gender-row .radio-opt:last-child input:checked + .box .sym{ color: #f9a8d4; }

/* ── ตารางไซส์เสื้อ ────────────────────────────────────────── */

.size-table{
  border: 1px solid var(--field-border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: var(--sp-3);
}
.size-row{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  text-align: center;
  font-size: 12.5px;
  padding: var(--sp-2) var(--sp-1);
  color: var(--muted);
}
.size-row:not(:last-child){ border-bottom: 1px solid var(--field-border); }
.size-row.size-head{
  background: rgba(74,125,255,0.08);
  color: var(--white);
  font-weight: 600;
  font-family: 'Anuphan', sans-serif;
}
.size-radio-row{ gap: var(--sp-2); flex-wrap: nowrap; }
.size-radio-row .box{ padding: var(--sp-2) var(--sp-1); font-size: 13px; }

/* ── ช่องติ๊กความยินยอม ────────────────────────────────────── */

.check-opt{
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  cursor: pointer;
  position: relative;
}
.check-opt + .check-opt{ margin-top: var(--sp-4); }
.check-opt input{ position: absolute; opacity: 0; width: 0; height: 0; }

.check-box{
  flex: 0 0 20px;
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 1px solid var(--field-border);
  background: var(--field);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--sp-1);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.check-box svg{ opacity: 0; transition: opacity .15s ease; }
.check-opt input:checked + .check-box{
  background: var(--electric-blue);
  border-color: var(--electric-blue);
}
.check-opt input:checked + .check-box svg{ opacity: 1; }
.check-opt input:focus-visible + .check-box{ box-shadow: 0 0 0 3px rgba(74,125,255,0.3); }

.check-text{ font-size: 13.5px; line-height: 1.65; color: var(--muted); }
.check-text b{ color: var(--white); font-weight: 600; }
.check-text .req{ color: var(--red); }
.check-text .opt{ color: var(--faint); }

/* ── ข้อความผิดพลาด ────────────────────────────────────────── */

.field-msg{
  font-size: 12px;
  color: var(--red-soft);
  margin: var(--sp-1) 0 0;
  line-height: 1.5;
}
.field.has-error input,
.field.has-error select,
.field.has-error textarea,
.field.has-error .box,
.field.has-error .check-box{ border-color: rgba(239,68,68,0.6); }

.form-error{
  display: none;
  margin-top: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  border-radius: 10px;
  background: rgba(239,68,68,0.10);
  border: 1px solid rgba(239,68,68,0.35);
  color: var(--red-soft);
  font-size: 13.5px;
  line-height: 1.6;
  text-align: center;
}
.form-error.show{ display: block; }

/* ── ปุ่มส่ง ───────────────────────────────────────────────── */

.submit-btn{
  width: 100%;
  padding: var(--sp-4);
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--electric-blue), var(--purple));
  color: white;
  font-family: 'Anuphan', sans-serif;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 14px 30px -12px rgba(74,125,255,0.55);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.submit-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 18px 36px -12px rgba(74,125,255,0.65);
}
.submit-btn:disabled{ opacity: .6; cursor: default; transform: none; }
/* ลิงก์ที่ใช้หน้าตาปุ่มส่ง ("ไปหน้าเข้าสู่ระบบ" หลังสมัครทีมงาน) */
a.submit-btn{ display: block; box-sizing: border-box; margin-top: var(--sp-4); text-align: center; text-decoration: none; }

/* ── หน้าจอยืนยันเมื่อส่งสำเร็จ ─────────────────────────────── */

.success-overlay{
  position: fixed;
  inset: 0;
  background: rgba(6,6,10,0.86);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  z-index: 50;
}
.success-overlay.show{ display: flex; }

.success-card{
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
  max-width: 380px;
}
.success-ring{
  width: 56px; height: 56px;
  margin: 0 auto var(--sp-4);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--g4), var(--electric-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(60,203,127,0.35);
}
.success-card h2{
  font-family: 'Anuphan', sans-serif;
  font-size: 21px;
  margin: 0 0 var(--sp-2);
}
.success-card p{
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 var(--sp-2);
}
.success-meta{ font-size: 12.5px; color: var(--faint); margin: 0 0 var(--sp-5) !important; }
.success-meta b{ color: var(--g4); font-weight: 600; }

.success-actions{ display: flex; gap: var(--sp-2); justify-content: center; flex-wrap: wrap; }
.success-actions button,
.success-actions a{
  background: transparent;
  border: 1px solid var(--field-border);
  color: var(--muted);
  padding: var(--sp-2) var(--sp-4);
  border-radius: 10px;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
}
.success-actions .primary{
  border-color: rgba(6,199,85,0.4);
  background: rgba(6,199,85,0.12);
  color: #7ff0ac;
}

/* ============================================================
   มือถือ — iPhone / Android
   หน้าลงทะเบียนถูกเปิดจากลิงก์ในไลน์แทบทั้งหมด จอเล็กจึงเป็นค่าตั้งต้น
   ============================================================ */

@media (max-width: 560px){

  body{ padding-top: var(--sp-5); }

  h1{ font-size: 26px; }
  .sub{ font-size: 13.5px; }

  .card{ padding: var(--sp-5) var(--sp-4); border-radius: 13px; }
  .section-title{ margin-bottom: var(--sp-4); }

  /* ไซส์เสื้อ 5 ปุ่มในแถวเดียวบนจอ 360px จะแคบจนกดพลาด — ให้ตัดบรรทัดได้ */
  .size-radio-row{ flex-wrap: wrap; }
  .size-radio-row .radio-opt{ flex: 1 1 30%; }

  .success-card{ padding: var(--sp-5) var(--sp-5); }
  .success-actions{ flex-direction: column; }
  .success-actions button,
  .success-actions a{ width: 100%; text-align: center; padding: var(--sp-3) var(--sp-4); }
}

/* iOS ซูมหน้าจอเองทุกครั้งที่โฟกัสช่องที่ตัวอักษรเล็กกว่า 16px แล้วไม่ซูมกลับ
   ผู้ปกครองที่กรอกฟอร์ม 20 ช่องจะเจอหน้าค้างอยู่ในสภาพซูมตลอด */
@media (max-width: 860px){
  input[type=text], input[type=tel], input[type=date], input[type=password],
  select, textarea{ font-size: 16px; }

  /* iOS ไม่จัด input[type=date] ให้เต็มความกว้างเองเหมือนช่องอื่น */
  input[type=date]{
    -webkit-appearance: none;
    appearance: none;
    min-height: 46px;
  }
}

/* ปุ่มบนจอสัมผัสต้องสูงพอที่นิ้วโป้งกดไม่พลาด และไม่ต้องมีเอฟเฟกต์ hover
   เพราะบนมือถือ hover จะค้างอยู่หลังกดจนกว่าจะแตะที่อื่น */
@media (hover: none){
  .radio-opt .box{ min-height: 46px; display: flex; align-items: center; justify-content: center; }
  .check-opt{ padding: var(--sp-1) 0; }
  .check-box{ flex-basis: 24px; width: 24px; height: 24px; }
  .submit-btn{ min-height: 52px; }
  .submit-btn:hover{ transform: none; box-shadow: 0 14px 30px -12px rgba(74,125,255,0.55); }
  .radio-opt input, .check-opt input, .submit-btn{
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}
/* ผู้ปกครองอ่านและกรอกทีละส่วน จึงจำกัดความกว้างแม้อยู่บน PC */
.wrap{ max-width: 720px; min-width: 0; }
.card{ padding: var(--sp-5); margin-bottom: var(--sp-5); border-radius: var(--r-lg); }
.field{ margin-bottom: var(--sp-5); }
.grid-2{ grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--sp-4); }
.grid-2 > *{ min-width: 0; }
.field-label{ line-height: 1.6; }
.hint, .card-note, .footnote{ color: var(--muted); }
input:not([type=radio]):not([type=checkbox]), select, textarea{ min-height: var(--control-height); max-width: 100%; }
.radio-row{ gap: var(--sp-2); }
.radio-opt .box{ min-height: var(--control-height); padding: var(--sp-3) var(--sp-2); }
.size-radio-row{ flex-wrap: wrap; }
.size-radio-row .radio-opt{ flex: 1 1 72px; }
.check-opt{ min-height: var(--control-height); padding-block: var(--sp-2); }
.submit-btn{ min-height: 52px; border-radius: var(--r-md); }
.success-overlay{ padding: var(--sp-4); overflow-y: auto; }
.success-card{ max-height: calc(100dvh - var(--sp-5)); overflow-y: auto; padding: var(--sp-5); border-radius: var(--r-lg); }
.success-actions a{ min-height: var(--control-height); }
.form-intro{ margin: 0 0 var(--sp-5); color: var(--muted); font-size: var(--type-label); line-height: 1.7; }
.form-intro .req{ color: var(--red-soft); }
.section-title{ font-size: var(--type-section); line-height: 1.5; font-weight: 600; align-items: flex-start; }
.section-title .num{ flex: 0 0 28px; width: 28px; height: 28px; font-size: var(--type-label); }
.field-label{ font-size: var(--type-label); font-weight: 500; }
.hint, .card-note{ font-size: var(--type-caption); line-height: 1.7; }
.card-note{ margin: 0 0 var(--sp-5); }
.grid-2 > .field{ margin-bottom: var(--sp-4); }
.check-text{ font-size: var(--type-label); line-height: 1.8; }
.field-msg, .form-error{ font-size: var(--type-label); line-height: 1.6; }
.form-error{ margin: 0 0 var(--sp-4); }
.submit-btn{ font-size: var(--type-input); font-weight: 600; }
input[type=text], input[type=tel], input[type=date], select, textarea{ font-size: var(--type-input); line-height: 1.5; }
@media (max-width: 620px){
  body{ padding-top: var(--sp-5); }
  .card{ padding: var(--sp-4); }
  .grid-2{ grid-template-columns: minmax(0,1fr); }
  .stepper{ margin-bottom: var(--sp-5); }
}

/* จอแคบมาก ชื่อขั้นยาวเกินช่องที่กว้างแค่หนึ่งในห้าของจอ
   เหลือไว้แค่จุดตัวเลข แล้วให้บรรทัด "ขั้นที่ N จาก 5 · ชื่อ" ใต้แถบเป็นตัวบอกแทน
   ซึ่งอ่านง่ายกว่าชื่อห้าชื่อที่ถูกบีบจนตัดคำกลางคำ (ภาษาไทยไม่มีช่องว่างระหว่างคำ) */
@media (max-width: 420px){
  .st-name{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .st{ gap: 0; }
  .stepper-now{ font-weight: 600; color: var(--white); }
}

/* ── พ้นขั้นแรกแล้ว หัวหน้าเว็บยุบลง ─────────────────────────
   ชื่อองค์กร คำชี้แจง วันที่ สถานที่ อ่านครั้งเดียวตอนเปิดก็พอ
   ถ้าค้างไว้ทุกขั้น บนมือถือจะกินไปราวครึ่งจอก่อนถึงช่องแรกที่ต้องกรอก
   ซึ่งค้านกับเหตุผลที่ตัดฟอร์มเป็นสเตปตั้งแต่แรก
   ชื่อค่ายยังอยู่เป็นตัวยืนยันว่ากรอกของค่ายไหน */
/* ซ่อนเฉพาะ #campIntro ซึ่งเป็นคำสั่งให้ลงมือ ("กรุณากรอกข้อมูลด้านล่าง…")
   อ่านแล้วลงมือไปแล้วตั้งแต่ขั้นแรก ค้างไว้อีกสี่ขั้นก็ไม่ได้บอกอะไรเพิ่ม
   ส่วนข้อเท็จจริง — ผู้จัด วันที่ สถานที่ วันปิดรับ — อยู่ครบทุกขั้น
   ต้องตรวจทานได้ตลอด ไม่งั้นพอถึงขั้นไซส์เสื้อ คนจะไม่แน่ใจว่ากรอกของค่ายไหน */
body.stepping #campIntro{ display: none; }
/* บอกว่าฟอร์มนี้ของใครครั้งเดียวตอนเริ่มพอ ขั้นถัดไปไม่ต้องอ่านซ้ำ */
body.stepping .audience{ display: none; }
body.stepping h1{ font-size: clamp(21px, 5.2vw, 28px); margin-bottom: var(--sp-3); }
body.stepping .brand-eyebrow{ margin-bottom: var(--sp-2); }
body.stepping .sub{ margin-bottom: var(--sp-4); }

/* ห้าไซส์เรียงแถวเดียว ไม่ให้ XXL ตกไปอยู่บรรทัดล่างตัวเดียว
   ซึ่งดูเหมือนเป็นของคนละชุดกับสี่ตัวบน */
.size-radio-row{ display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.size-radio-row .radio-opt{ min-width: 0; }

/* คำเตือนว่าเบอร์ผู้ปกครองเคยใช้สมัครแล้ว
   สีเหลืองไม่ใช่แดง เพราะนี่คือ "ให้ดูอีกที" ไม่ใช่ "ผิด" — กรอกต่อได้
   ถ้าใช้สีแดงเหมือนข้อความ error คนจะคิดว่าสมัครไม่ได้แล้วเลิกกรอก */
.dup-warn{
  color: var(--g3);
  background: rgba(244,196,48,0.10);
  border: 1px solid rgba(244,196,48,0.28);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
  margin-top: var(--sp-2);
}

.registration-review{ border:1px solid var(--field-border); border-radius:var(--r-md); padding:16px; margin-bottom:24px; }
.registration-review h3{ font-size:18px; margin:0 0 12px; }
.registration-review dl{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.5fr); gap:12px; font-size:16px; }
.registration-review dt{ color:var(--muted); }
.registration-review dd{ margin:0; overflow-wrap:anywhere; }
.review-actions{ display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.review-actions .step-btn{ min-height:48px; font-size:16px; flex:1 1 100%; }

/* หน้าตรวจข้อมูลบนจอแคบ — ป้ายอยู่บนค่า ไม่ใช่สองคอลัมน์ (คอลัมน์ป้ายแคบจนตัดกลางคำ "แพ้|ยา")
   ปุ่มแก้ไขสี่ปุ่มจัด 2x2 แทนแถวยาวเต็มจอสี่แถว */
@media (max-width: 480px){
  .registration-review dl{ grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .registration-review dd{ margin-bottom: 10px; color: var(--white); }
  .review-actions .step-btn{ flex: 1 1 calc(50% - 4px); }
}

/* จอเล็ก (360) และมือถือแนวนอน — หัวฟอร์มเคยกินทั้งจอแรก ไม่เห็นช่องกรอกเลย
   ย่อหัวเรื่องกับระยะห่าง ให้ช่องแรกโผล่ในจอแรก */
@media (max-width: 380px), (max-height: 500px){
  .wrap > h1{ font-size: clamp(22px, 6vw, 28px); margin-bottom: var(--sp-2); }
  .wrap > .sub{ font-size: 14px; margin-bottom: var(--sp-3); }
  .brand-eyebrow{ margin-bottom: var(--sp-2); }
  .audience{ padding: 10px 12px; margin-bottom: var(--sp-3); }
}
