@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@500;600;700;800&family=Sarabun:wght@400;500;600;700&display=swap');

:root {
  /* ---- สีหลัก (คงโทนพาสเทลชมพู-ฟ้า-ม่วงเดิม แต่กลั่นให้ดูน่าเชื่อถือขึ้น) ---- */
  --ink: #2D2640;
  --ink-soft: #6B6280;
  --paper: #FBF9FD;
  --surface: #FFFFFF;
  --mist: #F2EEFB;
  --iris: #6C5CE7;
  --iris-dark: #5642D6;
  --petal: #FF8FB1;
  --petal-dark: #FF6B9B;
  --sky: #6FB3F2;
  --sky-dark: #4A9AE8;
  --success: #2FAE6E;
  --success-bg: #E3F7EC;
  --warning: #C98A00;
  --warning-bg: #FFF4D9;
  --danger: #E0475A;
  --danger-bg: #FDE6E9;
  --border: #E7E2F6;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 10px rgba(45, 38, 64, 0.06);
  --shadow: 0 10px 28px rgba(108, 92, 231, 0.14);
  --shadow-lift: 0 14px 36px rgba(108, 92, 231, 0.2);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Sarabun', -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'Prompt', 'Sarabun', sans-serif; margin: 0; }

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

/* ================= HEADER / BRAND ================= */
.brand-band {
  background: linear-gradient(135deg, var(--iris) 0%, var(--iris-dark) 55%, var(--petal-dark) 130%);
  border-radius: 0 0 32px 32px;
  padding: 28px 16px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255,255,255,0.16);
  border: 1.5px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Prompt', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.5px;
  overflow: hidden;
  padding: 0;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-text h1 {
  color: #fff;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.brand-text .subtitle {
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  margin-top: 2px;
}

/* Signature: slogan arc เข้าใจ -> จำได้ -> รู้จริง (ลำดับขั้นการเรียนรู้จริง) */
.slogan-arc {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.slogan-step {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 20px;
  white-space: nowrap;
}
.slogan-arrow {
  color: rgba(255,255,255,0.55);
  font-size: 13px;
}

/* ================= NAV ================= */
.top-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}
.top-nav button {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 9px 18px;
  font-family: 'Sarabun', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, color 0.15s;
}
.top-nav button:hover { border-color: var(--iris); color: var(--iris); }

/* ================= STEP PROGRESS (ลำดับขั้นตอนจริงของการสมัคร) ================= */
.step-progress {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin: 4px 4px 20px;
  padding: 0 2px;
}
.step-progress .step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}
.step-progress .step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 13px;
  left: 55%;
  width: 90%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.step-progress .step.done:not(:last-child)::after { background: var(--iris); }
.step-progress .dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Prompt', sans-serif;
  font-size: 12px; font-weight: 700;
  color: var(--ink-soft);
  z-index: 1;
  position: relative;
}
.step-progress .step.active .dot {
  background: var(--iris);
  border-color: var(--iris);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(108,92,231,0.15);
}
.step-progress .step.done .dot {
  background: var(--iris);
  border-color: var(--iris);
  color: #fff;
}
.step-progress .label {
  font-size: 11px;
  margin-top: 6px;
  color: var(--ink-soft);
  text-align: center;
  max-width: 60px;
}
.step-progress .step.active .label { color: var(--iris); font-weight: 700; }

/* ================= CARDS ================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 22px 0 4px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--mist);
}
.section-title:first-child { margin-top: 0; }

.course-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.course-card:active { transform: scale(0.98); }
.course-card:hover { border-color: var(--iris); box-shadow: var(--shadow); }
.course-card.full {
  background: #F7F6FA;
  border-color: var(--border);
  color: var(--ink-soft);
  cursor: not-allowed;
}
.course-card.full:hover { box-shadow: var(--shadow-sm); border-color: var(--border); }

.badge {
  display: inline-block;
  background: var(--mist);
  color: var(--iris-dark);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

.course-card h3 { font-size: 18px; margin-bottom: 6px; }
.course-card .desc { font-size: 14px; color: var(--ink-soft); margin-bottom: 12px; }

.course-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.price { font-family: 'Prompt', sans-serif; font-weight: 700; color: var(--iris-dark); font-size: 19px; }

.seat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
}
.seat-pill.ok { background: var(--success-bg); color: var(--success); }
.seat-pill.low { background: var(--warning-bg); color: var(--warning); }
.seat-pill.full { background: #EFEDF4; color: var(--ink-soft); }
.seat-pill .dot-ind { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ================= SLOTS ================= */
.slot-option {
  display: block;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.slot-option:hover { border-color: var(--sky); }
.slot-option.selected { border-color: var(--iris); background: var(--mist); }
.slot-option.disabled { opacity: 0.55; cursor: not-allowed; }
.slot-option .slot-title { font-weight: 700; font-size: 15.5px; }
.slot-option .slot-meta { font-size: 13px; color: var(--ink-soft); margin: 6px 0; display: flex; gap: 10px; flex-wrap: wrap; }
.slot-option .slot-meta span { display: inline-flex; align-items: center; gap: 4px; }
.loc-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 8px;
}
.loc-tag.zoom { background: var(--sky); color: #fff; }
.loc-tag.onsite { background: var(--petal); color: #fff; }

/* ================= FORMS ================= */
label {
  display: block;
  font-weight: 600;
  margin: 16px 0 6px;
  font-size: 14.5px;
  color: var(--ink);
}

input[type=text], input[type=email], input[type=tel], select, textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  font-size: 16px;
  background: var(--paper);
  font-family: 'Sarabun', sans-serif;
  color: var(--ink);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--iris);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(108,92,231,0.12);
}

.btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 15px;
  border-radius: 14px;
  border: none;
  font-family: 'Prompt', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--iris), var(--iris-dark));
  color: #fff;
  box-shadow: 0 8px 20px rgba(108, 92, 231, 0.35);
}
.btn-primary:hover { box-shadow: 0 10px 24px rgba(108, 92, 231, 0.45); }
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--iris); color: var(--iris); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0; }
.checkbox-row input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--iris); }
.checkbox-row label { margin: 0; font-weight: 400; font-size: 13.5px; color: var(--ink-soft); }

/* ================= MESSAGES / STATES ================= */
.message-box { text-align: center; padding: 36px 16px; }
.message-box .icon { font-size: 46px; margin-bottom: 14px; }
.message-box.error { color: var(--danger); }
.message-box.success { color: var(--success); }
.message-box h3 { margin-bottom: 6px; font-size: 18px; color: var(--ink); }
.message-box p { color: var(--ink-soft); font-size: 14.5px; }

.status-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
}
.status-รอชำระ { background: var(--warning-bg); color: var(--warning); }
.status-ชำระแล้ว { background: var(--success-bg); color: var(--success); }
.status-หมดเวลา { background: var(--danger-bg); color: var(--danger); }
.status-ยกเลิก { background: #EFEDF4; color: var(--ink-soft); }

.reg-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.reg-item h4 { margin: 0 0 6px; font-size: 15.5px; font-family: 'Prompt', sans-serif; }
.reg-item .meta { font-size: 13px; color: var(--ink-soft); margin: 3px 0; }

.spinner {
  width: 38px; height: 38px;
  border: 4px solid var(--mist);
  border-top-color: var(--iris);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 36px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.file-input-wrap {
  border: 1.5px dashed var(--iris);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  background: var(--mist);
  margin-bottom: 12px;
}
.file-input-wrap label { margin-top: 0; }
.file-input-wrap input[type=file] { width: 100%; margin-top: 10px; font-size: 13px; }
.file-name { font-size: 13px; color: var(--success); margin-top: 8px; font-weight: 600; }

.readonly-field { background: #F0EEF5; color: var(--ink-soft); }

/* ================= TERMS BOX (เงื่อนไขการสมัครเรียน) ================= */
.terms-box {
  max-height: 220px;
  overflow-y: auto;
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 8px;
}
.terms-box ol {
  margin: 0;
  padding-left: 18px;
}
.terms-box li {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 10px;
}
.terms-box li:last-child { margin-bottom: 0; }

.policy-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.policy-links a {
  font-size: 13px;
  color: var(--iris-dark);
  font-weight: 600;
  text-decoration: underline;
}

/* ================= BANK CARD (หน้าชำระเงิน) ================= */
.bank-card {
  background: var(--mist);
  border: 1.5px solid var(--iris);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 16px;
}
.bank-card-label {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 4px;
}
.bank-card-name {
  font-family: 'Prompt', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 12px;
}
.bank-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
}
.bank-card-number {
  font-family: 'Prompt', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.5px;
  color: var(--iris-dark);
}
.copy-btn {
  background: var(--iris);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  font-family: 'Sarabun', sans-serif;
  transition: transform 0.1s ease;
}
.copy-btn:active { transform: scale(0.95); }
.bank-card-owner {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--ink-soft);
  font-weight: 600;
}

.helper-text { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }

/* ================= TRUST FOOTER ================= */
.trust-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
}
.trust-item .ic { font-size: 15px; }

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
