:root {
  --c-bg: #ffffff;
  --c-bg-light: #f7f9fb;
  --c-bg-dark: #0a0e1a;
  --c-bg-darker: #050810;
  --c-text: #0f172a;
  --c-muted: #64748b;
  --c-primary: #4f46e5;
  --c-primary-dark: #4338ca;
  --c-primary-light: #818cf8;
  --c-border: #e2e8f0;
  --c-accent: #06b6d4;
  --c-magenta: #ec4899;
  --grad-1: linear-gradient(135deg, #4f46e5 0%, #ec4899 100%);
  --grad-2: linear-gradient(135deg, #06b6d4 0%, #4f46e5 100%);
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 4px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 16px 48px rgba(15, 23, 42, .12);
  --max-w: 1180px;
  --font: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--c-primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--c-primary-dark); }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ----- Header ----- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 68px;
}
.brand img { display: block; }
.nav-links {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 28px; align-items: center;
}
.nav-links a {
  color: var(--c-text); font-weight: 500; font-size: 14.5px;
  letter-spacing: -.005em;
}
.nav-links a:hover { color: var(--c-primary); }
.btn-login {
  background: var(--grad-1); color: #fff !important;
  padding: 9px 18px; border-radius: 999px;
  font-weight: 600; font-size: 14px;
  box-shadow: 0 4px 14px rgba(79, 70, 229, .35);
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(79, 70, 229, .45); }
.nav-toggle, .nav-toggle-label { display: none; }

/* ----- Buttons ----- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: 999px;
  font-weight: 600; font-size: 15px; cursor: pointer;
  transition: all .18s ease;
  border: 2px solid transparent;
  font-family: var(--font);
}
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-primary { background: var(--grad-1); color: #fff; box-shadow: 0 6px 22px rgba(79, 70, 229, .4); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(79, 70, 229, .5); color: #fff; }
.btn-ghost {
  background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { background: rgba(255,255,255,.16); color: #fff; }
.btn-outline {
  background: transparent; color: var(--c-primary); border-color: var(--c-primary);
}
.btn-outline:hover { background: var(--c-primary); color: #fff; }

/* ----- Hero ----- */
.hero {
  position: relative; overflow: hidden;
  background: var(--c-bg-dark);
  color: #fff;
  padding: 120px 0 100px;
  text-align: center;
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 30% 20%, rgba(79, 70, 229, .35), transparent 60%),
    radial-gradient(ellipse 60% 40% at 75% 80%, rgba(236, 72, 153, .25), transparent 60%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(6, 182, 212, .2), transparent 70%);
  z-index: 0;
}
.hero-inner { position: relative; z-index: 1; max-width: 880px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  font-size: 13px; font-weight: 500; color: rgba(255,255,255,.85);
  margin-bottom: 26px; backdrop-filter: blur(6px);
}
.pill-dot {
  display: inline-block; width: 8px; height: 8px; background: #4ade80; border-radius: 50%;
  box-shadow: 0 0 12px #4ade80; animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 4rem); margin: 0 0 22px; font-weight: 800;
  letter-spacing: -.025em; line-height: 1.1;
}
.grad {
  background: linear-gradient(135deg, #818cf8 0%, #f0abfc 50%, #67e8f9 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .lead {
  font-size: clamp(1.05rem, 2vw, 1.2rem); max-width: 700px; margin: 0 auto 40px;
  color: rgba(255,255,255,.78); line-height: 1.6;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 60px; }
.hero-stats {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  max-width: 600px; margin: 0 auto;
}
.hero-stats li { text-align: center; }
.hero-stats strong {
  display: block; font-size: clamp(1.5rem, 3vw, 2.2rem);
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,.6) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}
.hero-stats span { font-size: 12.5px; color: rgba(255,255,255,.6); }
@media (max-width: 540px) {
  .hero-stats { grid-template-columns: 1fr; gap: 14px; }
}

