* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #0b1120;
  color: #e6ebf5;
}

a { color: #34d399; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #1e293b;
}

.topbar .brand {
  font-weight: 700;
  font-size: 18px;
}

.topbar .brand span { color: #34d399; }

.topbar nav a {
  margin-left: 18px;
  text-decoration: none;
  color: #94a3b8;
  font-size: 14px;
}

.topbar nav a.active,
.topbar nav a:hover { color: #e6ebf5; }

.auth-wrap {
  max-width: 380px;
  margin: 80px auto;
  padding: 32px;
  background: #111a2e;
  border: 1px solid #1e293b;
  border-radius: 12px;
}

.auth-wrap h1 {
  font-size: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.container {
  max-width: 720px;
  margin: 32px auto;
  padding: 0 20px 60px;
}

label {
  display: block;
  font-size: 13px;
  color: #94a3b8;
  margin: 14px 0 6px;
}

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #263349;
  background: #0b1120;
  color: #e6ebf5;
  font-size: 14px;
}

textarea { resize: vertical; min-height: 70px; }

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  background: #34d399;
  color: #06281c;
}

button.secondary {
  background: transparent;
  border: 1px solid #263349;
  color: #e6ebf5;
}

button.danger {
  background: #ef4444;
  color: #2b0000;
}

.full { width: 100%; margin-top: 20px; }

.error {
  background: #3b1220;
  border: 1px solid #7f1d1d;
  color: #fca5a5;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 12px;
  display: none;
}

.card {
  background: #111a2e;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.card h2 {
  margin-top: 0;
  font-size: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.status-pill.disconnected { background: #3b1220; color: #fca5a5; }
.status-pill.pending_qr { background: #3b2f12; color: #fcd34d; }
.status-pill.connected { background: #123b25; color: #6ee7b7; }

.qr-box {
  text-align: center;
  margin: 20px 0;
}

.qr-box img {
  width: 220px;
  height: 220px;
  background: #fff;
  padding: 10px;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #1e293b;
}

th { color: #94a3b8; font-weight: 600; }

.row-actions { display: flex; gap: 8px; }

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.badge.in { background: #1e293b; color: #94a3b8; }
.badge.out { background: #123b25; color: #6ee7b7; }

.muted { color: #64748b; font-size: 13px; }

.rule-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.rule-form .full-span { grid-column: 1 / -1; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-box {
  background: #0b1120;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #34d399;
}

/* ---- Conversas (aba Mensagens) ---- */

.conversation-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 10px;
  border-bottom: 1px solid #1e293b;
  cursor: pointer;
}

.conversation-row:hover,
.conversation-row:focus-visible { background: #0f1830; }

.conversation-row .contact {
  font-weight: 700;
  font-size: 14px;
}

.conversation-badge {
  display: inline-block;
  background: #1e293b;
  color: #94a3b8;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  margin-left: 8px;
}

.conversation-row .preview {
  color: #94a3b8;
  font-size: 13px;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.conversation-row .meta {
  text-align: right;
  font-size: 11.5px;
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 65vh;
  overflow-y: auto;
  padding: 6px;
}

.chat-bubble {
  max-width: 72%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-bubble.in {
  align-self: flex-start;
  background: #1e293b;
  color: #e6ebf5;
  border-bottom-left-radius: 3px;
}

.chat-bubble.out {
  align-self: flex-end;
  background: #123b25;
  color: #d1fae5;
  border-bottom-right-radius: 3px;
}

.chat-bubble .time {
  display: block;
  font-size: 10px;
  color: #64748b;
  margin-top: 5px;
  text-align: right;
}

.chat-reply-form {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.chat-reply-form input {
  flex: 1;
}

.chat-reply-form button {
  white-space: nowrap;
}

.conversation-row .paused-badge {
  display: inline-block;
  background: #3b2f12;
  color: #fcd34d;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10.5px;
  margin-left: 8px;
}

/* ---- Editor de Fluxo de Venda ---- */

.flow-tab-section {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0 24px;
}

.flow-tab-section .card {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.flow-trigger-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.flow-toolbar {
  max-width: 1400px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #111a2e;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 10px 14px;
}

.flow-canvas-wrap {
  max-width: 1400px;
  margin: 0 auto 40px;
  position: relative;
  height: 70vh;
  min-height: 480px;
  overflow: auto;
  border: 1px solid #1e293b;
  border-radius: 12px;
  background:
    radial-gradient(circle, #1e293b 1px, transparent 1px) 0 0 / 22px 22px,
    #0b1120;
}

.flow-canvas {
  position: relative;
  width: 2600px;
  height: 1600px;
}

.flow-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 2600px;
  height: 1600px;
  pointer-events: none;
}

.flow-node {
  position: absolute;
  width: 240px;
  background: #111a2e;
  border: 1px solid #263349;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.flow-node-header {
  cursor: grab;
  user-select: none;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px 10px 0 0;
  background: #16213a;
}

.flow-node-header:active { cursor: grabbing; }

.flow-node-delete {
  background: none;
  border: none;
  color: #64748b;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}
.flow-node-delete:hover { color: #f87171; }

.flow-node-body {
  padding: 10px 12px 12px;
}

.flow-node-body textarea {
  min-height: 60px;
  font-size: 12px;
}

.flow-node-body input,
.flow-node-body select {
  font-size: 12px;
}

.flow-output-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 4px 12px;
  font-size: 11px;
  color: #94a3b8;
}

.flow-handle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0b1120;
  border: 2px solid #34d399;
  cursor: crosshair;
  flex-shrink: 0;
}

.flow-handle-in {
  position: absolute;
  left: -7px;
  top: 18px;
}

.flow-node > .flow-handle-out {
  position: absolute;
  right: -7px;
  top: 18px;
}

/* ---- Landing page ---- */

.landing-body {
  background: #07090f;
  overflow-x: hidden;
  position: relative;
}

.landing-body, .landing-body input, .landing-body textarea {
  font-family: "Plus Jakarta Sans", -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.landing-body h1,
.landing-body h2,
.landing-body h3,
.landing-body .brand,
.landing-body .btn-solid,
.landing-body .btn-outline,
.landing-body .num {
  font-family: "Unbounded", "Plus Jakarta Sans", sans-serif;
}

.landing-body .eyebrow {
  font-family: "JetBrains Mono", monospace;
}

/* Blobs de luz ambiente atras do conteudo -- profundidade em vez de um fundo
   solido chapado. Fixed para nao criar barras de scroll horizontal. */
.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}

.glow-a { width: 520px; height: 520px; background: #34d399; top: -180px; right: -120px; }
.glow-b { width: 460px; height: 460px; background: #f472b6; bottom: -160px; left: -140px; opacity: 0.22; }
.glow-c { width: 380px; height: 380px; background: #22d3ee; top: 40%; left: 55%; opacity: 0.16; }

.landing-nav, .hero, .landing-section, .cta-final, .landing-footer {
  position: relative;
  z-index: 1;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  max-width: 1080px;
  margin: 0 auto;
}

.landing-nav .brand { font-size: 16px; font-weight: 700; }
.landing-nav .brand span {
  background: linear-gradient(90deg, #34d399, #22d3ee 60%, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-nav .actions a { margin-left: 10px; text-decoration: none; }

.landing-nav .actions a.btn-outline {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid #263349;
  color: #e6ebf5;
  font-size: 13px;
}

.landing-nav .actions a.btn-solid {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 8px;
  background: #34d399;
  color: #06281c;
  font-weight: 600;
  font-size: 13px;
}

.hero {
  max-width: 820px;
  margin: 70px auto 50px;
  padding: 0 24px;
  text-align: center;
}

.hero .eyebrow {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid #263349;
  background: rgba(17, 26, 46, 0.7);
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.3px;
  margin-bottom: 26px;
}

.hero h1 {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.5px;
  margin: 0 0 22px;
}

.grad {
  background: linear-gradient(90deg, #34d399, #22d3ee 55%, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  color: #94a3b8;
  font-size: 18px;
  line-height: 1.65;
  margin: 0 auto 32px;
  max-width: 560px;
}

.hero .cta-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero .cta-row a.btn-solid {
  display: inline-block;
  padding: 15px 28px;
  border-radius: 10px;
  background: linear-gradient(90deg, #34d399, #22d3ee);
  color: #05130f;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 8px 30px rgba(52, 211, 153, 0.25);
}

.hero .cta-row a.btn-outline {
  display: inline-block;
  padding: 15px 28px;
  border-radius: 10px;
  border: 1px solid #263349;
  color: #e6ebf5;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid #1e293b;
  background: rgba(17, 26, 46, 0.6);
  color: #94a3b8;
  font-size: 12.5px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 rgba(52, 211, 153, 0.6);
  animation: liveDotPulse 2s infinite;
}

@keyframes liveDotPulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}

.landing-section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 60px 24px;
}

.landing-section h2 {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.3px;
  margin: 0 0 10px;
}

.landing-section p.section-lead {
  text-align: center;
  color: #94a3b8;
  max-width: 560px;
  margin: 0 auto 40px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-card {
  background: rgba(17, 26, 46, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 24px;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: #34d399;
  transform: translateY(-3px);
}

.feature-card .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.18), rgba(34, 211, 238, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 8px;
}

.feature-card p {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.65;
  margin: 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.step {
  text-align: center;
  padding: 10px;
}

.step .num {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, #34d399, #22d3ee);
  color: #05130f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  margin: 0 auto 16px;
}

.step h3 { font-size: 15px; font-weight: 500; margin: 0 0 8px; }
.step p { font-size: 13px; color: #94a3b8; line-height: 1.6; margin: 0; }

.cta-final {
  text-align: center;
  padding: 70px 24px 90px;
}

.cta-final h2 {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.3px;
  margin: 0 0 14px;
}
.cta-final p { color: #94a3b8; margin: 0 0 28px; }

.btn-lg {
  display: inline-block;
  padding: 16px 34px;
  border-radius: 10px;
  background: linear-gradient(90deg, #34d399, #22d3ee);
  color: #05130f;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 8px 30px rgba(52, 211, 153, 0.25);
}

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid #1e293b;
  background: rgba(255, 255, 255, 0.015);
  padding: 56px 24px 28px;
  overflow-x: hidden;
}

.footer-grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}

.footer-col a {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 12px;
  transition: color 0.15s ease;
  word-break: break-word;
}

.footer-col a:hover,
.footer-col a:focus-visible { color: #34d399; }

.footer-heading {
  font-family: "Unbounded", sans-serif;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #e6ebf5;
  margin-bottom: 16px;
}

.footer-brand .brand { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.footer-brand .muted { max-width: 320px; line-height: 1.65; }

.footer-bottom {
  max-width: 1080px;
  margin: 44px auto 0;
  padding-top: 22px;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: #64748b;
  font-size: 12.5px;
  font-family: "JetBrains Mono", monospace;
}

/* Entrada escalonada -- um unico carregamento bem orquestrado no hero, em
   vez de micro-interacoes espalhadas. Respeita reduced-motion. */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: revealUp 0.7s ease-out forwards;
  animation-delay: var(--d, 0s);
}

@keyframes revealUp {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}

.pricing-card {
  position: relative;
  background: rgba(17, 26, 46, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 30px 26px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.pricing-card.pricing-highlight {
  border-color: #34d399;
  box-shadow: 0 12px 40px rgba(52, 211, 153, 0.15);
  transform: translateY(-6px);
}

.pricing-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #34d399, #22d3ee);
  color: #05130f;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.pricing-name {
  font-family: "Unbounded", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pricing-price {
  font-family: "Unbounded", sans-serif;
  font-size: 40px;
  font-weight: 700;
  margin-top: 12px;
}

.pricing-price span { font-size: 16px; color: #94a3b8; font-weight: 500; }

.pricing-period {
  color: #64748b;
  font-size: 13px;
  margin-top: 2px;
}

.pricing-desc {
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.6;
  margin: 18px 0 24px;
  flex: 1;
}

.pricing-cta {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

@media (max-width: 720px) {
  .feature-grid, .steps, .pricing-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
  .landing-section h2 { font-size: 26px; }
  .cta-final h2 { font-size: 26px; }
  .pricing-card.pricing-highlight { transform: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
