/* =====================================================================
   CHECK MÃ ĐẠI LÝ — HACKER CYBERPUNK (synthwave-noir terminal)
   ---------------------------------------------------------------------
   SHARED DESIGN TOKENS (public page + admin agent use the same palette):
     --bg #05030f  --bg2 #0a0620  --panel rgba(12,8,32,.72)
     --cyan #00f0ff --pink #ff2bd6 --violet #7c3aed --green #39ff88
     --amber #ffb000 --red #ff3860 --text #e8f6ff --dim #8fa6c4
     fonts: headings 'Chakra Petch' (VN ok) · digits/latin labels 'Orbitron'
            mono 'JetBrains Mono' (VN ok)
   ===================================================================== */
:root {
  --bg: #05030f;
  --bg2: #0a0620;
  --panel: rgba(12, 8, 32, 0.72);
  --cyan: #00f0ff;
  --pink: #ff2bd6;
  --violet: #7c3aed;
  --green: #39ff88;
  --amber: #ffb000;
  --orange: #ff6a1a;
  --red: #ff3860;
  --text: #e8f6ff;
  --dim: #8fa6c4;
  --line: rgba(0, 240, 255, 0.32);
  --font: 'Chakra Petch', system-ui, 'Segoe UI', sans-serif;
  --display: 'Orbitron', 'Chakra Petch', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --cut: 16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.4;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--pink); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.input :focus-visible { outline: none; }

/* ============ BACKGROUND STACK ============ */
.bg {
  position: fixed; inset: 0; z-index: -4;
  background:
    radial-gradient(60% 40% at 50% 62%, rgba(255, 43, 214, 0.34), transparent 70%),
    radial-gradient(90% 60% at 15% 0%, rgba(124, 58, 237, 0.35), transparent 60%),
    radial-gradient(70% 50% at 90% 10%, rgba(0, 240, 255, 0.16), transparent 60%),
    linear-gradient(180deg, var(--bg2) 0%, var(--bg) 70%);
}
.bg::after { /* synthwave sun on the horizon */
  content: ''; position: absolute; left: 50%; bottom: 40vh;
  width: min(60vw, 440px); aspect-ratio: 1; border-radius: 50%;
  transform: translate(-50%, 50%);
  background: linear-gradient(180deg, #ffb000 0%, #ff2bd6 55%, #7c3aed 100%);
  opacity: 0.75;
  -webkit-mask: repeating-linear-gradient(180deg, #000 0 10px, transparent 10px 14px);
          mask: repeating-linear-gradient(180deg, #000 0 10px, transparent 10px 14px);
  clip-path: inset(0 0 50% 0);
}
.grid-floor {
  position: fixed; left: 0; right: 0; bottom: 0; height: 40vh; z-index: -3; overflow: hidden; pointer-events: none;
  border-top: 1px solid rgba(255, 43, 214, 0.7); box-shadow: 0 -6px 30px rgba(255, 43, 214, 0.45);
  background: linear-gradient(180deg, rgba(255, 43, 214, 0.16), transparent 60%);
}
.grid-floor i {
  position: absolute; left: -60%; right: -60%; top: 0; bottom: 0;
  transform-origin: 50% 0; transform: perspective(240px) rotateX(52deg) scaleY(2.2);
  background:
    repeating-linear-gradient(90deg, rgba(0, 240, 255, 0.8) 0 1.5px, transparent 1.5px 60px),
    repeating-linear-gradient(0deg, rgba(255, 43, 214, 0.8) 0 1.5px, transparent 1.5px 40px);
  -webkit-mask: linear-gradient(180deg, transparent 0%, #000 30%); mask: linear-gradient(180deg, transparent 0%, #000 45%);
  animation: grid-run 1.6s linear infinite;
}
@keyframes grid-run { to { background-position: 0 0, 0 40px; } }
.rain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; opacity: 0.55; pointer-events: none; }
.bg-overlay { /* translucent dark layer between video/fallback and UI */
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(5, 3, 15, 0.28) 0%, rgba(5, 3, 15, 0.52) 62%, rgba(5, 3, 15, 0.82) 100%),
    linear-gradient(180deg, rgba(0, 240, 255, 0.05), rgba(255, 43, 214, 0.07));
}
.scanlines {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0.5; mix-blend-mode: overlay;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 3px);
}
.scanlines::after { /* moving sweep */
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 22vh;
  background: linear-gradient(180deg, transparent, rgba(0, 240, 255, 0.10), transparent);
  animation: sweep 7s linear infinite;
}
@keyframes sweep { from { transform: translateY(-30vh); } to { transform: translateY(110vh); } }
.noise {
  position: fixed; inset: -10%; z-index: 2; pointer-events: none; opacity: 0.07; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: noise 0.9s steps(4) infinite;
}
@keyframes noise { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -2%); } 100% { transform: translate(0, 0); } }

