:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --border: #e3e6ef;
  --text: #141824;
  --muted: #5f6678;
  --accent: #f38020;        /* laranja Cloudflare */
  --accent-2: #7c5cff;
  --ok: #16a34a;
  --shadow: 0 1px 2px rgba(20, 24, 36, .04), 0 8px 24px rgba(20, 24, 36, .06);
  --radius: 16px;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d13;
    --surface: #141821;
    --surface-2: #1b2030;
    --border: #262c3d;
    --text: #eef0f6;
    --muted: #98a0b4;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.glow {
  position: fixed;
  inset: -30vh -20vw auto;
  height: 70vh;
  background:
    radial-gradient(40% 60% at 30% 40%, rgba(243, 128, 32, .22), transparent 70%),
    radial-gradient(40% 60% at 70% 30%, rgba(124, 92, 255, .20), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 72px 16px 40px;
}

/* Hero */
.hero { text-align: center; margin-bottom: 40px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: .85rem;
  color: var(--muted);
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, .6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  70%  { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -.03em;
  margin: 20px 0 16px;
}

.grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead { max-width: 560px; margin: 0 auto; color: var(--muted); font-size: 1.08rem; }
.lead strong { color: var(--text); font-weight: 600; }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

h2 { margin: 0; font-size: 1.2rem; letter-spacing: -.01em; }
.muted { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }

code {
  font-family: var(--mono);
  font-size: .85em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 6px;
}

/* Botão */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  padding: 12px 22px;
  font: 600 .95rem "Inter", sans-serif;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #e8590c);
  box-shadow: 0 6px 18px rgba(243, 128, 32, .35);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.btn:hover  { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(243, 128, 32, .45); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .7; cursor: wait; }

.spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Estatísticas */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid transparent;
  transition: border-color .3s, transform .3s;
}

.stats.filled .stat { border-color: var(--border); animation: pop .4s ease both; }
.stats.filled .stat:nth-child(2) { animation-delay: .05s; }
.stats.filled .stat:nth-child(3) { animation-delay: .1s; }
.stats.filled .stat:nth-child(4) { animation-delay: .15s; }

@keyframes pop {
  from { opacity: .3; transform: translateY(6px); }
  to   { opacity: 1;  transform: none; }
}

.stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.stat-sub   { font-size: .85rem; color: var(--muted); }

/* JSON */
.raw { margin-top: 20px; }
.raw summary { cursor: pointer; color: var(--muted); font-size: .9rem; user-select: none; }
.raw summary:hover { color: var(--text); }

pre {
  margin: 12px 0 0;
  padding: 16px;
  border-radius: 12px;
  background: #0f1219;
  color: #d6dbe8;
  font: .85rem/1.6 var(--mono);
  overflow-x: auto;
}

/* Como funciona */
.flow { margin-top: 48px; }
.flow h2 { margin-bottom: 16px; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.steps li {
  display: flex;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.step-n {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
}

.steps h3 { margin: 4px 0 4px; font-size: 1rem; }
.steps p  { margin: 0; color: var(--muted); font-size: .92rem; }

.foot { margin-top: 48px; text-align: center; color: var(--muted); font-size: .85rem; }
