/* =====================================================================
   /webhook-demo page — page-specific styles
   ===================================================================== */

.webhook-hero { padding: 140px 0 96px; }
.webhook-hero__inner { max-width: 1060px; }

.webhook-hero__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 56px;
}

.webhook-metric {
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.035);
}

.webhook-metric strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.webhook-metric span {
  color: var(--text-dim);
  font-size: 14px;
}

.webhook-section {
  position: relative;
  padding: 110px 0;
}

.webhook-section + .webhook-section {
  border-top: 1px solid var(--border);
}

.webhook-section .section__lede {
  max-width: 760px;
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1.6;
}

.webhook-demo-section {
  background: linear-gradient(180deg, var(--bg) 0%, rgba(255, 74, 0, 0.025) 50%, var(--bg) 100%);
}

.webhook-demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 24px;
  align-items: start;
  margin-top: 56px;
}

.webhook-form,
.webhook-preview,
.webhook-card,
.webhook-flow__step {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.webhook-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  padding: 28px;
}

.webhook-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.webhook-field--full {
  grid-column: 1 / -1;
}

.webhook-field label {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.webhook-field input,
.webhook-field select,
.webhook-field textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
  padding: 14px 15px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.webhook-field textarea {
  min-height: 128px;
  resize: vertical;
}

.webhook-field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 13px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.webhook-field input:focus,
.webhook-field select:focus,
.webhook-field textarea:focus {
  border-color: rgba(255, 74, 0, 0.68);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 0 0 4px rgba(255, 74, 0, 0.12);
}

.webhook-field p {
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1.5;
}

.webhook-form__actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
}

.webhook-status {
  grid-column: 1 / -1;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.035);
  font-size: 14px;
  line-height: 1.5;
}

.webhook-status.is-success {
  border-color: rgba(34, 197, 94, 0.4);
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.09);
}

.webhook-status.is-error {
  border-color: rgba(248, 113, 113, 0.42);
  color: #fecaca;
  background: rgba(248, 113, 113, 0.09);
}

.webhook-preview {
  position: sticky;
  top: 96px;
  overflow: hidden;
}

.webhook-preview__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}

.webhook-preview__head span {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.webhook-preview__head h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.webhook-preview__head button {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  font-weight: 700;
}

.webhook-preview__head button:hover {
  border-color: rgba(255, 74, 0, 0.4);
  background: var(--accent-soft);
}

.webhook-preview pre {
  max-height: 600px;
  margin: 0;
  overflow: auto;
  padding: 24px;
  color: #d4d4d8;
  background:
    radial-gradient(circle at top right, rgba(255, 74, 0, 0.08), transparent 34%),
    #0f0f14;
  font-size: 13px;
  line-height: 1.65;
}

.webhook-preview code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

.webhook-flow {
  display: grid;
  grid-template-columns: 1fr 34px 1fr 34px 1fr 34px 1fr;
  align-items: stretch;
  gap: 14px;
  margin-top: 56px;
}

.webhook-flow__step {
  min-height: 210px;
  padding: 28px 24px;
  background: rgba(255, 255, 255, 0.035);
}

.webhook-flow__step span {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 74, 0, 0.25);
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 800;
}

.webhook-flow__step h3 {
  margin-bottom: 10px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.webhook-flow__step p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.58;
}

.webhook-flow__arrow {
  position: relative;
  align-self: center;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 74, 0, 0.2), rgba(255, 74, 0, 0.65));
}

.webhook-flow__arrow::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-top: 1px solid rgba(255, 74, 0, 0.75);
  border-right: 1px solid rgba(255, 74, 0, 0.75);
  transform: translateY(-50%) rotate(45deg);
}

.webhook-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 56px;
}

.webhook-card {
  position: relative;
  overflow: hidden;
  padding: 34px 30px;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

.webhook-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 74, 0, 0.08), transparent 62%);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.webhook-card:hover {
  border-color: rgba(255, 74, 0, 0.34);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.webhook-card:hover::before {
  opacity: 1;
}

.webhook-card > * {
  position: relative;
}

.webhook-card__num {
  margin-bottom: 18px;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 15px;
  font-style: italic;
}

.webhook-card h3 {
  margin-bottom: 12px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.webhook-card p {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.6;
}

.webhook-cta-band {
  padding-bottom: 120px;
}

.webhook-cta-band__inner {
  padding: 56px;
  border: 1px solid rgba(255, 74, 0, 0.22);
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(255, 74, 0, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 74, 0, 0.08), rgba(255, 255, 255, 0.035));
  text-align: center;
}

.webhook-cta-band__inner p {
  max-width: 700px;
  margin: 18px auto 28px;
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1.6;
}

@media (max-width: 1040px) {
  .webhook-demo-grid,
  .webhook-cards,
  .webhook-hero__metrics {
    grid-template-columns: 1fr;
  }

  .webhook-preview {
    position: static;
  }

  .webhook-flow {
    grid-template-columns: 1fr;
  }

  .webhook-flow__arrow {
    width: 1px;
    height: 34px;
    justify-self: center;
    background: linear-gradient(180deg, rgba(255, 74, 0, 0.2), rgba(255, 74, 0, 0.65));
  }

  .webhook-flow__arrow::after {
    right: auto;
    left: 50%;
    top: auto;
    bottom: -1px;
    transform: translateX(-50%) rotate(135deg);
  }
}

@media (max-width: 720px) {
  .webhook-hero {
    padding: 118px 0 74px;
  }

  .webhook-section {
    padding: 76px 0;
  }

  .webhook-form {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .webhook-form__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .webhook-form__actions .btn {
    width: 100%;
  }

  .webhook-preview__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .webhook-preview__head button {
    width: 100%;
  }

  .webhook-preview pre {
    max-height: 420px;
    font-size: 12px;
  }

  .webhook-cta-band__inner {
    padding: 34px 24px;
  }
}
