:root {
  --card: rgba(255, 255, 255, .96);
  --text: #16181d;
  --muted: #758095;
  --border: #e6e8ed;
  --field-bg: rgba(250, 250, 252, .96);
  --red: #df1f2c;
  --red-dark: #bf1520;
  --red-soft: #fdebec;
  --success: #15803d;
  --shadow: 0 28px 80px rgba(12, 18, 28, .25), 0 7px 24px rgba(12, 18, 28, .12);
  --radius: 24px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: #fff;
  overflow-x: hidden;
}

button, input { font: inherit; }
button { cursor: pointer; }

.video-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: #f5f5f5;
}

.video-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(.95) contrast(.96) brightness(1.02);
}

.video-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.18) 0%, rgba(255,255,255,.08) 34%, rgba(255,255,255,.18) 100%),
    rgba(255,255,255,.16);
  backdrop-filter: blur(.35px);
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 34px 18px;
}

.transfer-card {
  width: min(100%, 560px);
  background: var(--card);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(16px) saturate(1.08);
}

.brand-wrap {
  padding: 21px 30px 14px;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  display: block;
  width: min(100%, 235px);
  height: 64px;
  object-fit: contain;
  object-position: center;
  mix-blend-mode: multiply;
}

.view { padding: 0 30px 30px; }
.section-head, .success-head { text-align: center; }