/* ----- Section base ----- */
.section { padding: 96px 0; }
.section.dark { background: var(--c-bg-dark); color: #fff; position: relative; overflow: hidden; }
.section.dark::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 40% at 20% 30%, rgba(79, 70, 229, .15), transparent 60%);
  pointer-events: none;
}
.section.dark > .container { position: relative; }
.section.dark .muted { color: rgba(255,255,255,.7); }
.section.light { background: var(--c-bg-light); }
.section-header { margin: 0 0 64px; max-width: 720px; }
.section-header.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-header h2 {
  font-size: clamp(1.9rem, 4vw, 2.75rem); margin: 12px 0 16px; font-weight: 700;
  letter-spacing: -.02em; line-height: 1.15;
}
.eyebrow {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: rgba(79, 70, 229, .1); color: var(--c-primary);
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase;
}
.eyebrow.light { background: rgba(255,255,255,.08); color: var(--c-primary-light); }
.muted { color: var(--c-muted); font-size: 1.05rem; margin: 0; line-height: 1.65; }

/* ----- AI section ----- */
.ai-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.ai-card {
  padding: 32px 28px; background: #fff;
  border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  transition: transform .25s, box-shadow .25s, border-color .25s;
  position: relative; overflow: hidden;
}
.ai-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad-1); transform: scaleX(0); transform-origin: left;
  transition: transform .3s;
}
.ai-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.ai-card:hover::before { transform: scaleX(1); }
.ai-icon {
  width: 52px; height: 52px; border-radius: var(--radius);
  background: var(--grad-1); color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.ai-card h3 { margin: 0 0 10px; font-size: 1.18rem; font-weight: 600; letter-spacing: -.01em; }
.ai-card p { margin: 0; color: var(--c-muted); font-size: 14.5px; }

/* ----- Modalidades ----- */
.modalidades-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}
.modalidades-grid li {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius); padding: 22px 16px;
  text-align: center;
  transition: transform .15s, background .15s, border-color .15s;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.modalidades-grid li:hover { background: rgba(255,255,255,.08); transform: translateY(-2px); border-color: rgba(255,255,255,.15); }
.mod-icon { font-size: 1.6rem; margin-bottom: 6px; }
.modalidades-grid strong { color: #fff; font-size: 15px; font-weight: 600; }
.modalidades-grid span { color: rgba(255,255,255,.55); font-size: 12.5px; }

/* ----- Split (Anunciantes / Afiliados) ----- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split.reverse .split-text { order: 1; }
.split.reverse .split-visual { order: 0; }
.split-text h2 { margin: 14px 0 18px; }
.split-text .muted { margin-bottom: 26px; font-size: 1.05rem; }
.split-visual img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
@media (max-width: 880px) {
  .split, .split.reverse { grid-template-columns: 1fr; }
  .split.reverse .split-text, .split.reverse .split-visual { order: initial; }
}

.feature-list { list-style: none; padding: 0; margin: 0 0 30px; display: grid; gap: 10px; }
.feature-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--c-text); }
.check {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--grad-1); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}

/* ----- Merchants ----- */
.merchants-tabs {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 36px;
}
.merchants-tab {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--c-border);
  background: #fff; cursor: pointer; font-family: var(--font); font-size: 13px;
  font-weight: 500; color: var(--c-muted);
  transition: all .15s;
}
.merchants-tab.active, .merchants-tab:hover {
  background: var(--c-text); color: #fff; border-color: var(--c-text);
}
.merchants-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.merchant-card {
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 22px 16px; text-align: center;
  transition: all .2s; cursor: pointer; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
  min-height: 150px; justify-content: space-between;
}
.merchant-card:hover { border-color: var(--c-primary); transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; color: inherit; }
.merchant-logo {
  height: 50px; display: flex; align-items: center; justify-content: center; width: 100%;
}
.merchant-logo img { max-height: 44px; max-width: 100%; filter: grayscale(80%); transition: filter .2s; }
.merchant-card:hover .merchant-logo img { filter: grayscale(0); }
.merchant-meta {
  display: flex; flex-direction: column; gap: 4px; align-items: center; width: 100%;
}
.merchant-name { font-weight: 600; font-size: 14px; color: var(--c-text); }
.merchant-tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--c-bg-light); color: var(--c-muted);
  font-size: 11px; font-weight: 500;
}
.merchant-rate {
  font-size: 12.5px; color: var(--c-primary); font-weight: 600;
}
.merchants-cta { text-align: center; margin-top: 36px; }

