:root {
  --bg: #06070d;
  --bg-2: #0a0c16;
  --card: #101320;
  --card-2: #151a2b;
  --line: #242b46;
  --line-soft: #1a2036;
  --txt: #eef1ff;
  --muted: #8d97b8;
  --muted-2: #626b8a;
  --accent: #6c7bff;
  --accent-2: #25e6d0;
  --pink: #ff4d7d;
  --ok: #37d39b;
  --warn: #ffb020;
  --danger: #ff5468;
  --radius: 18px;
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--txt);
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(108, 123, 255, 0.16), transparent 60%),
    radial-gradient(800px 560px at 95% 0%, rgba(255, 77, 125, 0.10), transparent 55%),
    radial-gradient(700px 500px at 50% 110%, rgba(37, 230, 208, 0.07), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

/* ------------------------------------------------------------------ nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(20px, env(safe-area-inset-left)) 14px max(20px, env(safe-area-inset-right));
  background: rgba(6, 7, 13, 0.78);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--txt);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: 15px;
}

.brand .mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #070a14;
  box-shadow: 0 0 24px rgba(108, 123, 255, 0.45);
}

.brand .mark svg { width: 18px; height: 18px; }

.nav nav { display: flex; align-items: center; gap: 18px; }

.nav nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.nav nav a:hover { color: var(--txt); }

.wrap {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 26px max(18px, env(safe-area-inset-left)) 40px max(18px, env(safe-area-inset-right));
}

.foot {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 18px 34px;
  color: var(--muted-2);
  font-size: 12px;
  text-align: center;
}

/* ------------------------------------------------------------------ cards */

.card {
  background: linear-gradient(180deg, rgba(21, 26, 43, 0.86), rgba(16, 19, 32, 0.94));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 18px; }

h1, h2, h3 { margin: 0; }

h1 { font-size: 24px; letter-spacing: -0.3px; }
h2 { font-size: 15px; letter-spacing: 0.1px; }
h3 { font-size: 16px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
}

.muted { color: var(--muted); }
.small { font-size: 12.5px; line-height: 1.6; }

/* ------------------------------------------------------------------ stats */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(21, 26, 43, 0.92), rgba(12, 15, 26, 0.95));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}

.stat .label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.stat .value {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.stat.c1 .value { color: var(--accent); }
.stat.c2 .value { color: var(--pink); }
.stat.c3 .value { color: var(--warn); }
.stat.c4 .value { color: var(--accent-2); }

/* ------------------------------------------------------------------ layout */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: start;
}

.form-grid .full { grid-column: 1 / -1; }

.form-grid input,
.form-grid textarea { margin-bottom: 0; }

.form-grid textarea { min-height: 84px; }

.form-grid .form-actions {
  display: flex;
  justify-content: flex-end;
}

.form-grid .btn-primary {
  width: auto;
  padding: 12px 22px;
  font-size: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(108, 123, 255, 0.14);
  border: 1px solid rgba(108, 123, 255, 0.34);
  color: #b9c1ff;
  font-size: 11px;
  font-weight: 800;
}

/* ------------------------------------------------------------------ forms */

label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

label .optional {
  color: var(--muted-2);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

input, textarea {
  width: 100%;
  padding: 12px 13px;
  margin: 0 0 15px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #0c0f1c;
  color: var(--txt);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder, textarea::placeholder { color: #4e5675; }

input:focus, textarea:focus {
  border-color: rgba(108, 123, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(108, 123, 255, 0.14);
}

textarea { min-height: 74px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), #5867f0);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, filter 0.15s;
}

.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }

.btn-primary { width: 100%; padding: 14px; font-size: 15px; }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.btn-ghost:hover { color: var(--txt); border-color: #3a4368; }

.btn-ok {
  background: rgba(55, 211, 155, 0.14);
  border-color: rgba(55, 211, 155, 0.4);
  color: #7df0c4;
}

.btn-danger {
  background: transparent;
  border-color: rgba(255, 84, 104, 0.32);
  color: var(--danger);
}

.btn-sm { padding: 8px 12px; font-size: 12.5px; border-radius: 9px; }

.note {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(37, 230, 208, 0.06);
  border: 1px solid rgba(37, 230, 208, 0.2);
  color: #a9f4e9;
  font-size: 12.5px;
  line-height: 1.6;
  margin-bottom: 18px;
}

.note.warn {
  background: rgba(255, 176, 32, 0.07);
  border-color: rgba(255, 176, 32, 0.26);
  color: #ffd98a;
}

.note .ico { flex: none; font-weight: 800; }

.flash {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  border: 1px solid rgba(55, 211, 155, 0.32);
  background: rgba(55, 211, 155, 0.09);
  color: #9ff3d2;
}

.flash.error {
  border-color: rgba(255, 84, 104, 0.34);
  background: rgba(255, 84, 104, 0.08);
  color: #ffb0ba;
}

/* ------------------------------------------------------------------ tips */

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }

.steps li {
  position: relative;
  counter-increment: step;
  padding: 0 0 16px 40px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.steps li:last-child { padding-bottom: 0; }

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  background: rgba(108, 123, 255, 0.13);
  border: 1px solid rgba(108, 123, 255, 0.32);
  color: #c3c9ff;
  font-size: 12px;
  font-weight: 800;
}

.steps b { color: var(--txt); }

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 5px;
  background: #0b0e1a;
  border: 1px solid var(--line);
  color: #c7cdf0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11.5px;
}

/* ------------------------------------------------------------------ scenario cards */

.scenario {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 18px;
  padding: 18px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(17, 21, 36, 0.9), rgba(11, 14, 25, 0.94));
}

