/* ==========================================================
   SensorMonitor Landing Page
   Theme: indigo + cyan + gold (matching dashboard)
   ========================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1e293b;
  line-height: 1.6;
  background: #fff;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-narrow { max-width: 760px; }

/* ====== Topbar ====== */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e8f0;
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; color: #4338ca; font-size: 18px;
}
.brand-emoji { font-size: 22px; }
.brand-by { color: #64748b; font-size: 12px; font-weight: 400; }
.topnav { display: flex; align-items: center; gap: 22px; }
.topnav a { color: #475569; font-weight: 500; font-size: 14px; transition: color .15s; }
.topnav a:hover { color: #4338ca; }

/* ====== Buttons ====== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600; font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  border: 0;
  transition: transform .12s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-xl { padding: 14px 28px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-primary { background: linear-gradient(135deg, #6366f1, #4338ca); color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,.35); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(99,102,241,.45); }
.btn-ghost { background: transparent; color: #4338ca; border: 1.5px solid #c7d2fe; }
.btn-ghost:hover { background: #eef2ff; }
.btn-line { background: #06c755; color: #fff; box-shadow: 0 4px 14px rgba(6,199,85,.3); }
.btn-line:hover { background: #05a648; }

/* ====== Hero ====== */
.hero {
  padding: 80px 0 100px;
  background: radial-gradient(ellipse at top, #eef2ff 0%, #fff 50%);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(6,182,212,.15), transparent 70%);
  z-index: 0;
}
.hero-inner {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center;
  position: relative; z-index: 1;
}
.hero-badge {
  display: inline-block;
  padding: 6px 14px; border-radius: 99px;
  background: #fef9e7; color: #8a6d10;
  font-size: 13px; font-weight: 600;
  border: 1px solid #fde68a;
  margin-bottom: 20px;
}
.hero-text h1 {
  font-size: 44px; line-height: 1.2; font-weight: 700;
  color: #0f172a; margin-bottom: 18px;
}
.hero-highlight {
  background: linear-gradient(135deg, #4338ca, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: 17px; color: #475569; margin-bottom: 28px;
  max-width: 540px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.hero-trust {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 13px; color: #475569;
}
.hero-trust span { display: inline-flex; align-items: center; }

/* Hero visual (mock dashboard card) */
.hero-visual { display: flex; justify-content: center; }
.hero-card {
  width: 100%; max-width: 420px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 30px 80px rgba(15,23,42,.18);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  transform: perspective(1000px) rotateY(-4deg) rotateX(2deg);
}
.hero-card-head {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-green { background: #22c55e; }
.dot-yellow { background: #eab308; }
.dot-red { background: #ef4444; }
.hero-card-title {
  margin-left: 10px; color: #64748b; font-size: 13px; font-weight: 600;
}
.hero-metric { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.metric {
  padding: 16px; background: #f8fafc; border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.metric-label { color: #64748b; font-size: 12px; margin-bottom: 6px; font-weight: 600; }
.metric-value { font-size: 28px; font-weight: 700; color: #0f172a; }
.metric-value span { font-size: 14px; color: #64748b; font-weight: 500; margin-left: 4px; }
.metric-spark { color: #6366f1; font-family: monospace; letter-spacing: -1px; margin-top: 4px; font-size: 16px; }
.metric-spark-2 { color: #06b6d4; }
.metric-control { display: flex; justify-content: space-between; align-items: center; }
.metric-control .metric-label { margin-bottom: 0; }
.switch {
  display: inline-block; width: 36px; height: 20px; border-radius: 99px;
  background: #cbd5e1; position: relative; transition: background .2s;
}
.switch.on { background: #22c55e; }
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: left .2s;
}
.switch.on::after { left: 18px; }
.switch-text { margin-left: 8px; color: #16a34a; font-weight: 600; font-size: 14px; }

/* ====== Sections ====== */
.section { padding: 80px 0; }
.section-alt { background: #f8fafc; }
.section-title {
  font-size: 32px; font-weight: 700; color: #0f172a;
  text-align: center; margin-bottom: 12px;
}
.section-sub {
  text-align: center; color: #64748b;
  font-size: 16px; margin-bottom: 48px;
  max-width: 600px; margin-left: auto; margin-right: auto;
}

/* Features */
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature {
  padding: 28px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.feature:hover { transform: translateY(-4px); border-color: #6366f1; box-shadow: 0 10px 30px rgba(99,102,241,.15); }
.feature-icon { font-size: 32px; margin-bottom: 14px; }
.feature h3 { font-size: 18px; color: #0f172a; margin-bottom: 8px; }
.feature p { color: #475569; font-size: 14px; line-height: 1.7; }

/* Pricing */
.pricing-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 24px; margin-bottom: 40px;
}
.price-card {
  position: relative;
  padding: 32px 28px;
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: 16px;
  display: flex; flex-direction: column;
}
.price-card-featured {
  border-color: #6366f1; transform: scale(1.04);
  box-shadow: 0 20px 50px rgba(99,102,241,.2);
}
.price-ribbon {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: #f59e0b; color: #fff;
  padding: 4px 14px; border-radius: 99px;
  font-size: 12px; font-weight: 700;
  white-space: nowrap;
}
.price-name { font-size: 18px; color: #475569; margin-bottom: 8px; font-weight: 600; }
.price-card-featured .price-name { color: #4338ca; }
.price-amount {
  font-size: 36px; font-weight: 700; color: #0f172a;
  margin-bottom: 24px;
}
.price-amount span { font-size: 14px; color: #64748b; font-weight: 500; }
.price-list {
  list-style: none; margin-bottom: 24px;
  flex: 1;
}
.price-list li {
  padding: 8px 0 8px 24px;
  color: #475569; font-size: 14px;
  position: relative;
}
.price-list li::before {
  content: '✓'; position: absolute; left: 0;
  color: #22c55e; font-weight: 700;
}
.pricing-foot {
  text-align: center; padding: 24px;
  background: #fef9e7; border-radius: 12px;
  border: 1px dashed #fde68a;
}
.payment-row {
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.payment-label { color: #8a6d10; font-weight: 600; font-size: 14px; }
.payment-method {
  padding: 4px 12px; background: #fff; border-radius: 6px;
  font-size: 13px; color: #475569;
  border: 1px solid #fde68a;
}
.payment-note { color: #475569; font-size: 13px; }
.payment-note a { color: #4338ca; font-weight: 600; }

/* Hardware */
.hw-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.hw-card {
  padding: 24px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 12px;
  text-align: center;
  position: relative;
}
.hw-card h3 { font-size: 16px; color: #0f172a; margin-bottom: 8px; }
.hw-card p { font-size: 13px; color: #64748b; }
.hw-badge {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 10px;
  background: #d1fae5; color: #065f46;
  border-radius: 6px;
  font-size: 12px; font-weight: 600;
}

/* FAQ */
.faq {
  background: #fff;
  border: 1px solid #e2e8f0; border-radius: 10px;
  margin-bottom: 12px;
  padding: 16px 20px;
}
.faq summary {
  cursor: pointer; font-weight: 600; color: #0f172a;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq summary::after {
  content: '+'; font-size: 22px; color: #6366f1;
}
.faq[open] summary::after { content: '−'; }
.faq p { margin-top: 12px; color: #475569; font-size: 14px; line-height: 1.7; }

/* CTA */
.cta {
  padding: 80px 0;
  background: linear-gradient(135deg, #4338ca 0%, #06b6d4 100%);
  color: #fff; text-align: center;
}
.cta h2 { font-size: 36px; font-weight: 700; margin-bottom: 12px; }
.cta p { font-size: 17px; opacity: .9; margin-bottom: 28px; }

/* Footer */
.footer {
  background: #0f172a; color: #cbd5e1; padding: 60px 0 0;
}
.footer .brand { color: #fff; }
.footer-by { color: #64748b; font-size: 12px; margin-top: 4px; }
.footer-inner {
  display: grid; grid-template-columns: 1fr 2fr; gap: 40px;
  padding-bottom: 40px;
}
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.footer-links h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.footer-links a {
  display: block; padding: 4px 0;
  color: #94a3b8; font-size: 14px;
  transition: color .15s;
}
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #1e293b;
  padding: 20px 24px;
  display: flex; justify-content: space-between;
  color: #64748b; font-size: 13px;
  max-width: 1180px; margin: 0 auto;
}

/* ====== Responsive ====== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-text h1 { font-size: 32px; }
  .hero-visual { order: -1; max-width: 360px; margin: 0 auto; }
  .features-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .price-card-featured { transform: none; }
  .hw-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 30px; }
  .topnav a:not(.btn) { display: none; }  /* hide section nav on mobile */
}
@media (max-width: 600px) {
  .section { padding: 60px 0; }
  .section-title { font-size: 26px; }
  .cta h2 { font-size: 28px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}

/* ====== PDPA Cookie banner ====== */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px;
  z-index: 1000;
  background: #0f172a; color: #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,.4);
  padding: 18px 22px;
  border: 1px solid rgba(99,102,241,.4);
}
.cookie-inner {
  display: flex; align-items: center; gap: 18px;
  max-width: 1100px; margin: 0 auto;
  flex-wrap: wrap;
}
.cookie-text { flex: 1; font-size: 13.5px; line-height: 1.55; min-width: 280px; }
.cookie-text b { color: #fff; }
.cookie-text a { color: #a5b4fc; text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-actions .btn { padding: 8px 18px; font-size: 13px; }

@media (max-width: 600px) {
  .cookie-banner { padding: 14px 16px; left: 8px; right: 8px; bottom: 8px; }
  .cookie-inner { flex-direction: column; align-items: stretch; }
  .cookie-actions { justify-content: center; }
}