.section-head h1,
.success-head h1 {
  margin: 0;
  padding: 21px 0 18px;
  color: var(--red);
  font-size: clamp(25px, 4.5vw, 34px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.success-head h1 { padding-top: 10px; }
.success-head p {
  margin: -6px 0 22px;
  color: var(--muted);
  font-size: 14px;
}

.success-badge {
  width: 58px;
  height: 58px;
  margin: 21px auto 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf8f1;
  color: var(--success);
  font-size: 30px;
  font-weight: 800;
}

form { display: grid; gap: 14px; }

.field {
  min-height: 62px;
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 15px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field:focus-within {
  background: #fff;
  border-color: rgba(223,31,44,.62);
  box-shadow: 0 0 0 4px rgba(223,31,44,.08);
}

.field-icon { display: inline-flex; color: #667080; }
.field-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  min-width: 0;
}
.field input::placeholder { color: #8c96a6; }

.human-check {
  min-height: 68px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: var(--field-bg);
  border-radius: 15px;
  user-select: none;
}

.fake-checkbox-wrap { position: relative; display: inline-grid; }
.fake-checkbox-wrap input { position: absolute; opacity: 0; pointer-events: none; }
.fake-checkbox {
  width: 25px;
  height: 25px;
  border: 2px solid #7a8491;
  border-radius: 5px;
  background: #fff;
  display: inline-grid;
  place-items: center;
}
.fake-checkbox-wrap input:checked + .fake-checkbox {
  border-color: var(--red);
  background: var(--red);
}
.fake-checkbox-wrap input:checked + .fake-checkbox::after {
  content: "";
  width: 6px;
  height: 11px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translateY(-1px) rotate(45deg);
}

.human-copy { font-size: 15px; font-weight: 500; }
.cf-mark { display: flex; align-items: center; gap: 6px; color: #f58220; }
.cf-cloud { font-size: 26px; line-height: 1; }
.cf-text { color: #525966; font-weight: 700; font-size: 9px; letter-spacing: .12em; }
.cf-text small { display: block; margin-top: 3px; color: #8e96a2; font-size: 7px; font-weight: 500; letter-spacing: 0; text-align: center; }

.primary-btn {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #ec2431 0%, var(--red) 100%);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 10px 22px rgba(223,31,44,.22);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(223,31,44,.28); }
.primary-btn:active { transform: translateY(0); background: var(--red-dark); }
.primary-btn:focus-visible { outline: 4px solid rgba(223,31,44,.14); outline-offset: 2px; }

.result-list {
  border: 1px solid var(--border);
  border-radius: 15px;
  overflow: hidden;
  background: var(--field-bg);
}
.result-row {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
}
.result-row:last-child { border-bottom: 0; }
.result-row span { color: #697485; }
.result-row strong { font-size: 15px; text-align: right; word-break: break-all; }
.accent-text { color: var(--red); }
.success-note { margin: 20px 0; text-align: center; color: #454b56; font-size: 15px; }

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 22, 33, .52);
  backdrop-filter: blur(9px);
}
.dialog-backdrop[hidden] { display: none; }

.dialog {
  width: min(100%, 410px);
  background: #fff;
  border-radius: 22px;
  padding: 30px 28px 26px;
  text-align: center;
  box-shadow: 0 25px 80px rgba(16,24,40,.28);
}
.dialog-icon {
  width: 66px;
  height: 66px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 800;
  font-size: 34px;
}
.dialog h2 { margin: 0 0 10px; font-size: 24px; }
.dialog p { margin: 0 0 22px; color: var(--muted); line-height: 1.58; font-size: 14px; white-space: pre-line; }

.test-control {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 30px rgba(15,23,42,.16);
  backdrop-filter: blur(12px);
}
.test-control[hidden] { display: none; }
.test-label { display: grid; gap: 2px; }
.test-label strong { font-size: 10px; letter-spacing: .1em; color: #8a94a4; }
.test-label span { font-size: 12px; font-weight: 800; color: var(--red); }
.mode-switch { position: relative; width: 48px; height: 28px; display: inline-block; }
.mode-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mode-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #ccd2da;
  transition: .2s ease;
}
.mode-slider::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 7px rgba(0,0,0,.18);
  transition: .2s ease;
}
.mode-switch input:checked + .mode-slider { background: #17803d; }
.mode-switch input:checked + .mode-slider::after { transform: translateX(20px); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 620px) {
  .page-shell { padding: 18px 12px 90px; align-items: start; }
  .transfer-card { margin-top: 4vh; border-radius: 20px; }
  .brand-wrap { padding: 18px 22px 12px; }
  .brand-logo { width: min(100%, 220px); height: 58px; }
  .view { padding: 0 18px 22px; }
  .field, .human-check { border-radius: 13px; }
  .human-check { grid-template-columns: auto 1fr; }
  .cf-mark { display: none; }
  .result-row { padding: 0 14px; }
  .test-control { right: 10px; bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .video-bg video { display: none; }
  .video-bg { background: #f5f5f5; }
}

/* ===== Quả bóng trạng thái local =====
   Luôn là bóng trắng. 6 sao = thất bại, 5 sao = thành công.
   JavaScript đặt bóng theo tọa độ video để che biểu tượng gốc. */
.result-ball {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 16;
  width: 86px;
  height: 86px;
  padding: 0;
  border: 2px solid rgba(255,255,255,.96);
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 29% 22%, rgba(255,255,255,1) 0 8%, rgba(255,255,255,.92) 9% 18%, transparent 33%),
    radial-gradient(circle at 36% 30%, #ffffff 0 30%, #f5f6f7 58%, #d9dde1 82%, #bcc2c8 100%);
  box-shadow:
    0 11px 22px rgba(0,0,0,.34),
    0 2px 5px rgba(0,0,0,.22),
    inset -11px -12px 17px rgba(62,70,78,.22),
    inset 8px 9px 14px rgba(255,255,255,.92);
  transform: translate(-50%, -50%);
  transition: transform .12s ease, filter .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.result-ball[hidden] { display: none; }
.result-ball:hover { filter: brightness(1.025); }
.result-ball:active {
  transform: translate(-50%, -50%) scale(.96);
  filter: brightness(.97);
  box-shadow:
    0 7px 13px rgba(0,0,0,.30),
    0 1px 3px rgba(0,0,0,.20),
    inset -10px -11px 16px rgba(62,70,78,.24),
    inset 7px 8px 13px rgba(255,255,255,.88);
}
.result-ball:focus-visible {
  outline: 3px solid rgba(255,255,255,.95);
  outline-offset: 4px;
}
.ball-pattern {
  position: absolute;
  inset: 4%;
  width: 92%;
  height: 92%;
  overflow: visible;
  transform: rotate(-7deg);
  filter: drop-shadow(0 1px 1px rgba(255,255,255,.75));
}
.ball-inner-ring {
  fill: none;
  stroke: rgba(67,75,84,.20);
  stroke-width: 1.3;
}
.ball-seams {
  fill: none;
  stroke: rgba(68,76,85,.22);
  stroke-width: 1.25;
  stroke-linecap: round;
}
.ball-star {
  fill: #30353a;
  stroke: rgba(255,255,255,.52);
  stroke-width: .55;
  paint-order: stroke fill;
}
.stars-five { display: none; }
.result-ball.is-success .stars-six { display: none; }
.result-ball.is-success .stars-five { display: inline; }
.ball-gloss {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 33% 18%, rgba(255,255,255,.66) 0 8%, rgba(255,255,255,.20) 16%, transparent 36%),
    linear-gradient(145deg, rgba(255,255,255,.18), transparent 46%);
  box-shadow: inset 0 0 0 1px rgba(65,72,80,.15);
}

@media (max-width: 640px) {
  .result-ball { min-width: 72px; min-height: 72px; }
}