/* ============ PAGE ============ */
.page {
  position: relative; z-index: 3;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; padding: 28px 16px 36px;
  max-width: 520px; margin: 0 auto;
}
.page::before, .page::after { /* desktop side readouts */
  position: fixed; top: 50%; z-index: 3; display: none;
  font: 500 11px/1 var(--mono); letter-spacing: 0.3em; color: rgba(0, 240, 255, 0.45);
  writing-mode: vertical-rl; transform: translateY(-50%); white-space: nowrap;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}
.page::before { content: '// NODE-07 • AES-256 • TLS 1.3 • ZERO-LOG'; left: 34px; }
.page::after { content: 'CHECKMA.SYS — ĐANG GIÁM SÁT 24/7 // ONLINE'; right: 34px; color: rgba(255, 43, 214, 0.5); text-shadow: 0 0 8px rgba(255, 43, 214, 0.5); }
@media (min-width: 1100px) { .page::before, .page::after { display: block; } }

/* ---------- brand ---------- */
.brand { text-align: center; width: 100%; display: flex; flex-direction: column; align-items: center; }
.brand-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 11px/1 var(--mono); letter-spacing: 0.32em; color: var(--cyan);
  padding: 8px 14px; border: 1px solid var(--line);
  background: rgba(0, 240, 255, 0.06);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
}
.brand-pre { color: var(--pink); text-shadow: 0 0 10px var(--pink); }
.glitch {
  position: relative; display: inline-block; margin: 16px 0 10px;
  font: 700 clamp(28px, 8.6vw, 56px)/1.05 var(--font); letter-spacing: 0.05em; color: #fff;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.6), 0 0 22px rgba(0, 240, 255, 0.85), 0 0 46px rgba(124, 58, 237, 0.8);
  animation: title-jit 5.5s infinite;
}
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  text-shadow: none;
}
.glitch::before { color: var(--pink); transform: translate(2px, 0); animation: slice-a 5.5s infinite steps(1); clip-path: inset(0 0 100% 0); }
.glitch::after  { color: var(--cyan); transform: translate(-2px, 0); animation: slice-b 5.5s infinite steps(1); clip-path: inset(100% 0 0 0); }
@keyframes slice-a {
  0%, 88%, 100% { clip-path: inset(0 0 100% 0); transform: translate(2px, 0); }
  89% { clip-path: inset(8% 0 62% 0); transform: translate(-6px, 0); }
  91% { clip-path: inset(46% 0 22% 0); transform: translate(7px, 1px); }
  93% { clip-path: inset(70% 0 6% 0); transform: translate(-4px, 0); }
  95% { clip-path: inset(22% 0 52% 0); transform: translate(5px, -1px); }
  97% { clip-path: inset(0 0 100% 0); }
}
@keyframes slice-b {
  0%, 88%, 100% { clip-path: inset(100% 0 0 0); transform: translate(-2px, 0); }
  90% { clip-path: inset(58% 0 14% 0); transform: translate(6px, 0); }
  92% { clip-path: inset(12% 0 66% 0); transform: translate(-7px, 0); }
  94% { clip-path: inset(36% 0 40% 0); transform: translate(4px, 1px); }
  96% { clip-path: inset(80% 0 4% 0); transform: translate(-5px, 0); }
  98% { clip-path: inset(100% 0 0 0); }
}
@keyframes title-jit {
  0%, 88%, 100% { transform: none; filter: none; }
  90% { transform: translate(-2px, 1px) skewX(-4deg); filter: hue-rotate(40deg); }
  93% { transform: translate(3px, -1px) skewX(5deg); }
  96% { transform: translate(-1px, 0); filter: hue-rotate(-30deg); }
}
.brand-sub {
  font: 500 12px/1.5 var(--mono); letter-spacing: 0.1em; color: var(--dim);
  min-height: 18px; padding: 0 6px;
}
.brand-sub #tagline { color: var(--green); text-shadow: 0 0 10px rgba(57, 255, 136, 0.6); }
.caret { color: var(--green); margin-left: 2px; animation: blink 1s steps(1) infinite; font-size: 0.9em; }
@keyframes blink { 50% { opacity: 0; } }