.scenario + .scenario { margin-top: 12px; }

.scenario h3 { margin-bottom: 5px; }

.scenario .desc {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.scenario .meta {
  color: var(--muted-2);
  font-size: 11.5px;
  margin-bottom: 11px;
  word-break: break-word;
}

.scenario .meta a { color: #8f9bd8; text-decoration: none; }

.linkrow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.linkrow code {
  flex: 1;
  min-width: 190px;
  padding: 9px 11px;
  border-radius: 9px;
  background: #090c16;
  border: 1px solid var(--line);
  color: #aab3e6;
  word-break: break-all;
}

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

.qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  align-self: center;
}

.qr svg {
  width: 112px;
  height: 112px;
  padding: 7px;
  border-radius: 10px;
  background: #fff;
  display: block;
}

.qr span {
  color: var(--muted-2);
  font-size: 10.5px;
  text-align: center;
  line-height: 1.35;
}

.empty {
  padding: 38px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.empty .big { display: block; font-size: 30px; margin-bottom: 8px; opacity: 0.7; }

/* ------------------------------------------------------------------ results */

.page-head { margin-bottom: 20px; }

.back {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12.5px;
  text-decoration: none;
}

.back:hover { color: var(--txt); }

.page-head h1 { margin-bottom: 6px; }

.page-head .sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}

.capture {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(17, 21, 36, 0.9), rgba(11, 14, 25, 0.94));
}

.capture + .capture { margin-top: 14px; }

.shot img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 84, 104, 0.5);
  display: block;
  background: #080b14;
}

.shot .no-shot {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  border: 1px dashed var(--line);
  color: var(--muted-2);
  font-size: 12px;
  text-align: center;
  padding: 14px;
  background: #080b14;
}

.shot .tag {
  display: block;
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 10.5px;
}

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

.shot-grid a {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 84, 104, 0.45);
  background: #080b14;
}

.shot-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border: 0;
  border-radius: 0;
}

.shot-grid .num {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(6, 9, 17, 0.72);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.shot-grid[data-count="1"] {
  grid-template-columns: 1fr;
}

.shot-grid[data-count="1"] img {
  aspect-ratio: 3 / 4;
}

.cap-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cap-top .time { color: var(--muted); font-size: 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.badge.ok {
  color: #7df0c4;
  border-color: rgba(55, 211, 155, 0.35);
  background: rgba(55, 211, 155, 0.08);
}

.badge.no {
  color: #ffb0ba;
  border-color: rgba(255, 84, 104, 0.3);
  background: rgba(255, 84, 104, 0.07);
}

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

.cap-grid div { min-width: 0; }

.cap-grid dt {
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.cap-grid dd {
  margin: 0 0 8px;
  font-size: 13px;
  word-break: break-word;
}

.cap-grid dd a { color: #9fadf0; text-decoration: none; }

.cap-grid .nowrap { white-space: nowrap; }

.cap-grid .wide { grid-column: 1 / -1; }

.capture iframe {
  width: 100%;
  height: 170px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  display: block;
  filter: saturate(0.8);
}

/* ------------------------------------------------------------------ login */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 30px;
}

.login-card .mark-lg {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #070a14;
  margin-bottom: 18px;
  box-shadow: 0 0 40px rgba(108, 123, 255, 0.4);
}

.login-card .mark-lg svg { width: 28px; height: 28px; }

.login-card h1 { margin-bottom: 6px; }

.login-card .lead {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-card .footnote {
  margin: 16px 0 0;
  color: var(--muted-2);
  font-size: 11px;
  text-align: center;
}

/* ------------------------------------------------------------------ responsive */

@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .capture { grid-template-columns: 150px minmax(0, 1fr); }
}

@media (max-width: 620px) {
  .wrap { padding-top: 18px; }
  .card { padding: 18px; }
  .scenario { grid-template-columns: 1fr; }
  .qr { flex-direction: row; justify-content: flex-start; gap: 12px; }
  .qr svg { width: 92px; height: 92px; }
  .capture { grid-template-columns: 1fr; }
  .shot img, .shot .no-shot { aspect-ratio: 4 / 3; max-height: 240px; }
  .nav nav { gap: 12px; }
  .brand span.full { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .btn-primary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
