/* SpateLabs: mobile-first styles, no framework */
:root {
  --bg: #f4f7f9;
  --card: #ffffff;
  --ink: #12222b;
  --muted: #5b6b74;
  --line: #d9e2e7;
  --brand: #0b4f6c;
  --brand-ink: #ffffff;
  --accent: #0e7c9b;
  --ok: #15803d;
  --warn: #b45309;
  --err: #b91c1c;
  --radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-text-size-adjust: 100%;
}

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

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 48px; padding: .7rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
  font: inherit; font-weight: 600; text-decoration: none;
  cursor: pointer; user-select: none;
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.big { width: 100%; min-height: 56px; font-size: 1.1rem; }
.btn.small { min-height: 36px; padding: .35rem .75rem; font-size: .9rem; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.file-btn:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- public page ---------- */
.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--brand); letter-spacing: .02em; }
.logo { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--brand); color: #fff; font-size: 1.2rem; }

h1 { font-size: 1.6rem; line-height: 1.2; margin: 1.1rem 0 .4rem; }
.lead { color: var(--muted); margin: 0 0 1rem; }
.ur { display: block; font-style: italic; margin-top: .2rem; }

.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0 0 12px; }
.step h2 { font-size: 1.05rem; margin: 0 0 .7rem; display: flex; align-items: center; gap: .5rem; }
.step h2 small { font-weight: 400; color: var(--muted); }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .85rem; }

.btn-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 420px) { .btn-row { grid-template-columns: 1fr 1fr; } }

.hint { font-size: .88rem; color: var(--muted); margin: .5rem 0 0; }
.hint.right { text-align: right; }
.hint.center { text-align: center; }

.preview { margin-top: 10px; }
.preview video { width: 100%; max-height: 50vh; border-radius: 8px; background: #000; }
.meta { font-size: .88rem; color: var(--ok); margin: .3rem 0 0; font-weight: 600; }

.status { margin: .6rem 0 0; font-size: .93rem; color: var(--muted); }
.status.ok { color: var(--ok); font-weight: 600; }
.status.warn { color: var(--warn); }

.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: block; padding: .55rem .7rem; border: 2px solid var(--line); border-radius: var(--radius); background: #fff; min-height: 100%; }
.chip small { display: block; color: var(--muted); font-size: .8rem; }
.chip input:checked + span { border-color: var(--accent); background: #e7f4f8; }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

textarea, input[type=text], input[type=password], select {
  width: 100%; font: inherit; padding: .65rem .75rem;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }

.consent { font-size: .85rem; color: var(--muted); background: #eef3f6; border-radius: 10px; padding: .7rem .8rem; margin: 4px 0 12px; }

.error { background: #fdecec; color: var(--err); border: 1px solid #f5c2c2; border-radius: 10px; padding: .7rem .8rem; margin: 0 0 12px; }

.progress { margin: 0 0 12px; }
.progress .bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.progress p { margin: .35rem 0 0; font-size: .9rem; color: var(--muted); text-align: center; }

.done { text-align: center; padding-top: 2rem; }
.done .tick { width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 2.2rem; }
.done p { color: var(--muted); }

/* ---------- admin: login ---------- */
.login-card { max-width: 380px; margin: 10vh auto 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.login-card h1 { margin-top: .6rem; font-size: 1.35rem; }
.login-card label { display: block; font-weight: 600; margin: .8rem 0 .3rem; }
.login-card .btn { width: 100%; margin-top: 1.1rem; }

/* ---------- admin: map ---------- */
body.admin { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 8px 12px; background: var(--brand); color: #fff;
}
.topbar .brand { color: #fff; }
.topbar .logo { background: #fff; color: var(--brand); }
.topbar .counts { display: flex; gap: 10px; font-size: .9rem; flex-wrap: wrap; }
.topbar .counts span { white-space: nowrap; }
.topbar .spacer { flex: 1; }
.topbar select { width: auto; padding: .35rem .5rem; min-height: 36px; }
.topbar form { margin: 0; }
.topbar .btn { min-height: 36px; padding: .35rem .75rem; font-size: .9rem; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; border: 1px solid #fff; }
.dot.pending { background: #f59e0b; }
.dot.verified { background: #16a34a; }
.dot.rejected { background: #dc2626; }

#map { flex: 1; min-height: 300px; }
.map-msg { position: absolute; z-index: 500; left: 50%; top: 70px; transform: translateX(-50%); background: #fff; border-radius: 10px; padding: .5rem .9rem; box-shadow: 0 2px 10px rgba(0,0,0,.15); font-size: .92rem; }

/* popup */
.rp h3 { margin: 0 0 .4rem; font-size: 1rem; display: flex; align-items: center; gap: .5rem; }
.rp dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0 0 .5rem; font-size: .86rem; }
.rp dt { color: var(--muted); }
.rp dd { margin: 0; word-break: break-word; }
.rp video { width: 100%; max-height: 240px; background: #000; border-radius: 6px; display: block; }
.rp .vlink { font-size: .82rem; display: inline-block; margin: .25rem 0 .5rem; }
.rp textarea { font-size: .88rem; padding: .4rem .5rem; }
.rp .actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.rp .msg { font-size: .82rem; margin: .3rem 0 0; min-height: 1em; }
.badge { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 99px; color: #fff; }
.badge.pending { background: #d97706; }
.badge.verified { background: #16a34a; }
.badge.rejected { background: #dc2626; }
