:root {
  --bg: #060a11;
  --panel: #0c131f;
  --panel-2: #0f1928;
  --line: #1b2738;
  --line-soft: #16202f;
  --text: #e6edf6;
  --muted: #8ba0b8;
  --accent: #22d3ee;
  --accent-2: #0ea5c4;
  --green: #34d399;
  --red: #fb7185;
  --amber: #fbbf24;
  --radius: 16px;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Kufi Arabic", system-ui, sans-serif;
  line-height: 1.7;
}

body { min-height: 100vh; position: relative; overflow-x: hidden; }

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(700px 420px at 85% -10%, rgba(34, 211, 238, 0.14), transparent 60%),
    radial-gradient(600px 400px at 5% 0%, rgba(52, 211, 153, 0.09), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  z-index: 0;
}

.topbar, main, footer { position: relative; z-index: 1; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(6, 10, 17, 0.6);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #04121a;
  background: linear-gradient(135deg, var(--accent), var(--green));
  box-shadow: 0 0 26px rgba(34, 211, 238, 0.35);
  font-family: var(--mono);
}

.brand h1 { margin: 0; font-size: clamp(18px, 2.4vw, 24px); font-weight: 700; }
.brand p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-family: var(--mono);
}

.chip-live { color: var(--green); border-color: rgba(52, 211, 153, 0.35); }
.chip-live i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2s infinite;
}

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

main { padding: clamp(18px, 4vw, 44px); max-width: 1280px; margin: 0 auto; }

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: center;
  padding: clamp(18px, 3vw, 30px);
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), rgba(12, 19, 31, 0.9) 55%);
}

.hero h2 { margin: 0 0 8px; font-size: clamp(20px, 2.8vw, 28px); }
.hero p { margin: 0; color: var(--muted); font-size: 14px; }
.hero strong { color: var(--text); }

.hero-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 14px;
  flex-wrap: wrap;
}

.flow-node {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}
.flow-node.accent { color: var(--accent); border-color: rgba(34, 211, 238, 0.4); }
.flow-node.green { color: var(--green); border-color: rgba(52, 211, 153, 0.4); }
.flow-plus { color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), rgba(12, 19, 31, 0.7));
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.span-2 { grid-column: span 2; }

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

.card-head h3 { margin: 0; font-size: 16px; font-weight: 700; }

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

.btn {
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel-2);
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn:hover { border-color: rgba(34, 211, 238, 0.5); }
.btn:active { transform: translateY(1px); }

.btn.primary {
  border-color: rgba(34, 211, 238, 0.45);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(14, 165, 196, 0.12));
  color: #c8f7ff;
}

.btn[disabled] { opacity: 0.55; cursor: progress; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.muted code, .out code { font-family: var(--mono); font-size: 12px; color: var(--accent); }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(15, 25, 40, 0.7);
  min-width: 0;
}

.metric span { display: block; font-size: 11px; color: var(--muted); }
.metric b {
  display: block;
  font-size: 13px;
  font-family: var(--mono);
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.out {
  margin: 0;
  padding: 14px;
  min-height: 62px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #050910;
  color: #b9cadf;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.out.ok { border-color: rgba(52, 211, 153, 0.35); }
.out.fail { border-color: rgba(251, 113, 133, 0.35); }

.badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel-2);
  font-family: var(--mono);
}
.badge.ok { color: var(--green); border-color: rgba(52, 211, 153, 0.4); }
.badge.fail { color: var(--red); border-color: rgba(251, 113, 133, 0.4); }

.chain { display: flex; flex-direction: column; gap: 10px; }

.cert {
  position: relative;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(15, 25, 40, 0.65);
}

.cert-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cert-role { font-size: 11px; color: var(--accent); font-family: var(--mono); }
.cert-name { font-weight: 700; font-size: 13px; overflow-wrap: anywhere; }
.cert-meta { margin-top: 6px; font-size: 11px; color: var(--muted); font-family: var(--mono); overflow-wrap: anywhere; }

.cert + .cert::before {
  content: "";
  position: absolute;
  top: -11px;
  right: 26px;
  width: 1px;
  height: 10px;
  background: linear-gradient(var(--accent), transparent);
}

.bar {
  margin-top: 8px;
  height: 5px;
  border-radius: 999px;
  background: #0a1220;
  overflow: hidden;
}
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--accent)); }

.checks { display: flex; flex-direction: column; gap: 10px; }

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(15, 25, 40, 0.6);
}

.dot {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--mono);
}
.dot.ok { color: #052e22; background: var(--green); }
.dot.fail { color: #3a0713; background: var(--red); }

.check b { display: block; font-size: 13px; }
.check span { display: block; font-size: 11px; color: var(--muted); font-family: var(--mono); overflow-wrap: anywhere; }

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

.steps li {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(15, 25, 40, 0.55);
}

.step-num {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
}

.steps b { display: block; font-size: 13px; }
.steps span { font-size: 12px; color: var(--muted); }

.commands { display: flex; flex-direction: column; gap: 10px; }

.cmd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #050910;
}

.cmd code {
  flex: 1;
  font-family: var(--mono);
  font-size: 12px;
  color: #b9cadf;
  overflow-x: auto;
  white-space: nowrap;
  direction: ltr;
  text-align: left;
}

.copy {
  flex: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
}
.copy:hover { color: var(--accent); border-color: rgba(34, 211, 238, 0.4); }

footer {
  padding: 26px clamp(16px, 4vw, 48px) 42px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .topbar { position: static; }
  .metrics { grid-template-columns: 1fr; }
  .brand p { display: none; }
}

.card a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted rgba(34, 211, 238, 0.4);
}

.card a:hover { color: #7ee8f7; }

footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

.credit { display: block; margin-top: 6px; font-family: var(--mono); }