/* ============ HUD PANEL (glass + chamfer + double neon border) ============ */
.hud {
  --c: var(--cut);
  position: relative; isolation: isolate; width: 100%;
  padding: 24px 22px 22px;
  background:
    linear-gradient(135deg, rgba(0, 240, 255, 0.08), transparent 40%, rgba(255, 43, 214, 0.08)),
    var(--panel);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  animation: hud-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
@keyframes hud-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } }
.hud::before { /* neon gradient ring (outer border) */
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; padding: 1.5px;
  background: linear-gradient(135deg, var(--b1, var(--cyan)) 0%, var(--mid, var(--violet)) 48%, var(--b2, var(--pink)) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.hud::after { /* inner hairline (2nd border) + scan sweep */
  content: ''; position: absolute; inset: 6px; z-index: 0; pointer-events: none;
  border: 1px solid rgba(0, 240, 255, 0.13);
  background: linear-gradient(180deg, transparent, rgba(0, 240, 255, 0.10) 50%, transparent) 0 -60% / 100% 36% no-repeat;
  animation: hud-scan 5.5s linear infinite;
}
@keyframes hud-scan { to { background-position: 0 180%; } }
.hud > * { position: relative; z-index: 1; }
.hud > .corner { position: absolute; z-index: 2; width: 16px; height: 16px; pointer-events: none; }
.hud > .corner.tl, .hud > .corner.br { /* chamfer edge strokes */
  width: calc(var(--c) * 1.4142); height: 2px; transform: rotate(-45deg); background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}
.hud > .corner.tl { left: calc(var(--c) / 2 - var(--c) * 0.7071); top: calc(var(--c) / 2 - 1px); }
.hud > .corner.br { right: calc(var(--c) / 2 - var(--c) * 0.7071); bottom: calc(var(--c) / 2 - 1px); background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.corner.tr { top: 8px; right: 8px; border: 2px solid var(--cyan); border-left: 0; border-bottom: 0; filter: drop-shadow(0 0 4px var(--cyan)); }
.corner.bl { bottom: 8px; left: 8px; border: 2px solid var(--pink); border-right: 0; border-top: 0; filter: drop-shadow(0 0 4px var(--pink)); }

.hud-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding-bottom: 14px; margin-bottom: 18px;
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, var(--cyan), rgba(124, 58, 237, 0.5) 60%, transparent) 1;
}
.hud-title { font: 700 clamp(17px, 5vw, 20px)/1.15 var(--font); letter-spacing: 0.1em; color: #fff; text-shadow: 0 0 14px rgba(0, 240, 255, 0.55); }
.hud-title small { display: block; margin-top: 5px; font: 500 10px/1 var(--mono); letter-spacing: 0.28em; color: var(--pink); text-shadow: 0 0 8px rgba(255, 43, 214, 0.6); }

.status-dot {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  font: 700 10px/1 var(--display); letter-spacing: 0.2em; color: var(--green);
  padding: 7px 10px 7px 9px; border: 1px solid rgba(57, 255, 136, 0.45); background: rgba(57, 255, 136, 0.08);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  text-shadow: 0 0 8px rgba(57, 255, 136, 0.7);
}
.status-dot::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(57, 255, 136, 0.8), 0 0 10px var(--green);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse { 70%, 100% { box-shadow: 0 0 0 9px rgba(57, 255, 136, 0), 0 0 10px var(--green); } }

/* ============ FORM ============ */
.field { margin-bottom: 18px; }
.field-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; min-height: 26px; }
.field-label label, .field-label > span:first-child {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 12px/1 var(--font); letter-spacing: 0.16em; color: var(--text);
}
.idx { /* neon hex badge */
  display: inline-grid; place-items: center; width: 28px; height: 31px; flex: none;
  font: 800 11px/1 var(--display); letter-spacing: 0; color: var(--bg);
  background: linear-gradient(160deg, var(--cyan), var(--pink));
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.field-error, .msg-error {
  font: 500 11.5px/1.4 var(--mono); color: var(--red); text-shadow: 0 0 10px rgba(255, 56, 96, 0.7);
  animation: shake 0.35s ease-in-out;
}
.field-error::before, .msg-error::before { content: '⚠ '; }
.msg-error {
  margin-top: 12px; padding: 10px 12px; border: 1px solid rgba(255, 56, 96, 0.55);
  background: rgba(255, 56, 96, 0.1); box-shadow: 0 0 18px rgba(255, 56, 96, 0.22), inset 0 0 14px rgba(255, 56, 96, 0.08);
}
@keyframes shake { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

.input {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 52px; padding: 0 14px 0 16px; text-align: left;
  border: 1px solid var(--line); border-radius: 3px;
  background: rgba(4, 3, 18, 0.62); box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.5);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input::before { content: '>'; font: 700 16px/1 var(--mono); color: var(--pink); text-shadow: 0 0 8px var(--pink); flex: none; }
.input::after { /* tick mark */
  content: ''; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px;
  border-right: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan); opacity: 0.8; pointer-events: none;
}
.input:hover { border-color: rgba(0, 240, 255, 0.6); }
.input:focus-within, .input:focus-visible {
  border-color: var(--cyan); background: rgba(0, 240, 255, 0.05); outline: none;
  box-shadow: 0 0 0 1px var(--cyan), 0 0 24px rgba(0, 240, 255, 0.4), inset 0 0 18px rgba(0, 240, 255, 0.12);
}
.input.has-error { border-color: var(--red); box-shadow: 0 0 0 1px var(--red), 0 0 22px rgba(255, 56, 96, 0.4), inset 0 0 16px rgba(255, 56, 96, 0.1); animation: shake 0.35s; }
.input.has-error::after { border-color: var(--red); }
.input input {
  flex: 1; min-width: 0; height: 50px; background: none; border: 0; outline: 0;
  font: 500 16px/1 var(--mono); color: var(--text); caret-color: var(--cyan);
}
.input input::placeholder { color: rgba(143, 166, 196, 0.55); }
button.input { cursor: pointer; }
.input-value { flex: 1; min-width: 0; font: 500 16px/1 var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--cyan); text-shadow: 0 0 10px rgba(0, 240, 255, 0.5); }
.input-value.placeholder { color: rgba(143, 166, 196, 0.55); text-shadow: none; }
.input-btn {
  flex: none; font: 700 11px/1 var(--display); letter-spacing: 0.16em; color: var(--bg);
  padding: 9px 12px; background: linear-gradient(90deg, var(--cyan), #6af6ff);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

/* ============ BUTTONS ============ */
.btn-wrap { margin-top: 24px; filter: drop-shadow(0 0 14px rgba(255, 43, 214, 0.45)) drop-shadow(0 0 6px rgba(0, 240, 255, 0.4)); }
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; overflow: hidden; isolation: isolate;
  font: 700 14px/1 var(--font); letter-spacing: 0.18em; text-transform: uppercase; color: #fff;
  border: 1px solid var(--line); background: rgba(0, 240, 255, 0.07);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  transition: transform 0.15s, filter 0.2s, background 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn[disabled] { cursor: progress; }
.btn-ghost { color: var(--dim); border-color: rgba(143, 166, 196, 0.35); background: rgba(143, 166, 196, 0.06); }
.btn-ghost:hover { color: #fff; border-color: var(--cyan); background: rgba(0, 240, 255, 0.1); }
.btn-primary {
  width: 100%; border: 0; color: #05030f; text-shadow: none;
  background: linear-gradient(100deg, var(--cyan) 0%, #7c9bff 45%, var(--pink) 100%);
  background-size: 140% 100%; animation: btn-flow 4s ease-in-out infinite alternate;
}
@keyframes btn-flow { to { background-position: 100% 0; } }
.btn-primary::after { /* hover shine */
  content: ''; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; z-index: 1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  transform: skewX(-20deg);
}
.btn-primary:hover::after, .btn-primary:focus-visible::after { animation: shine 0.8s ease; }
@keyframes shine { to { left: 120%; } }
.btn-primary:hover { filter: brightness(1.12) saturate(1.15); }
.btn-primary .label { position: relative; z-index: 2; }
.btn-check .fill { /* energy fill: dark segmented wipe over the gradient */
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; z-index: 0;
  background: repeating-linear-gradient(90deg, rgba(5, 3, 15, 0.92) 0 6px, rgba(5, 3, 15, 0.6) 6px 9px);
  box-shadow: 8px 0 18px rgba(5, 3, 15, 0.9);
  border-right: 2px solid var(--cyan);
}
.btn-check.is-loading { color: var(--cyan); text-shadow: 0 0 8px var(--cyan); }
.btn-check { font-size: 15px; min-height: 56px; letter-spacing: 0.2em; }
.btn-acid { color: #05160c; background: linear-gradient(100deg, var(--green), #8bffbe); border: 0; }
.btn-danger { color: #fff; background: linear-gradient(100deg, var(--rc, var(--red)), var(--rc2, var(--pink))); border: 0; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45); }
.btn-acid:hover, .btn-danger:hover { filter: brightness(1.15); }

/* ---------- footer / socials ---------- */
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px dashed rgba(0, 240, 255, 0.22); }
.sys-line { font: 500 10.5px/1.5 var(--mono); letter-spacing: 0.08em; color: var(--dim); }
.sys-line b { color: var(--green); font-weight: 600; text-shadow: 0 0 8px rgba(57, 255, 136, 0.6); }
.socials { display: flex; gap: 10px; flex: none; }
.social {
  display: grid; place-items: center; width: 46px; height: 46px;
  border: 1px solid var(--line); background: rgba(0, 240, 255, 0.06);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  transition: background 0.2s, transform 0.2s, filter 0.2s;
}
.social:nth-child(2) { border-color: rgba(255, 43, 214, 0.5); background: rgba(255, 43, 214, 0.07); }
.social img { width: 24px; height: 24px; object-fit: contain; filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.8)); }
.social:hover { transform: translateY(-2px); background: rgba(0, 240, 255, 0.2); }
.social:nth-child(2):hover { background: rgba(255, 43, 214, 0.22); }

/* ============ MODAL OVERLAY ============ */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(5, 3, 15, 0.74);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  animation: fade 0.25s ease both;
}
@keyframes fade { from { opacity: 0; } }
.overlay > .hud { max-width: 440px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
.x-btn {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin: -8px -8px 0 0;
  font: 700 16px/1 var(--mono); color: var(--dim); transition: color 0.2s, text-shadow 0.2s;
}
.x-btn:hover { color: var(--red); text-shadow: 0 0 10px var(--red); }

/* ---------- site picker = terminal "select target" ---------- */
.site-search { margin-bottom: 12px; }
.site-grid {
  flex: 1; min-height: 0; overflow-y: auto; counter-reset: site;
  max-height: min(52vh, 420px);
  border: 1px solid rgba(0, 240, 255, 0.2); background: rgba(0, 0, 0, 0.35); padding: 6px;
  scrollbar-width: thin; scrollbar-color: var(--cyan) transparent;
}
.site-grid::-webkit-scrollbar { width: 6px; } .site-grid::-webkit-scrollbar-thumb { background: var(--cyan); }
.site-item {
  counter-increment: site; position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 46px; padding: 0 12px; text-align: left;
  font: 600 14px/1 var(--mono); letter-spacing: 0.08em; color: var(--text);
  border-left: 2px solid transparent; transition: background 0.15s, border-color 0.15s, color 0.15s, padding 0.15s;
}
.site-item::before { content: counter(site, decimal-leading-zero); font: 500 11px/1 var(--mono); color: var(--dim); width: 20px; }
.site-item::after { content: '◂ SELECT'; margin-left: auto; font: 700 9px/1 var(--display); letter-spacing: 0.2em; color: var(--cyan); opacity: 0; transition: opacity 0.15s; }
.site-item:hover, .site-item:focus-visible {
  outline: none; color: #fff; background: linear-gradient(90deg, rgba(0, 240, 255, 0.16), transparent);
  border-left-color: var(--cyan); padding-left: 16px; text-shadow: 0 0 10px var(--cyan);
}
.site-item:hover::after, .site-item:focus-visible::after { opacity: 1; }
.site-item:hover::before, .site-item:focus-visible::before { color: var(--pink); }
.site-item.is-active { color: var(--green); border-left-color: var(--green); background: linear-gradient(90deg, rgba(57, 255, 136, 0.12), transparent); text-shadow: 0 0 10px rgba(57, 255, 136, 0.6); }
.site-item.is-active::after { content: '✓ ACTIVE'; color: var(--green); opacity: 1; }
.site-empty { padding: 22px 12px; font: 500 12px/1.4 var(--mono); color: var(--dim); text-align: center; }

/* ---------- OTP ---------- */
.modal-desc { font-size: 14px; line-height: 1.55; color: var(--dim); margin-bottom: 18px; }
.modal-desc strong { color: var(--cyan); font-weight: 600; text-shadow: 0 0 8px rgba(0, 240, 255, 0.5); word-break: break-all; }
.input.otp-input { padding: 0; border: 0; background: none; box-shadow: none; min-height: 58px; }
.otp-input::before, .otp-input::after { display: none; }
.otp-input:focus-within, .otp-input.has-error { box-shadow: none; background: none; }
.otp-cells { display: flex; gap: 7px; width: 100%; justify-content: center; }
.cell {
  flex: 1 1 0; min-width: 0; max-width: 52px; height: 58px; display: grid; place-items: center;
  font: 800 24px/1 var(--display); color: var(--cyan); text-shadow: 0 0 12px var(--cyan);
  border: 1px solid var(--line); background: rgba(4, 3, 18, 0.7); border-radius: 3px;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.cell.has-val { border-color: var(--cyan); background: rgba(0, 240, 255, 0.1); animation: cell-pop 0.18s ease-out; }
.cell.is-active { border-color: var(--pink); background: rgba(255, 43, 214, 0.1); }
.cell.is-active:not(.has-val)::after { content: ''; width: 2px; height: 26px; background: var(--pink); box-shadow: 0 0 10px var(--pink); animation: blink 0.9s steps(1) infinite; }
.otp-input.has-error .cell { border-color: var(--red); color: var(--red); text-shadow: 0 0 12px var(--red); background: rgba(255, 56, 96, 0.1); }
.otp-input.has-error { animation: shake 0.35s; }
@keyframes cell-pop { from { transform: scale(1.18); } }
#otp {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; cursor: text;
  z-index: 2;
}
.modal-actions { display: flex; gap: 12px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }
.modal-actions .btn-ghost { flex: 0 0 34%; }

/* ============ BREACH (đang xâm nhập) ============ */
#hack-modal { background: rgba(5, 3, 15, 0.86); }
#hack-modal::before { /* red glitch vignette */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(255, 56, 96, 0.16) 100%);
  animation: vig 1.4s ease-in-out infinite alternate;
}
@keyframes vig { to { opacity: 0.35; } }
#hack-modal .hud { --b1: var(--green); --b2: var(--cyan); }
#hack-title { animation: title-jit 2.4s infinite; }
.terminal {
  height: 208px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  padding: 12px; font: 500 12px/1.45 var(--mono); color: var(--green);
  border: 1px solid rgba(57, 255, 136, 0.3); background: rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 0 24px rgba(57, 255, 136, 0.08);
  -webkit-mask: linear-gradient(180deg, transparent 0, #000 28%); mask: linear-gradient(180deg, transparent 0, #000 28%);
}
.ln { flex: none; white-space: pre-wrap; word-break: break-word; text-shadow: 0 0 8px rgba(57, 255, 136, 0.55); animation: ln-in 0.25s ease-out both; }
.ln.cy { color: var(--cyan); text-shadow: 0 0 8px rgba(0, 240, 255, 0.6); }
.ln.warn { color: var(--amber); text-shadow: 0 0 8px rgba(255, 176, 0, 0.6); }
.ln:last-child::after { content: ' █'; animation: blink 0.7s steps(1) infinite; color: var(--green); }
@keyframes ln-in { from { opacity: 0; transform: translateX(-8px); filter: brightness(2.5); } }
.bar {
  height: 24px; margin-top: 18px; padding: 4px; border: 1px solid rgba(0, 240, 255, 0.4);
  background: repeating-linear-gradient(90deg, rgba(0, 240, 255, 0.12) 0 9px, transparent 9px 12px) content-box, rgba(0, 0, 0, 0.5);
  filter: drop-shadow(0 0 7px rgba(0, 240, 255, 0.6));
}
.bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--pink), var(--cyan), var(--green)); background-size: 200% 100%;
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 9px, transparent 9px 12px); mask: repeating-linear-gradient(90deg, #000 0 9px, transparent 9px 12px);
  animation: bar-flow 1.2s linear infinite;
}
@keyframes bar-flow { to { background-position: -200% 0; } }
.bar-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font: 500 11px/1.3 var(--mono); letter-spacing: 0.1em; color: var(--dim); }
#hack-pct {
  font: 800 28px/1 var(--display); letter-spacing: 0.02em; color: #fff;
  text-shadow: 2px 0 var(--pink), -2px 0 var(--cyan), 0 0 16px var(--cyan); animation: pct-glitch 1.8s steps(1) infinite;
}
@keyframes pct-glitch { 0%, 90%, 100% { text-shadow: 2px 0 var(--pink), -2px 0 var(--cyan), 0 0 16px var(--cyan); transform: none; } 92% { text-shadow: -5px 0 var(--pink), 5px 0 var(--cyan), 0 0 16px var(--cyan); transform: translateX(2px); } 96% { text-shadow: 4px 1px var(--pink), -4px -1px var(--cyan); } }
.warn-text {
  margin-top: 16px; padding: 10px 12px; text-align: center;
  font: 600 11.5px/1.4 var(--mono); letter-spacing: 0.06em; color: var(--amber);
  border: 1px dashed rgba(255, 176, 0, 0.5); background: rgba(255, 176, 0, 0.07);
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.6); animation: warn-flash 1.3s steps(1) infinite;
}
@keyframes warn-flash { 50% { background: rgba(255, 56, 96, 0.12); border-color: rgba(255, 56, 96, 0.6); color: var(--red); } }

