/**
 * Demo Landing (public page) — ออกแบบให้สอดคล้องกับหน้า Landing หลัก (index.html)
 * ใช้โทนสีฟ้าเดียวกัน (#2563eb → #0ea5e9), การ์ดมุมมน, เงานุ่ม และ heading ไล่เฉดสี
 */
.demo-page {
  --d-primary: #2563eb;
  --d-primary-dark: #1d4ed8;
  --d-accent: #0ea5e9;
  --d-ink: #1a2233;
  --d-muted: #5b6577;
  --d-line: #e6e9f0;
  --d-bg-soft: #f4f8fd;
  --d-success: #12b76a;
  --d-gradient: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  --d-radius: 16px;
  --d-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --d-shadow-md: 0 8px 24px rgba(16, 24, 40, .08);
  --d-shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .18);
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
  color: var(--d-ink);
}
/* ---------- top brand bar (เชื่อมโยงกับหน้าหลัก) ---------- */
.demo-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 0 1.4rem;
  margin-bottom: .5rem;
}
.demo-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--d-ink);
  text-decoration: none;
}
.demo-brand em {
  font-style: normal;
  font-weight: 400;
}
.demo-brand .logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--d-gradient);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.05rem;
  box-shadow: 0 6px 14px -4px rgba(37, 99, 235, .5);
}
.demo-topbar-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .95rem;
}
.demo-topbar-links a:not(.btn) {
  color: var(--d-muted);
  text-decoration: none;
}
.demo-topbar-links a:not(.btn):hover {
  color: var(--d-ink);
}
/* ---------- hero ---------- */
.demo-hero {
  text-align: center;
  padding: 1.5rem 0 2rem;
}
.demo-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 0.9rem;
}
.demo-hero h1 .hl {
  background: var(--d-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.demo-sub {
  font-size: 1.1rem;
  color: var(--d-muted);
  max-width: 60ch;
  margin: 0 auto;
}
/* ---------- cards ---------- */
.demo-card {
  border: 1px solid var(--d-line);
  border-radius: var(--d-radius);
  padding: 1.8rem;
  margin-bottom: 1.25rem;
  background: #fff;
  box-shadow: var(--d-shadow-sm);
}
.demo-card > h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
/* ---------- dropzone (เด่น ชวนลาก) ---------- */
#demo-dropzone {
  border: 2px dashed rgba(37, 99, 235, .4);
  border-radius: var(--d-radius);
  background: var(--d-bg-soft);
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
  font-size: 1.05rem;
  color: var(--d-muted);
}
#demo-dropzone:hover,
#demo-dropzone.dragover {
  border-color: var(--d-primary);
  background: rgba(37, 99, 235, .05);
  transform: translateY(-2px);
}
#demo-dropzone.icon-upload::before {
  display: block;
  font-size: 2.6rem;
  color: var(--d-primary);
  margin-bottom: .6rem;
}
/* ---------- stat tiles ---------- */
.demo-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.2rem 0;
}
.demo-stat {
  flex: 1 1 120px;
  text-align: center;
  padding: 1.1rem .75rem;
  border-radius: 12px;
  background: var(--d-bg-soft);
  border: 1px solid var(--d-line);
}
.demo-stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  background: var(--d-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.demo-stat-label {
  font-size: 0.85rem;
  color: var(--d-muted);
}
/* ---------- business + chips ---------- */
.demo-business {
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--d-primary);
  background: rgba(37, 99, 235, .06);
  border-radius: 10px;
  margin-top: 1rem;
}
.migration-module-chip {
  display: inline-block;
  font-size: .82rem;
  background: rgba(37, 99, 235, .1);
  color: var(--d-primary-dark);
  padding: .28rem .7rem;
  border-radius: 999px;
  margin: .3rem .3rem 0 0;
}
/* ---------- entities / tables ---------- */
.demo-entity {
  margin-bottom: 1.6rem;
}
.demo-entity h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: .6rem;
}
.demo-entity .tablebody {
  border: 1px solid var(--d-line);
  border-radius: 12px;
  overflow: hidden;
}
.demo-entity table.table th {
  background: var(--d-bg-soft);
  font-weight: 600;
  color: var(--d-ink);
}
.migration-samples {
  font-size: 0.85em;
  opacity: 0.7;
  padding: var(--space-4) 0;
}
.migration-relationship {
  padding: .4rem .2rem;
  color: var(--d-ink);
}
/* ---------- CTA / lead form (ให้เหมือนการ์ดติดต่อในหน้าหลัก) ---------- */
.demo-cta {
  border: 2px solid var(--d-primary);
  box-shadow: var(--d-shadow-lg);
}
.demo-cta h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: .4rem;
}
.demo-cta > p {
  color: var(--d-muted);
  margin-bottom: 1rem;
}
.demo-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0 1.2rem;
}
.demo-form label {
  font-size: 0.92rem;
  font-weight: 500;
}
.demo-form .form-control {
  display: block;
  margin-top: .35rem;
}
.demo-form input {
  width: 100%;
}
.demo-cta .btn {
  margin-right: .6rem;
}
/* helper text ใต้ dropzone — ให้เป็นสีเทากลาง ๆ ตามโทนหน้าหลัก */
.demo-page .comment {
  color: var(--d-muted);
}
/* ---------- footer ---------- */
.demo-footer {
  text-align: center;
  margin-top: 2.5rem;
  font-size: 0.9rem;
  color: var(--d-muted);
}
.demo-footer a {
  color: var(--d-primary);
  text-decoration: none;
}
.demo-footer a:hover {
  text-decoration: underline;
}
/* ---------- responsive ---------- */
@media (max-width: 620px) {
  .demo-form {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .demo-card {
    padding: 1.3rem;
  }
  #demo-dropzone {
    padding: 2.2rem 1rem;
  }
  .demo-topbar-links a:not(.btn) {
    display: none;
  }
}