/* ==========================================================================
   PayTrail Core Tokens & Variables
   ========================================================================== */
:root {
  --color-canvas: #faf9f7;
  --color-surface: #ffffff;
  --color-ink: #0f172a;
  --color-muted: #64748b;
  --color-border: #e2e8f0;
  --color-primary: #0068f9;
  --color-primary-hover: #024bb1;
  --color-badge-bg: #eff6ff;
  --color-green: #16a34a;

  --max-width: 1200px;
  --radius-card: 20px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

/* Base Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-canvas);
  color: var(--color-ink);
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 72px;

  background: #e9f5fe;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);

  overflow: hidden;
  isolation: isolate;
}

/* Grid Lines */
.navbar::before {
  content: "";
  position: absolute;
  inset: 0;

  background-image:
    linear-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px);

  background-size: 48px 48px;

  z-index: -1;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  text-decoration: none;
  color: var(--color-ink);
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--color-primary);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--color-surface);
  color: var(--color-ink);
  border-color: var(--color-border);
}

.btn-ghost:hover {
  background: #f8fafc;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.mobile-toggle,
.mobile-sidebar {
  display: none;
}

/* ==========================================================================
   HERO SECTION (2-COLUMN LAYOUT)
   ========================================================================== */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 80px 0;
  border-bottom: 1px solid var(--color-border);

  background: linear-gradient(180deg, #e9f5fe 0%, #ffffff 100%);

  isolation: isolate;
}

/* Grid Lines */
.hero::before {
  content: "";

  position: absolute;
  inset: 0;

  background-image:
    linear-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px);

  background-size: 48px 48px;

  z-index: -2;

  /* Fade the grid like Fitxn */
  -webkit-mask-image: radial-gradient(
    ellipse 90% 80% at 50% 20%,
    #000 45%,
    transparent 100%
  );

  mask-image: radial-gradient(
    ellipse 90% 80% at 50% 20%,
    #000 45%,
    transparent 100%
  );
}

/* Blue Glow */
.hero::after {
  content: "";

  position: absolute;

  width: 800px;
  height: 800px;

  left: 50%;
  top: -320px;

  transform: translateX(-50%);

  background: radial-gradient(
    circle,
    rgba(0, 104, 249, 0.18),
    rgba(0, 104, 249, 0.08) 40%,
    transparent 70%
  );

  filter: blur(90px);

  z-index: -1;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--color-badge-bg);
  color: var(--color-primary);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 50%;
}

.hero-title {
  font-size: clamp(36px, 4.5vw, 54px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--color-ink);
}

.hero-title span {
  color: var(--color-primary);
}

.hero-sub {
  font-size: 18px;
  color: var(--color-muted);
  margin-bottom: 32px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}

.hero-trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--color-muted);
  font-weight: 500;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* HERO RECEIPT STAGE */
.receipt-stage {
  position: relative;
  padding: 20px 10px;
}

.receipt-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: var(--shadow-md);
  max-width: 380px;
  margin: 0 auto;
}

.receipt-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.receipt-biz {
  font-weight: 700;
  font-size: 16px;
}

.receipt-biz-sub {
  font-size: 12px;
  color: var(--color-muted);
}

.stamp {
  border: 1.5px solid var(--color-green);
  color: var(--color-green);
  padding: 2px 8px;
  font-weight: 700;
  font-size: 11px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.receipt-line {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  color: var(--color-ink);
}

.receipt-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 16px;
  padding-top: 14px;
  margin-top: 10px;
  border-top: 2px dashed var(--color-border);
  color: var(--color-primary);
}

