/* ════════════════════════════════════════════════════════════
   ConverteAí - Página de Webhooks e Requisição externa
   Usa home.css (tokens, nav, botões, seções, janelas .mcp-*).
   ════════════════════════════════════════════════════════════ */

.wh-hero { padding-bottom: 72px; }
.wh-hero .hero-sub { max-width: 660px; }
.wh-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-light);
  background: var(--primary-soft);
  border: 1px solid rgba(255,107,0,.25);
  border-radius: 100px;
  padding: 7px 14px;
  margin-bottom: 26px;
}

/* ── palco ao vivo do topo ── */
.wh-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1.15fr);
  margin-top: 56px;
  text-align: left;
}
.wh-stage .mcp-window { height: 330px; }
.wh-feed, .wh-log {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  overflow: hidden;
}
.wh-event {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  animation: mcp-in .45s cubic-bezier(.22,1,.36,1) both;
  flex-shrink: 0;
  min-width: 0;
}
.wh-event b { color: var(--text); font-weight: 600; }
.wh-event-ico {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
  background: rgba(255,255,255,.06);
}
.wh-event-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-log { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; gap: 6px; background: rgba(0,0,0,.25); }
.wh-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  padding: 6px 8px;
  border-radius: 8px;
  animation: mcp-in .35s ease both;
  flex-shrink: 0;
}
.wh-line .t { color: var(--muted-soft); }
.wh-line .ev { color: #93C5FD; }
.wh-line .ok { color: #34D399; font-weight: 700; }
.wh-line .err { color: #F87171; font-weight: 700; }
.wh-line .retry { color: #FBBF24; }
.wh-line .sig {
  margin-left: auto;
  font-size: 10.5px;
  color: #6EE7B7;
  border: 1px solid rgba(52,211,153,.3);
  border-radius: 6px;
  padding: 1px 6px;
}
.wh-line.bad { background: rgba(248,113,113,.07); }
.wh-line.good { background: rgba(52,211,153,.06); }

/* ── as duas peças ── */
.wh-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.wh-piece { padding: 30px 28px; }
.wh-piece h3 { font-size: 21px; }
.wh-piece p { margin-bottom: 18px; }
.wh-kicker {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--primary-light);
  margin-bottom: 10px;
  position: relative;
}
.wh-diagram {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 14px;
  border-radius: 14px;
  background: rgba(0,0,0,.25);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}
.wh-node {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 7px 10px;
  white-space: nowrap;
}
.wh-node.brand { border-color: rgba(255,107,0,.45); color: var(--primary-light); }
.wh-wire {
  flex: 1;
  height: 2px;
  min-width: 18px;
  background: repeating-linear-gradient(90deg, rgba(255,138,61,.6) 0 6px, transparent 6px 12px);
  background-size: 24px 2px;
  animation: mcp-flow 1s linear infinite;
}
.wh-wire.both { background: repeating-linear-gradient(90deg, rgba(110,231,183,.6) 0 6px, transparent 6px 12px); background-size: 24px 2px; animation: wh-flow-both 1.6s ease-in-out infinite alternate; }
@keyframes wh-flow-both { from { background-position: 0 0; } to { background-position: 48px 0; } }
.wh-more {
  position: relative;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-light);
  text-decoration: none;
}
.wh-more:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ── blocos de detalhe (texto + visual) ── */
.wh-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 56px;
  align-items: start;
}
.wh-events { list-style: none; display: grid; gap: 8px; margin-top: 26px; }
.wh-events li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  font-size: 15px;
  color: rgba(255,255,255,.88);
  transition: border-color .25s, transform .25s;
}
.wh-events li:hover { border-color: rgba(255,107,0,.35); transform: translateX(3px); }
.wh-events code {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--muted-soft);
}
.wh-events .ico { width: 22px; text-align: center; }