/* ----- Clients (logos legacy) ----- */
.clients-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 30px; align-items: center;
}
.clients-grid li {
  display: flex; align-items: center; justify-content: center;
  padding: 14px; filter: grayscale(100%) opacity(.6);
  transition: filter .2s;
}
.clients-grid li:hover { filter: grayscale(0) opacity(1); }
.clients-grid img { max-height: 54px; width: auto; }

/* ----- CTA band ----- */
.cta-band {
  background: var(--c-bg-dark);
  position: relative; overflow: hidden;
}
.cta-band::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(79, 70, 229, .25), transparent 70%);
}
.cta-inner { text-align: center; max-width: 680px; margin: 0 auto; position: relative; }
.cta-inner h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 14px; color: #fff; letter-spacing: -.02em; }
.cta-inner p { margin: 0 0 32px; font-size: 1.1rem; color: rgba(255,255,255,.78); }
.cta-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ----- Footer ----- */
.site-footer {
  background: var(--c-bg-darker); color: rgba(255,255,255,.7);
  padding: 64px 0 24px; font-size: 14px;
}
.footer-inner {
  display: grid; grid-template-columns: 1.2fr 2fr; gap: 48px;
  padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-brand img { margin-bottom: 14px; filter: brightness(1.2) contrast(1.1); }
.footer-brand p { margin: 0; color: rgba(255,255,255,.55); font-size: 13.5px; line-height: 1.6; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.footer-cols h4 {
  margin: 0 0 14px; font-size: 13px; font-weight: 600; color: #fff;
  text-transform: uppercase; letter-spacing: .06em;
}
.footer-cols ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-cols a { color: rgba(255,255,255,.65); font-size: 13.5px; }
.footer-cols a:hover { color: #fff; }
.footer-bottom { padding-top: 24px; text-align: center; color: rgba(255,255,255,.45); }
@media (max-width: 760px) {
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
}

/* ----- Responsive nav ----- */
@media (max-width: 880px) {
  .nav-toggle-label {
    display: block; cursor: pointer;
    width: 28px; height: 22px; position: relative;
  }
  .nav-toggle-label span,
  .nav-toggle-label span::before,
  .nav-toggle-label span::after {
    display: block; position: absolute; height: 2px; width: 100%;
    background: var(--c-text); border-radius: 2px;
    transition: transform .2s;
  }
  .nav-toggle-label span { top: 50%; transform: translateY(-50%); }
  .nav-toggle-label span::before { content: ""; top: -8px; }
  .nav-toggle-label span::after { content: ""; bottom: -8px; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--c-border);
    max-height: 0; overflow: hidden; transition: max-height .2s;
  }
  .nav-toggle:checked ~ .nav-links { max-height: 600px; }
  .nav-links li { border-top: 1px solid var(--c-border); }
  .nav-links a { display: block; padding: 16px 24px; }
  .btn-login { border-radius: 0; box-shadow: none; }
  .section { padding: 64px 0; }
  .hero { padding: 80px 0 70px; }
  .section-header { margin-bottom: 40px; }
}

/* ============ Chat Widget ============ */
#cw-chat-root {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  font-family: var(--font);
}
#cw-chat-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--grad-1); color: #fff;
  border: none; border-radius: 999px;
  padding: 14px 22px 14px 18px;
  font-size: 14.5px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
  box-shadow: 0 8px 24px rgba(79, 70, 229, .4), 0 0 0 6px rgba(79, 70, 229, .12);
  position: relative;
  transition: transform .15s, box-shadow .15s;
}
#cw-chat-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(79, 70, 229, .5), 0 0 0 8px rgba(79, 70, 229, .15); }
#cw-chat-btn.open { transform: scale(0); pointer-events: none; }
.cw-chat-pulse {
  position: absolute; top: 14px; right: 16px; width: 8px; height: 8px;
  background: #4ade80; border-radius: 50%; box-shadow: 0 0 12px #4ade80;
}
@media (max-width: 480px) {
  .cw-chat-btn-text { display: none; }
  #cw-chat-btn { padding: 14px; }
}