.floating-chip {
  position: absolute;
  background: #ffffff;
  border: 1px solid var(--color-border);
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.chip-wa {
  top: -10px;
  right: 10px;
  color: #16a34a;
}

.chip-analytics {
  bottom: -15px;
  left: 10px;
  color: #6366f1;
}

/* ==========================================================================
   METRICS SECTION (STRICT 4-COLUMN GRID)
   ========================================================================== */
.metrics-section {
  padding: 80px 0;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
}

.section-head {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 48px;
}

.section-tag {
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(26px, 3.5vw, 36px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 12px;
}

.section-sub {
  color: var(--color-muted);
  font-size: 16px;
  line-height: 1;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.metric-card {
  background: var(--color-canvas);
  /* border: 1px solid var(--color-border); */
  border-radius: var(--radius-card);
  padding: 28px 20px;
  text-align: left;
  height: 400px;

  display: flex;
  justify-content: left;
  align-items: center;
}
.metric-num {
  font-size: 35px;
  font-weight: 400;
  color: var(--color-primary);
  margin-bottom: -8px;
}
.first-box {
  background-color: #edf8f7;
}
.first-box .metric-num {
  color: #05462e;
}
.second-box {
  background-color: fcfaf6;
}
.second-box .metric-num {
  color: #05462e;
}
.third-box {
  background-color: #f5f8ff;
}
.third-box .metric-num {
  color: #0770dd;
}
.fourth-box {
  background-color: #fcf9fe;
}
.fourth-box .metric-num {
  color: #4f35d5;
}

.metric-label {
  font-size: 35px;
  color: black;
  font-weight: 400;
  line-height: 1;
}

/* ==========================================================================
   FEATURES SECTION (STRICT BENTO GRID)
   ========================================================================== */
#features {
  padding: 100px 0;
  background-color: black;
  color: white;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.feature-card {
  background: rgba(0, 0, 0, 0.918);
  border: 1px solid rgb(30, 30, 30);
  border-radius: var(--radius-card);
  padding: 36px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: rgb(39, 39, 39);
  color: var(--color-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 20px;
}

.feature-body h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.feature-body p {
  color: var(--color-muted);
  font-size: 15px;
  line-height: 1.6;
}

/* Force standard grid spanning on desktop */
.span-8,
.span-4 {
  grid-column: span 1; /* Simplifies balance */
}

/* ==========================================================================
   HOW IT WORKS & TESTIMONIALS
   ========================================================================== */
.how-section {
  padding: 100px 0;
  background: #ffffff;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 32px;
}

.step-num {
  font-size: 14px;
  font-weight: 800;
  color: var(--color-primary);
  background: #ffffff;
  border: 1px solid var(--color-border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.step-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-card p {
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.6;
}

#testimonials {
  padding: 100px 0;
}

.testimonial-masonry {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.testimonial-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.testimonial-card .quote {
  font-size: 15px;
  color: var(--color-ink);
  line-height: 1.6;
  margin-bottom: 20px;
}

.author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  background: var(--color-badge-bg);
  color: var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.author strong {
  display: block;
  font-size: 14px;
}

.author span {
  font-size: 12px;
  color: var(--color-muted);
}

/* ==========================================================================
   PRICING & FAQ
   ========================================================================== */
#pricing,
.faq-section {
  position: relative;
  overflow: hidden;
  background: #fff;
  isolation: isolate;
}

/* Top Left Grid */
#pricing::before,
.faq-section::before {
  content: "";

  position: absolute;

  width: 420px;
  height: 420px;

  left: -80px;
  top: -80px;

  background-image:
    linear-gradient(rgba(15, 23, 42, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.06) 1px, transparent 1px);

  background-size: 48px 48px;

  mask-image: radial-gradient(circle at top left, #000 35%, transparent 100%);

  -webkit-mask-image: radial-gradient(
    circle at top left,
    #000 35%,
    transparent 100%
  );

  z-index: -1;
}

/* Bottom Right Grid */
#pricing::after,
.faq-section::after {
  content: "";

  position: absolute;

  width: 420px;
  height: 420px;

  right: -80px;
  bottom: -80px;

  background-image:
    linear-gradient(rgba(15, 23, 42, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.06) 1px, transparent 1px);

  background-size: 48px 48px;

  mask-image: radial-gradient(
    circle at bottom right,
    #000 35%,
    transparent 100%
  );

  -webkit-mask-image: radial-gradient(
    circle at bottom right,
    #000 35%,
    transparent 100%
  );

  z-index: -1;
}
#pricing {
  background:
    radial-gradient(
      circle at top left,
      rgba(0, 104, 249, 0.04),
      transparent 28%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(0, 104, 249, 0.04),
      transparent 28%
    ),
    #fff;
  padding: 100px 0;
}
.pricing-card {
  max-width: 440px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 40px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.price-badge {
  display: inline-block;
  background: var(--color-badge-bg);
  color: var(--color-primary);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 16px;
}

.price-amount {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 4px;
}

.price-amount span {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-muted);
}

.price-sub {
  color: var(--color-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.price-features {
  list-style: none;
  text-align: left;
  margin-bottom: 32px;
}

.price-features li {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-ink);
}

.price-features i {
  color: var(--color-primary);
}

.full-width {
  width: 100%;
}

.faq-section {
  padding: 100px 0;
}

.faq-container {
  max-width: 680px;
  margin: 0 auto;
}

.faq-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}

.faq-item h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.faq-item p {
  color: var(--color-muted);
  font-size: 15px;
  line-height: 1.6;
}

/* ==========================================================================
   CTA BAND & FOOTER
   ========================================================================== */
.cta-section {
  padding: 60px 0 100px;
}

.cta-band {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 60px 30px;
  text-align: center;
}

.cta-band h2 {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  margin-bottom: 12px;
}

.cta-band p {
  font-size: 16px;
  color: var(--color-muted);
  margin-bottom: 28px;
}

footer {
  padding: 40px 0;
  background: #ffffff;
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--color-muted);
}
.footer-links span {
  display: flex;
  align-items: center;
}

.footer-links a {
  text-decoration: none;
  color: inherit;
}

.footer-links a:hover {
  color: var(--color-primary);
}

.footer-copy {
  font-size: 13px;
  color: var(--color-muted);
}

/* ==========================================================================
   SCROLL REVEAL (Safe fallback so content is never invisible)
   ========================================================================== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   MOBILE RESPONSIVENESS
   ========================================================================== */
@media (max-width: 900px) {
  .hero-grid,
  .metrics-grid,
  .feature-grid,
  .steps-grid,
  .testimonial-masonry {
    grid-template-columns: 1fr;
  }

  .navbar {
    overflow: visible;
  }

  .hero-grid {
    text-align: center;
  }

  .hero-actions,
  .hero-trust-badges {
    justify-content: center;
  }

  .nav-links,
  .nav-cta {
    display: none;
  }

  .mobile-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--color-ink); /* Default color when menu is closed */
    position: relative;
    z-index: 1001; /* Must sit ABOVE the .mobile-sidebar (1000) */
    transition: color 0.3s ease;
  }
  .mobile-sidebar .fa-xmark {
    color: #ffffff !important; /* Forces the X icon to be white over the black background */

    position: absolute;
    top: 40px;
    right: 40px;
    font-size: 25px;
  }
  .mobile-sidebar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
    flex-direction: column;

    width: 100%;
    height: 100dvh;
    background-color: black;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    padding: 100px 20px;
    z-index: 1000;

    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .mobile-sidebar a {
    text-decoration: none;
    font-size: 25px;
    color: white;
  }
  .mobile-sidebar .btn-ghost {
    background-color: black;
    border: 2px solid #0068f9;

    width: 200px;
  }
  .mobile-sidebar .btn-ghost:hover {
    background-color: #000100;
  }
  .mobile-sidebar .btn-primary {
    background-color: #0068f9;
    color: white;
    width: 200px;
  }
  .mobile-sidebar .btn a {
    font-size: 17px;
  }
  .show-sidebar {
    transform: translateY(0);
  }

  .footer-inner {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  .footer-links span {
    flex-direction: column;
  }
}