/* ============ RESULTS ============ */
.hud.result {
  --rc: var(--green); --rc2: var(--cyan);
  --b1: var(--rc); --b2: var(--rc2); --mid: color-mix(in srgb, var(--rc) 60%, var(--violet));
  text-align: center; padding-top: 30px;
}
.hud.result[data-type='agent-first']  { --rc: var(--amber);  --rc2: #ffe27a; }
.hud.result[data-type='agent-second'] { --rc: var(--orange); --rc2: var(--red); }
.hud.result[data-type='agent-third']  { --rc: var(--pink);   --rc2: var(--red); animation: hud-in 0.5s both, alarm 0.9s ease-in-out 0.5s infinite alternate; }
.hud.result[data-type='error']        { --rc: var(--red);    --rc2: #ff8aa0; }
.hud.result { background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 14%, transparent), transparent 55%), var(--panel); box-shadow: inset 0 0 60px color-mix(in srgb, var(--rc) 22%, transparent); }
.hud.result::after { border-color: color-mix(in srgb, var(--rc) 25%, transparent); background-image: linear-gradient(180deg, transparent, color-mix(in srgb, var(--rc) 14%, transparent) 50%, transparent); }
.hud.result .corner.tr { border-color: var(--rc); filter: drop-shadow(0 0 4px var(--rc)); }
.hud.result .corner.tl { background: var(--rc); box-shadow: 0 0 8px var(--rc); }
.hud.result .corner.br { background: var(--rc2); box-shadow: 0 0 8px var(--rc2); }
.hud.result .corner.bl { border-color: var(--rc2); filter: drop-shadow(0 0 4px var(--rc2)); }
@keyframes alarm { to { filter: brightness(1.18) saturate(1.2); } }
#result-modal:has([data-type='agent-third']) { background: radial-gradient(ellipse at center, rgba(255, 43, 214, 0.18), rgba(5, 3, 15, 0.86) 70%); }
#result-modal:has([data-type='agent-second']) { background: radial-gradient(ellipse at center, rgba(255, 106, 26, 0.14), rgba(5, 3, 15, 0.86) 70%); }

