/* filepath: public/css/landing.css */
/* ═══════════════════════════════════════
   ReceiptFlow - Landing Page (standalone)
   ═══════════════════════════════════════ */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Noto+Sans+Thai:wght@300;400;500;600;700&display=swap');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: 'Outfit', 'Noto Sans Thai', sans-serif; background: #fff; color: #1a202c; line-height: 1.6; }
a { color: #7c3aed; text-decoration: none; }
a:hover { color: #5b21b6; }
img { max-width: 100%; height: auto; }
input, textarea, select, button, option { font-family: inherit; font-size: inherit; }

/* ── Design Tokens ── */
:root {
  --color-primary: #7c3aed;
  --color-border: #e2e8f0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; font-size: 14px; font-weight: 500;
  border: 1px solid transparent; border-radius: 8px;
  cursor: pointer; transition: all 0.2s; text-decoration: none; line-height: 1.4;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn--primary { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.btn--primary:hover { background: #5b21b6; border-color: #5b21b6; color: #fff; }
.btn--outline { background: transparent; border-color: #e2e8f0; color: #1a202c; }
.btn--outline:hover { border-color: #7c3aed; color: #7c3aed; }
.btn--sm { padding: 5px 12px; font-size: 13px; }
.btn--block { width: 100%; }

/* ── Keyframes ── */
@keyframes scanLine {
  0% { top: 0; opacity: 1; }
  50% { opacity: 0.6; }
  100% { top: calc(100% - 3px); opacity: 1; }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.3); }
  50% { box-shadow: 0 0 20px 6px rgba(124,58,237,0.12); }
}
@keyframes slideResultRow {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ── Container ── */
.landing-container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ── Gradient Text ── */
.gradient-text {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #ec4899 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Navbar ── */
.landing-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.landing-nav__inner { display: flex; align-items: center; height: 64px; gap: 16px; }
.landing-nav__logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 22px; color: #1e293b; flex-shrink: 0;
}
.landing-nav__logo:hover { color: #7c3aed; }

.landing-nav__center {
  display: none; flex-direction: row; align-items: center; gap: 24px; margin-left: auto;
}
.landing-nav__center a { font-size: 14px; font-weight: 500; color: #64748b; transition: color 0.2s; }
.landing-nav__center a:hover { color: #7c3aed; }

.landing-nav__right { display: none; align-items: center; gap: 8px; margin-left: auto; }

.lang-btn {
  background: none; border: 1px solid var(--color-border); border-radius: 6px;
  padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer;
  color: #64748b; transition: all 0.2s;
}
.lang-btn:hover { color: #7c3aed; border-color: #7c3aed; }

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.13);
  z-index: 300;
  overflow: hidden;
  min-width: 160px;
}
.lang-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  background: transparent;
  color: #1e293b;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  transition: background 0.15s;
}
.lang-dropdown-item:last-child { border-bottom: none; }
.lang-dropdown-item:hover { background: #f5f3ff; color: #7c3aed; }
.lang-dropdown-item--active { background: #f5f3ff; color: #7c3aed; font-weight: 700; }

.landing-nav__toggle {
  display: flex; background: none; border: none; cursor: pointer;
  color: #1e293b; padding: 4px; margin-left: auto;
}

/* Mobile nav */
.landing-nav__center--open {
  display: flex !important; flex-direction: column;
  position: absolute; top: 64px; left: 0; right: 0;
  background: #fff; border-bottom: 1px solid var(--color-border);
  padding: 16px 20px; gap: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

/* ── Hero ── */
.landing-hero {
  padding: 100px 0 60px;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 60%, #1a202c 100%);
  overflow: hidden;
  position: relative;
}
.landing-hero__grid { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center; position: relative; }
.landing-hero__content { text-align: center; }

.landing-hero__badge {
  display: inline-block; padding: 6px 16px; border-radius: 999px;
  background: rgba(255,255,255,0.15); color: #e9d8fd;
  font-size: 13px; font-weight: 600; margin-bottom: 20px; letter-spacing: 0.5px;
}
.landing-hero__title { font-size: 36px; font-weight: 800; line-height: 1.2; color: #fff; }
.landing-hero__subtitle { font-size: 16px; color: #ddd6fe; max-width: 520px; margin: 16px auto 0; line-height: 1.7; }
.landing-hero__actions {
  display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap;
}
.btn--lg { padding: 14px 28px; font-size: 16px; border-radius: 12px; font-weight: 600; }
.btn--lg svg { margin-left: 6px; vertical-align: middle; }
.btn--ghost {
  background: none; border: 1px solid rgba(255,255,255,0.3); color: #fff; font-weight: 600; cursor: pointer; border-radius: 12px;
}
.btn--ghost:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); }

/* Hero Stats */
.landing-hero__stats {
  display: flex; align-items: center; justify-content: center; gap: 24px;
  margin-top: 36px; flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 24px; font-weight: 800; color: #fff; }
.hero-stat span { font-size: 12px; color: #ddd6fe; text-transform: uppercase; letter-spacing: 0.5px; }
.hero-stat__divider { width: 1px; height: 32px; background: rgba(255,255,255,0.2); }

/* ── Hero Visual — Receipt Scanner ── */
.landing-hero__visual { display: flex; justify-content: center; align-items: center; }

.receipt-visual {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center;
}

/* Receipt paper */
.receipt-paper-wrap { position: relative; flex-shrink: 0; animation: float 4s ease-in-out infinite; }

.receipt-paper {
  width: 190px;
  background: #fff;
  border-radius: 6px 6px 0 0;
  padding: 16px 14px 20px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
}

/* Jagged bottom edge (receipt tear) */
.receipt-paper::before {
  content: '';
  position: absolute;
  bottom: -8px; left: 0; right: 0;
  height: 16px;
  background:
    radial-gradient(circle at 50% 0, #fff 6px, transparent 6px) -6px 0 / 12px 100%,
    radial-gradient(circle at 50% 0, rgba(255,255,255,0) 5px, #fff 5px) 0 0 / 12px 100%;
  background-repeat: repeat-x;
  z-index: 1;
}

/* Scan line */
.receipt-paper::after {
  content: ''; position: absolute; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent 5%, #c084fc 30%, #e879f9 50%, #c084fc 70%, transparent 95%);
  top: 0;
  animation: scanLine 2.8s ease-in-out infinite;
  box-shadow: 0 0 16px 4px rgba(192,132,252,0.5);
  z-index: 3;
}

/* Scan glow overlay */
.receipt-scan-glow {
  position: absolute; left: 0; right: 0; height: 48px; top: 0;
  background: linear-gradient(180deg, rgba(192,132,252,0.2) 0%, transparent 100%);
  animation: scanLine 2.8s ease-in-out infinite;
  pointer-events: none; z-index: 2;
}

/* Corner brackets */
.scan-corner {
  position: absolute; width: 18px; height: 18px;
  border-color: #c084fc; border-style: solid;
}
.scan-corner--tl { top: 6px; left: 6px; border-width: 3px 0 0 3px; border-radius: 3px 0 0 0; }
.scan-corner--tr { top: 6px; right: 6px; border-width: 3px 3px 0 0; border-radius: 0 3px 0 0; }
.scan-corner--bl { bottom: 6px; left: 6px; border-width: 0 0 3px 3px; border-radius: 0 0 0 3px; }
.scan-corner--br { bottom: 6px; right: 6px; border-width: 0 3px 3px 0; border-radius: 0 0 3px 0; }

/* Receipt content */
.rp-logo { display: flex; align-items: center; justify-content: center; gap: 5px; margin-bottom: 6px; }
.rp-logo svg { width: 16px; height: 16px; }
.rp-store { font-size: 11px; font-weight: 800; color: #1e293b; text-align: center; line-height: 1.3; }
.rp-addr  { font-size: 8.5px; color: #94a3b8; text-align: center; margin: 2px 0 6px; line-height: 1.4; }
.rp-meta  { display: flex; justify-content: space-between; font-size: 8px; color: #94a3b8; margin-bottom: 6px; }
.rp-dashed { border: none; border-top: 1px dashed #cbd5e1; margin: 6px 0; }
.rp-row { display: flex; justify-content: space-between; align-items: center; font-size: 9.5px; color: #334155; margin-bottom: 4px; }
.rp-row .rp-qty { color: #94a3b8; font-size: 8.5px; margin-right: 4px; }
.rp-row span:last-child { font-weight: 600; }
.rp-subtotal { display: flex; justify-content: space-between; font-size: 9.5px; color: #64748b; padding: 3px 0; }
.rp-vat { display: flex; justify-content: space-between; font-size: 9.5px; color: #64748b; padding: 3px 0; }
.rp-total {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; font-weight: 800; color: #7c3aed;
  padding-top: 8px; margin-top: 4px; border-top: 2px solid #7c3aed;
}
.rp-barcode {
  width: 100%; height: 24px; margin-top: 12px;
  background: repeating-linear-gradient(90deg,
    #1e293b 0px, #1e293b 2px, transparent 2px, transparent 4px,
    #1e293b 4px, #1e293b 5px, transparent 5px, transparent 8px,
    #1e293b 8px, #1e293b 10px, transparent 10px, transparent 12px,
    #1e293b 12px, #1e293b 13px, transparent 13px, transparent 16px,
    #1e293b 16px, #1e293b 19px, transparent 19px, transparent 21px
  );
  opacity: 0.5;
  border-radius: 2px;
}

/* AI result panel */
.receipt-ai-panel {
  min-width: 190px; flex: 1; max-width: 230px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  overflow: hidden;
  animation: float 4s ease-in-out infinite 0.5s;
}
.receipt-ai-panel__header {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px;
  background: rgba(124,58,237,0.35);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 11px; font-weight: 700; color: #e9d8fd;
}
.receipt-ai-panel__header svg { width: 14px; height: 14px; }
.ai-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px;
  font-size: 12px; border-bottom: 1px solid rgba(255,255,255,0.05);
  animation: slideResultRow 0.5s ease-out both;
}
.ai-row:nth-child(1) { animation-delay: 0.8s; }
.ai-row:nth-child(2) { animation-delay: 1.2s; }
.ai-row:nth-child(3) { animation-delay: 1.6s; }
.ai-row:nth-child(4) { animation-delay: 2.0s; }
.ai-row:last-child { border-bottom: none; }
.ai-row__label { color: rgba(255,255,255,0.45); font-size: 11px; }
.ai-row__val { font-weight: 600; color: #fff; font-size: 12px; }
.ai-row__val--green { color: #4ade80; font-size: 14px; font-weight: 800; }
.ai-row__val--badge {
  background: rgba(124,58,237,0.4); color: #e9d8fd;
  font-size: 10px; padding: 2px 8px; border-radius: 999px; font-weight: 700;
}

/* Arrow */
.hero-arrow { flex-shrink: 0; animation: float 4s ease-in-out infinite 0.25s; }

.result-label { color: rgba(255,255,255,0.5); font-weight: 500; }
.result-value { font-weight: 600; color: #fff; }

/* ── Sections ── */
.landing-section { padding: 64px 0; }
.landing-section--alt { background: #f8fafc; }
.landing-section__title { font-size: 28px; font-weight: 800; text-align: center; color: #0f172a; margin-bottom: 8px; }
.landing-section__subtitle { font-size: 15px; color: #64748b; text-align: center; margin-bottom: 40px; }

/* ── Features ── */
.feature-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.feature-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 24px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.feature-card:hover { box-shadow: 0 8px 24px rgba(124,58,237,0.1); transform: translateY(-2px); }
.feature-card__icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.feature-card__icon--blue { background: #ede9fe; color: #7c3aed; }
.feature-card__icon--green { background: #dcfce7; color: #16a34a; }
.feature-card__icon--purple { background: #fae8ff; color: #a855f7; }
.feature-card__icon--orange { background: #ffedd5; color: #ea580c; }
.feature-card__icon--cyan { background: #cffafe; color: #0891b2; }
.feature-card__icon--pink { background: #fce7f3; color: #db2777; }
.feature-card__icon--indigo { background: #e0e7ff; color: #4338ca; }
.feature-card__title { font-size: 17px; font-weight: 700; color: #0f172a; margin-bottom: 6px; }
.feature-card__desc { font-size: 14px; color: #64748b; line-height: 1.6; }

/* ── Steps ── */
.steps-grid { display: grid; grid-template-columns: 1fr; gap: 20px; max-width: 800px; margin: 0 auto; }
.step-card { text-align: center; padding: 24px; }
.step-card__number {
  width: 52px; height: 52px; border-radius: 16px;
  background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; margin-bottom: 16px;
}
.step-card__title { font-size: 18px; font-weight: 700; color: #0f172a; margin-bottom: 6px; }
.step-card__desc { font-size: 14px; color: #64748b; line-height: 1.6; }

/* ── Pricing ── */
.pricing-grid { display: grid; grid-template-columns: 1fr; gap: 20px; max-width: 900px; margin: 0 auto; }
.pricing-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 20px;
  padding: 32px 24px; position: relative; transition: box-shadow 0.2s;
}
.pricing-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.pricing-card--featured { border-color: #7c3aed; border-width: 2px; box-shadow: 0 8px 32px rgba(124,58,237,0.12); }
.pricing-card__badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff;
  font-size: 12px; font-weight: 700; padding: 4px 16px; border-radius: 999px;
}
.pricing-card__header { text-align: center; margin-bottom: 24px; }
.pricing-card__name { font-size: 18px; font-weight: 700; color: #0f172a; }
.pricing-card__price { font-size: 40px; font-weight: 800; color: #7c3aed; margin-top: 8px; }
.pricing-card__price span { font-size: 16px; font-weight: 400; color: #94a3b8; }
.pricing-card__period { font-size: 13px; color: #94a3b8; margin-top: 2px; }
.pricing-card__features { list-style: none; margin-bottom: 24px; }
.pricing-card__features li {
  padding: 8px 0; font-size: 14px; color: #334155; border-bottom: 1px solid #f1f5f9;
}
.pricing-card__features li::before { content: "\2713 "; color: #16a34a; font-weight: 700; }
.pricing-card__features li:last-child { border-bottom: none; }

/* ── CTA ── */
.landing-cta {
  padding: 80px 0; text-align: center;
  background: linear-gradient(180deg, #fff 0%, #f5f3ff 50%, #ede9fe 100%);
}
.landing-cta__title { font-size: 28px; font-weight: 800; color: #0f172a; margin-bottom: 8px; }
.landing-cta__subtitle { font-size: 16px; color: #64748b; margin-bottom: 28px; }

/* ── Footer ── */
.landing-footer { padding: 28px 0; border-top: 1px solid #e2e8f0; background: #fff; }
.landing-footer__inner {
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
}
.landing-footer__brand { display: flex; flex-direction: column; gap: 2px; }
.landing-footer__brand strong { font-size: 16px; color: #7c3aed; }
.landing-footer__brand span { color: #94a3b8; font-size: 13px; }
.landing-footer__links { display: flex; gap: 20px; }
.landing-footer__links a { font-size: 13px; color: #64748b; text-decoration: none; }
.landing-footer__links a:hover { color: #7c3aed; text-decoration: underline; }
.landing-footer__copy { font-size: 12px; color: #94a3b8; }

/* ── Alpine.js ── */
[x-cloak] { display: none !important; }

/* ═══ Responsive: md (>= 640px) ═══ */
@media (min-width: 640px) {
  .landing-nav__toggle { display: none; }
  .landing-nav__center { display: flex; }
  .landing-nav__right { display: flex; }

  .landing-hero { padding: 120px 0 80px; }
  .landing-hero__title { font-size: 48px; }
  .landing-hero__subtitle { font-size: 18px; }

  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: repeat(3, 1fr); }
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }

  .landing-footer__inner { flex-direction: row; justify-content: space-between; }
}

/* ═══ Responsive: lg (>= 1024px) ═══ */
@media (min-width: 1024px) {
  .landing-hero__grid { grid-template-columns: 1fr 1fr; }
  .landing-hero__content { text-align: left; }
  .landing-hero__subtitle { margin: 16px 0 0; }
  .landing-hero__actions { justify-content: flex-start; }
  .landing-hero__stats { justify-content: flex-start; }
  .landing-hero__title { font-size: 52px; }

  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .landing-section { padding: 80px 0; }
}

/* ═══ Reduced motion ═══ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