.wh-code {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: #0A0B12;
  overflow: hidden;
  box-shadow: 0 40px 100px -40px rgba(0,0,0,.9), 0 20px 60px -30px rgba(255,107,0,.18);
}
.wh-code-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}
.wh-code pre {
  margin: 0;
  padding: 18px 18px 22px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  color: #C9CEDC;
}
.wh-code .k { color: #93C5FD; }
.wh-code .s { color: #FDBA74; }
.wh-code .h { color: #6EE7B7; }
.wh-code .c { color: var(--muted-soft); }
.wh-code .hl { background: rgba(255,107,0,.12); border-radius: 4px; box-shadow: 0 0 0 3px rgba(255,107,0,.12); }
.wh-code-note { font-size: 13px; color: var(--muted-soft); margin-top: 12px; }

.wh-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 56px;
}
.wh-item { padding: 24px 22px; }
.wh-item h3 { font-size: 16.5px; }
.wh-item p { font-size: 14px; }
.wh-item .feature-icon { width: 42px; height: 42px; border-radius: 12px; margin-bottom: 16px; font-size: 19px; }

/* linha do tempo das novas tentativas */
.wh-retry {
  margin-top: 18px;
  padding: 26px 24px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.wh-retry-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 22px; }
.wh-retry-head h3 { font-size: 17px; }
.wh-retry-head p { font-size: 13.5px; color: var(--muted); }
.wh-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
}
.wh-track::before {
  content: '';
  position: absolute;
  left: 6%; right: 6%;
  top: 9px;
  height: 2px;
  background: linear-gradient(90deg, #F87171, #FBBF24 40%, #34D399);
  opacity: .5;
}
.wh-stop { position: relative; text-align: center; font-size: 12px; color: var(--muted); }
.wh-stop i {
  display: block;
  width: 20px; height: 20px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid #FBBF24;
}
.wh-stop:first-child i { border-color: #F87171; }
.wh-stop:last-child i { border-color: #34D399; background: rgba(52,211,153,.25); }
.wh-stop.lit i { box-shadow: 0 0 0 5px rgba(251,191,36,.18); }
.wh-stop b { display: block; color: var(--text); font-size: 12.5px; }

/* ── lista da requisição externa ── */
.wh-req-list { list-style: none; display: grid; gap: 14px; margin-top: 26px; }
.wh-req-list li {
  position: relative;
  padding-left: 30px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}
.wh-req-list li strong { color: var(--text); font-weight: 600; }
.wh-req-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8A3D' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat;
  border: 1px solid rgba(255,107,0,.25);
}
.wh-req-list code, .faq-content code, .wh-code-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .86em;
  color: var(--primary-light);
  background: var(--primary-soft);
  border: 1px solid rgba(255,107,0,.2);
  border-radius: 6px;
  padding: 1px 6px;
  overflow-wrap: anywhere;
}

/* ── requisição externa: o fluxo ── */
.wh-flow {
  display: grid;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012));
}
.wh-step {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  opacity: .45;
  transition: opacity .35s, border-color .35s, background .35s;
}
.wh-step.on { opacity: 1; border-color: var(--border-strong); background: rgba(255,255,255,.03); }
.wh-step-ico {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  background: rgba(255,255,255,.06);
}
.wh-step small { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-soft); margin-bottom: 4px; }
.wh-bubble {
  display: inline-block;
  font-size: 13.5px;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.9);
}
.wh-bubble.out { background: linear-gradient(135deg, var(--primary), #FF7E2D); color: #fff; }
.wh-mono {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #C9CEDC;
  background: #0A0B12;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  overflow-wrap: anywhere;
}
.wh-mono .s { color: #FDBA74; }
.wh-mono .k { color: #93C5FD; }
.wh-branches { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.wh-branch {
  font-size: 12px;
  font-weight: 700;
  border-radius: 9px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all .3s;
}
.wh-branch.ok.on { color: #34D399; border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.1); }
.wh-branch.err.on { color: #F87171; border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.1); }
.wh-step .alt { display: none; }
.wh-flow.failing .wh-step .alt { display: inline-block; }
.wh-flow.failing .wh-step .main { display: none; }

/* ── usos ── */
.wh-uses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.wh-uses .feature-card { padding: 28px 26px; }
.wh-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; position: relative; }
.wh-chips span {
  font-size: 13.5px;
  color: rgba(255,255,255,.86);
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,.03);
  border-radius: 100px;
  padding: 7px 13px;
}

/* ── pelo MCP ── */
.wh-prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
}
.wh-prompt {
  justify-self: stretch;
  padding: 14px 16px;
  border-radius: 16px 16px 6px 16px;
  background: linear-gradient(135deg, rgba(255,107,0,.18), rgba(255,107,0,.06));
  border: 1px solid rgba(255,107,0,.3);
  font-size: 15px;
  color: #fff;
}

/* ── teste real ── */
.wh-proof {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  counter-reset: proof;
}
.wh-proof li {
  list-style: none;
  position: relative;
  padding: 20px 16px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  font-size: 14px;
  color: rgba(255,255,255,.86);
  line-height: 1.55;
}
.wh-proof li::before {
  counter-increment: proof;
  content: counter(proof);
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  margin-bottom: 12px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  color: #34D399;
  background: rgba(52,211,153,.12);
  border: 1px solid rgba(52,211,153,.3);
}

.wh-center { text-align: center; margin-bottom: 52px; }
.wh-center .section-title, .wh-center .section-sub { margin-left: auto; margin-right: auto; }
.wh-center .section-title { max-width: 760px; }
.wh-alt { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ── responsivo ── */
@media (max-width: 980px) {
  .wh-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 64px auto; }
  .wh-stage .mcp-window { height: 300px; }
  .wh-pair, .wh-split, .wh-uses { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .wh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wh-proof { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .wh-grid, .wh-proof, .wh-prompts { grid-template-columns: minmax(0, 1fr); }
  .wh-track { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 18px; }
  .wh-track::before { display: none; }
  .wh-events code { display: none; }
  .wh-diagram { padding: 12px 10px; }
  .wh-node { font-size: 11px; padding: 6px 8px; }
  .wh-code pre { font-size: 11.5px; }
}
