/* Zaka Protect v2.0 - gate UI */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #05070d;
  --panel: #0a0e17;
  --panel-2: #0d121d;
  --line: #1a2334;
  --line-soft: #141c2a;
  --text: #eef2f8;
  --muted: #8a97ab;
  --muted-2: #5d6b80;
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, .12);
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(34, 211, 238, .10), transparent 60%),
    radial-gradient(700px 400px at 110% 10%, rgba(59, 130, 246, .10), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 20%, #000 0%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 42px 22px 90px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .95fr);
  gap: 22px;
  align-items: start;
}

/* ---------------- left card ---------------- */
.gate {
  background: linear-gradient(180deg, #0b1019 0%, #090d15 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px 34px 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .03);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cyan);
}
.badge::before {
  content: '';
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

h1.title {
  font-size: 40px;
  line-height: 1.14;
  letter-spacing: -.02em;
  margin: 16px 0 14px;
  font-weight: 800;
}

.subtitle {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.65;
  margin: 0 0 26px;
  max-width: 34em;
}

.widget-box {
  border: 1px solid var(--line-soft);
  background: #0d111a;
  border-radius: 16px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 118px;
}

.widget-inner {
  width: 100%;
  max-width: 360px;
  display: flex;
  justify-content: center;
}

.hint {
  text-align: center;
  color: var(--muted-2);
  font-size: 12.8px;
  line-height: 1.7;
  margin: 16px 0 0;
}
.hint b { color: #cbd5e1; font-weight: 600; }

.ts-skeleton {
  display: flex; align-items: center; gap: 9px;
  color: var(--muted-2); font-size: 12.6px;
}
.mini-spin {
  width: 12px; height: 12px; display: inline-block;
  border: 2px solid rgba(34, 211, 238, .25);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ---------------- steps ---------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 34px 0 18px;
  position: relative;
}
.step { text-align: center; position: relative; }
.step .dot {
  width: 30px; height: 30px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700;
  color: #6b7a90;
  background: #121a27;
  border: 1px solid #1e2a3d;
  position: relative;
  z-index: 2;
  transition: .35s ease;
}
.step .name {
  font-size: 12.6px;
  color: var(--muted-2);
  transition: .3s;
  padding: 0 4px;
  line-height: 1.4;
}
.step::after {
  content: '';
  position: absolute;
  top: 15px; left: 50%;
  width: 100%; height: 2px;
  background: #1a2333;
  z-index: 1;
}
.step:last-child::after { display: none; }

.step.done .dot { background: rgba(16, 185, 129, .16); border-color: rgba(16, 185, 129, .55); color: var(--green); }
.step.done .name { color: #a7b3c4; }
.step.done::after { background: linear-gradient(90deg, rgba(16, 185, 129, .7), rgba(16, 185, 129, .25)); }
.step.active .dot {
  background: #14324a; border-color: #2b8fb5; color: #7dd3fc;
  box-shadow: 0 0 0 5px rgba(34, 211, 238, .10), 0 0 22px rgba(34, 211, 238, .35);
}
.step.active .name { color: #e2f6fd; }
.step.busy .dot { animation: pulse 1.6s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, .35); }
  50% { box-shadow: 0 0 0 9px rgba(34, 211, 238, 0); }
}

/* ---------------- progress ---------------- */
.progress {
  margin: 26px 0 0;
  height: 5px;
  border-radius: 4px;
  background: #141d2b;
  overflow: hidden;
}
.progress i {
  display: block; height: 100%; width: 6%;
  border-radius: 4px;
  background: linear-gradient(90deg, #22d3ee, #38bdf8 45%, #0ea5e9);
  box-shadow: 0 0 14px rgba(34, 211, 238, .6);
  transition: width .7s ease;
}
.progress-text {
  font-size: 12.4px;
  color: var(--muted);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.progress-text .spin {
  width: 11px; height: 11px;
  border: 2px solid rgba(34, 211, 238, .25);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex: none;
}
.progress-text.done .spin { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.gate-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11.6px;
  color: var(--muted-2);
  flex-wrap: wrap;
}
.gate-foot .lbl { letter-spacing: .04em; }
.ray { color: #93a3b8; display: inline-flex; align-items: center; gap: 7px; }
.ray code { font-family: var(--mono); color: #cfe3f3; }
.ray-copy {
  background: transparent; border: 0; padding: 2px; cursor: pointer;
  color: #7c8b9f; display: inline-flex; align-items: center;
  border-radius: 4px; transition: .15s;
}
.ray-copy:hover { color: #cfe3f3; background: #16202f; }
.ray-copy.copied { color: #34d399; }
.scan-body { min-width: 0; }

/* ---------------- right column ---------------- */
.side { display: grid; gap: 16px; }

.card {
  background: linear-gradient(180deg, #0b1019 0%, #090d15 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
}
.card-label {
  font-size: 10.6px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
}

.timecard .big {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
}
.timecard .big b { font-size: 32px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.timecard .big span { font-size: 14px; color: #a9b6c7; }

.bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 62px;
  margin: 14px 0 8px;
}
.bars i {
  flex: 1;
  border-radius: 2px;
  background: linear-gradient(180deg, #34d399, #0f766e);
  opacity: .85;
  min-height: 3px;
  transition: height .45s cubic-bezier(.2, .8, .3, 1), opacity .3s;
}

.bars-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted-2);
}
.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #34d399;
}
.live::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: blink 1.8s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.scan-card { display: flex; gap: 14px; align-items: center; }
.radar { width: 62px; height: 62px; flex: none; position: relative; }
.radar svg { width: 100%; height: 100%; }
.radar .sweep {
  transform-origin: 32px 32px;
  animation: sweep 3.4s linear infinite;
}
@keyframes sweep { to { transform: rotate(360deg); } }

.scan-title { font-size: 14.5px; font-weight: 700; margin: 6px 0 6px; color: #e7eef8; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  font-size: 10.5px;
  padding: 2.5px 7px;
  border-radius: 5px;
  background: rgba(34, 211, 238, .09);
  border: 1px solid rgba(34, 211, 238, .22);
  color: #7dd3fc;
  font-weight: 600;
  letter-spacing: .02em;
}

.lat .val { font-size: 24px; font-weight: 800; margin-top: 8px; font-variant-numeric: tabular-nums; }
.lat .val span { font-size: 13px; color: #a9b6c7; font-weight: 600; }
.lat svg { width: 100%; height: 40px; margin-top: 6px; display: block; }
.lat polyline {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, .55));
}

.mini3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #090d15;
}
.mini3 .m {
  padding: 14px 12px;
  border-right: 1px solid var(--line-soft);
  text-align: center;
}
.mini3 .m:last-child { border-right: 0; }
.mini3 .k {
  font-size: 9.6px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 7px;
  font-weight: 600;
}
.mini3 .v { font-size: 12.8px; font-weight: 700; color: #e7eef8; line-height: 1.35; }
.mini3 .v.cyan { color: #67e8f9; }

/* IP card */
.ipcard .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 12.8px;
}
.ipcard .row:last-child { border-bottom: 0; padding-bottom: 0; }
.ipcard .k { color: var(--muted-2); display: flex; align-items: center; gap: 7px; flex: none; }
.ipcard .tag {
  font-size: 9.5px;
  letter-spacing: .06em;
  padding: 1.5px 6px;
  border-radius: 4px;
  background: #16202f;
  border: 1px solid #22304a;
  color: #93a3b8;
  font-weight: 700;
}
.ipcard .v {
  font-family: var(--mono);
  font-size: 12.2px;
  color: #a5f3fc;
  text-align: right;
  word-break: break-all;
  cursor: pointer;
  user-select: all;
}
.ipcard .v.na { color: #5d6b80; font-family: var(--font); font-size: 12px; }

/* help card */
.help {
  background: linear-gradient(180deg, #0d131f 0%, #0a0e17 100%);
  border-color: #1e293b;
}
.help h4 { margin: 0 0 12px; font-size: 14.5px; font-weight: 700; }
.help ol { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12.6px; line-height: 1.85; }
.help li { margin-bottom: 7px; }
.help b { color: #d6e2f0; }

/* chat bubble */
.bubble {
  position: fixed;
  right: 26px; bottom: 26px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2dd4bf, #0ea5e9);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 30px rgba(14, 165, 233, .45);
  z-index: 30;
  border: 0;
  cursor: pointer;
  transition: transform .2s;
}
.bubble:hover { transform: translateY(-2px) scale(1.04); }
.bubble svg { width: 24px; height: 24px; stroke: #04202b; }

/* ---------------- success popup ---------------- */
.popup {
  position: fixed; inset: 0;
  background: rgba(3, 6, 12, .72);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  opacity: 0;
  transition: opacity .25s ease;
}
.popup.show { display: flex; opacity: 1; }

.popup-box {
  width: 100%;
  max-width: 430px;
  background: linear-gradient(180deg, #0d1622 0%, #0a1017 100%);
  border: 1px solid rgba(16, 185, 129, .45);
  border-radius: 20px;
  padding: 32px 28px 26px;
  text-align: center;
  box-shadow: 0 40px 90px rgba(0, 0, 0, .65), 0 0 0 1px rgba(16, 185, 129, .12), 0 0 60px rgba(16, 185, 129, .16);
  transform: translateY(14px) scale(.96);
  transition: transform .32s cubic-bezier(.2, .9, .3, 1.1);
}
.popup.show .popup-box { transform: translateY(0) scale(1); }

.check-ring {
  width: 88px; height: 88px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, .22), rgba(16, 185, 129, .05));
  border: 2px solid rgba(16, 185, 129, .6);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.check-ring::after {
  content: '';
  position: absolute; inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(16, 185, 129, .25);
  animation: ripple 1.8s ease-out infinite;
}
@keyframes ripple {
  0% { transform: scale(.9); opacity: .9; }
  100% { transform: scale(1.25); opacity: 0; }
}
.check-ring svg { width: 40px; height: 40px; }
.check-ring svg path {
  stroke: #34d399; stroke-width: 3.2; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 40;
  animation: draw .5s .1s forwards ease-out;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.popup-box h2 { margin: 0 0 8px; font-size: 23px; font-weight: 800; color: #ecfdf5; letter-spacing: -.01em; }
.popup-box .msg { margin: 0 0 18px; color: #9fb0c4; font-size: 13.6px; line-height: 1.6; }

.popup-meta {
  text-align: left;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 12px 14px;
  background: #080d15;
  font-size: 12.2px;
}
.popup-meta .r {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed #141d2b;
}
.popup-meta .r:last-child { border-bottom: 0; }
.popup-meta .k { color: var(--muted-2); }
.popup-meta .v { font-family: var(--mono); color: #bae6fd; text-align: right; word-break: break-all; }

.popup-bar {
  height: 4px;
  border-radius: 3px;
  background: #141d2b;
  margin: 18px 0 10px;
  overflow: hidden;
}
.popup-bar i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, #34d399, #22d3ee);
  transform-origin: left;
  animation: fill 2.2s linear forwards;
}
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.popup-foot { font-size: 11.6px; color: var(--muted-2); }

/* error / block states */
.notice {
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 13.4px;
  line-height: 1.6;
  margin-top: 16px;
  display: none;
}
.notice.show { display: block; }
.notice.err { background: rgba(239, 68, 68, .08); border: 1px solid rgba(239, 68, 68, .35); color: #fca5a5; }
.notice.ok { background: rgba(16, 185, 129, .08); border: 1px solid rgba(16, 185, 129, .3); color: #6ee7b7; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer;
  font-family: var(--font); font-size: 13.5px; font-weight: 700;
  padding: 11px 20px; border-radius: 10px;
  background: linear-gradient(180deg, #22d3ee, #06b6d4);
  color: #05232b;
  transition: .18s;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: #131c29; color: #cfe0f0; border: 1px solid #23324a; }

/* dead page (invalid sk / blocked) */
.simple {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.simple .box {
  max-width: 460px; text-align: center;
  background: #0b1019; border: 1px solid var(--line);
  border-radius: 18px; padding: 40px 30px;
}
.simple .ico {
  width: 62px; height: 62px; border-radius: 50%;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .35);
  font-size: 26px;
}
.simple h2 { margin: 0 0 10px; font-size: 20px; }
.simple p { color: var(--muted); font-size: 13.6px; line-height: 1.7; margin: 0; }

/* embed mode: no page bg padding */
body.embed .wrap { padding: 14px; max-width: 760px; grid-template-columns: 1fr; }
body.embed .side { display: none; }
body.embed .gate { padding: 26px 22px 20px; }
body.embed h1.title { font-size: 27px; }
body.embed .subtitle { font-size: 13.6px; margin-bottom: 18px; }
body.embed .bubble { display: none; }

@media (max-width: 980px) {
  .wrap { grid-template-columns: 1fr; padding: 22px 16px 80px; }
  h1.title { font-size: 30px; }
  .gate { padding: 26px 20px 20px; }
  .row2 { grid-template-columns: 1fr; }
  .steps .name { font-size: 11.2px; }
}
@media (max-width: 520px) {
  h1.title { font-size: 25px; }
  .widget-box { padding: 16px 10px; }
  .step .name { font-size: 10.2px; }
  .mini3 .v { font-size: 11.4px; }
  .timecard .big b { font-size: 26px; }
}

/* cảnh báo đang dùng khoá test */
.demowarn{position:relative;z-index:3;margin:14px auto 0;max-width:1180px;padding:10px 14px;border-radius:12px;
 font:13px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;color:#fde68a;
 background:rgba(234,179,8,.10);border:1px solid rgba(234,179,8,.35)}
.demowarn code{background:rgba(255,255,255,.08);padding:1px 5px;border-radius:5px}
@media (max-width:640px){.demowarn{margin:10px 12px 0;font-size:12px}}