#cw-chat-panel {
  position: absolute; bottom: 0; right: 0;
  width: 380px; max-width: calc(100vw - 24px);
  height: 560px; max-height: calc(100vh - 80px);
  background: #fff; border-radius: 18px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .25);
  display: flex; flex-direction: column; overflow: hidden;
  animation: slideUp .25s ease;
}
#cw-chat-panel[hidden] { display: none !important; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } }
#cw-chat-panel header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  background: var(--grad-1); color: #fff;
}
.cw-chat-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
}
.cw-chat-title { flex: 1; line-height: 1.25; }
.cw-chat-title strong { font-size: 14.5px; font-weight: 600; display: block; }
.cw-chat-title small { font-size: 11.5px; opacity: .8; display: flex; align-items: center; gap: 5px; }
.cw-chat-status {
  display: inline-block; width: 6px; height: 6px; background: #4ade80; border-radius: 50%;
}
#cw-chat-close {
  background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 50%;
  cursor: pointer; font-size: 20px; line-height: 1;
}
#cw-chat-close:hover { background: rgba(255,255,255,.28); }

#cw-chat-messages {
  flex: 1; overflow-y: auto;
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
  background: #fafbfc;
}
.cw-msg p {
  margin: 0; padding: 11px 14px; border-radius: 14px;
  font-size: 14px; line-height: 1.5;
  max-width: 85%; word-wrap: break-word;
}
.cw-msg-bot p { background: #fff; color: var(--c-text); border-bottom-left-radius: 4px; box-shadow: 0 1px 3px rgba(15, 23, 42, .06); }
.cw-msg-user { display: flex; justify-content: flex-end; }
.cw-msg-user p { background: var(--grad-1); color: #fff; border-bottom-right-radius: 4px; }
.cw-msg p a { color: inherit; text-decoration: underline; }
.cw-msg-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0; }
.cw-chip {
  background: #fff; border: 1px solid var(--c-border);
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  font-size: 12.5px; color: var(--c-text); font-family: var(--font);
  transition: all .15s;
}
.cw-chip:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

.cw-typing p { background: #fff; padding: 14px; }
.cw-typing p span {
  display: inline-block; width: 7px; height: 7px; background: var(--c-muted);
  border-radius: 50%; margin-right: 4px; animation: typing 1.2s infinite;
}
.cw-typing p span:nth-child(2) { animation-delay: .2s; }
.cw-typing p span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,100%{transform:translateY(0);opacity:.4} 50%{transform:translateY(-3px);opacity:1} }

#cw-chat-form {
  display: flex; gap: 8px; padding: 14px;
  background: #fff; border-top: 1px solid var(--c-border);
}
#cw-chat-input {
  flex: 1; border: 1px solid var(--c-border); border-radius: 999px;
  padding: 10px 16px; font-size: 14px; font-family: var(--font);
  outline: none; transition: border-color .15s;
}
#cw-chat-input:focus { border-color: var(--c-primary); }
#cw-chat-form button[type=submit] {
  background: var(--grad-1); color: #fff; border: none;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
#cw-chat-form button[type=submit]:hover { transform: scale(1.05); }