.result-icon { position: relative; width: 112px; height: 112px; margin: 0 auto 8px; display: grid; place-items: center; color: var(--rc); }
.result-icon::before, .result-icon::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--rc) 55%, transparent); animation: spin 14s linear infinite; }
.result-icon::after { inset: 8px; border-style: dotted; animation-duration: 9s; animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-icon svg { width: 76px; height: 76px; filter: drop-shadow(0 0 10px var(--rc)) drop-shadow(0 0 26px var(--rc)); animation: icon-pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both, icon-glow 2s ease-in-out 0.6s infinite alternate; }
@keyframes icon-pop { from { transform: scale(0.2) rotate(-25deg); opacity: 0; } }
@keyframes icon-glow { to { filter: drop-shadow(0 0 5px var(--rc)) drop-shadow(0 0 14px var(--rc)); } }
.hud.result[data-type='agent-third'] .result-icon svg { animation: icon-pop 0.6s both, shake 0.5s 0.6s infinite; }
.result-kicker { font: 600 12px/1 var(--mono); letter-spacing: 0.26em; color: var(--rc); text-shadow: 0 0 10px var(--rc); margin-bottom: 18px; }
.result-pill {
  display: block; margin: 0 auto; padding: 18px 14px; max-width: 100%;
  font: 700 clamp(21px, 6.4vw, 30px)/1.2 var(--font); letter-spacing: 0.06em; text-transform: uppercase; color: #fff;
  text-shadow: 0 0 6px var(--rc), 0 0 22px var(--rc);
  border: 1px solid var(--rc); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--rc) 18%, transparent), transparent);
  box-shadow: 0 0 22px color-mix(in srgb, var(--rc) 30%, transparent), inset 0 0 22px color-mix(in srgb, var(--rc) 14%, transparent);
  animation: pill-in 0.5s 0.15s both;
}
@keyframes pill-in { from { opacity: 0; letter-spacing: 0.3em; filter: blur(6px); } }
.hud.result[data-type='agent-third'] .result-pill { animation: pill-in 0.5s 0.15s both, title-jit 2.6s 1s infinite; }
.threat { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 16px 0 4px; }
.threat span { font: 600 10px/1 var(--mono); letter-spacing: 0.24em; color: var(--dim); margin-right: 6px; }
.threat i { width: 42px; height: 8px; background: rgba(143, 166, 196, 0.2); transform: skewX(-24deg); }
.threat i.on { background: var(--rc); box-shadow: 0 0 12px var(--rc); }
.result-meta { margin: 16px 0 24px; font: 500 12px/1.6 var(--mono); letter-spacing: 0.06em; color: var(--dim); word-break: break-word; }
.result-meta b { color: var(--text); font-weight: 600; }
.result-error { margin: 4px 0 24px; padding: 14px; font: 500 14px/1.55 var(--font); color: #ffd0d8; border: 1px solid rgba(255, 56, 96, 0.5); background: rgba(255, 56, 96, 0.09); box-shadow: 0 0 20px rgba(255, 56, 96, 0.2); }
#result-btn { width: 100%; flex: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 400px) {
  .page { padding: 20px 12px 28px; gap: 18px; }
  .hud { padding: 22px 16px 18px; --cut: 14px; }
  .brand-tag { letter-spacing: 0.2em; font-size: 10px; }
  .panel-foot { flex-direction: column; align-items: flex-start; }
  .cell { height: 52px; font-size: 21px; }
  .terminal { height: 190px; font-size: 11.5px; }
  .modal-actions .btn { letter-spacing: 0.1em; padding: 0 12px; }
}
@media (min-width: 768px) { .page { max-width: 560px; gap: 28px; } .hud { padding: 28px 28px 24px; } }
@media (min-width: 768px) { .brand { width: max-content; max-width: 94vw; } .glitch { white-space: nowrap; font-size: 52px; } }
@media (min-width: 1400px) { .glitch { font-size: 60px; } .page { max-width: 600px; } }
@media (max-height: 640px) { .page { justify-content: flex-start; } }

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rain { opacity: 0.25; }
}

/* ===== khi video nền đang chạy: bỏ lớp dự phòng, giảm lớp phủ để thấy rõ video ===== */
body:has(.bg-video.is-playing) .bg,
body:has(.bg-video.is-playing) .grid-floor,
body:has(.bg-video.is-playing) .rain { display: none; }
body:has(.bg-video.is-playing) .bg-overlay {
  background:
    radial-gradient(ellipse at 50% 46%, rgba(5, 3, 15, 0.10) 0%, rgba(5, 3, 15, 0.26) 60%, rgba(5, 3, 15, 0.62) 100%),
    linear-gradient(180deg, rgba(0, 240, 255, 0.03), rgba(255, 43, 214, 0.05));
}
