/* =========================================================
   CARICUAN LOKASI — Halaman Staff v2 (mobile-first)
   ========================================================= */

:root {
    --brand: #13294b;
    --brand-2: #1d3d6b;
    --accent: #0fa968;
    --accent-soft: rgba(15, 169, 104, .12);
    --amber: #e39b0c;
    --amber-soft: rgba(227, 155, 12, .14);
    --red: #e5484d;
    --red-soft: rgba(229, 72, 77, .12);
    --bg: #f3f5f9;
    --surface: #ffffff;
    --surface-2: #f6f8fb;
    --border: #e4e8ef;
    --text: #0f1b2d;
    --muted: #64748b;
    --radius: 20px;
    --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 10px 30px rgba(15, 27, 45, .08);
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --accent: #22c47e;
        --accent-soft: rgba(34, 196, 126, .16);
        --amber: #f2b23a;
        --amber-soft: rgba(242, 178, 58, .16);
        --red: #ff6b6f;
        --red-soft: rgba(255, 107, 111, .14);
        --bg: #0a111f;
        --surface: #111a2c;
        --surface-2: #162238;
        --border: #22314c;
        --text: #e6edf7;
        --muted: #8a9bb8;
        --shadow: 0 10px 30px rgba(0, 0, 0, .35);
        color-scheme: dark;
    }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
    font-family: var(--font);
    color: var(--text);
    background:
        linear-gradient(180deg, var(--brand) 0, var(--brand-2) 230px, var(--bg) 230px);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    line-height: 1.5;
}
button, input { font: inherit; color: inherit; }
.muted { color: var(--muted); }

.shell {
    max-width: 460px; margin: 0 auto; min-height: 100dvh;
    padding: calc(20px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: 14px;
}

/* Header */
.hero { display: flex; align-items: center; gap: 14px; color: #fff; padding: 8px 4px 14px; }
.mark {
    width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; flex-shrink: 0;
    background: linear-gradient(135deg, #18c47d, #0b8a55); box-shadow: 0 8px 20px -8px #0fa968;
}
.mark svg { width: 26px; height: 26px; color: #fff; }
.hero h1 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.hero p { opacity: .75; font-size: 13px; }

/* Card */
.card {
    background: var(--surface); border-radius: var(--radius); padding: 22px 20px;
    box-shadow: var(--shadow); border: 1px solid var(--border);
}
.card h2 { font-size: 20px; font-weight: 800; letter-spacing: -.015em; margin-bottom: 6px; }
.card.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 22px; }
.card.center .btn { margin-top: 12px; }

.page { display: none; }
.page.active { display: flex; flex-direction: column; gap: 14px; animation: rise .3s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* Form */
.field { display: block; font-weight: 700; font-size: 13px; margin: 18px 0 6px; }
#nama-input {
    width: 100%; height: 52px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--border);
    background: var(--surface-2); font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
#nama-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.consent { margin: 16px 0 18px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 14px 14px 12px; }
.consent-title { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.consent ul { list-style: none; display: grid; gap: 8px; font-size: 13.5px; color: var(--muted); }
.consent li { display: flex; gap: 10px; align-items: flex-start; }
.consent li b { color: var(--text); }
.ci { width: 22px; text-align: center; flex-shrink: 0; }
.agree {
    display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border);
    font-weight: 600; font-size: 14px; cursor: pointer; user-select: none;
}
.agree input { width: 20px; height: 20px; accent-color: var(--accent); flex-shrink: 0; }

/* Buttons */
.btn {
    width: 100%; height: 54px; border: 0; border-radius: 16px; font-weight: 700; font-size: 16px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    transition: transform .1s, filter .15s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -10px var(--accent); }
.btn-danger { background: var(--red); color: #fff; box-shadow: 0 10px 24px -10px var(--red); }
.btn-link { background: none; color: var(--muted); height: 40px; font-size: 14px; font-weight: 600; }
.dot-live { width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .3); }

/* Status */
.status-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.status-title { font-weight: 800; font-size: 18px; letter-spacing: -.01em; line-height: 1.25; }
.status-sub { color: var(--muted); font-size: 13px; }
.radar { position: relative; width: 52px; height: 52px; flex-shrink: 0; --c: var(--amber); }
.radar i { position: absolute; inset: 16px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }
.radar span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--c); opacity: 0; animation: radar 2.2s ease-out infinite; }
.radar span:nth-child(2) { animation-delay: 1.1s; }
@keyframes radar { from { transform: scale(.35); opacity: .9; } to { transform: scale(1); opacity: 0; } }
.status-card[data-state="ok"] .radar { --c: var(--accent); }
.status-card[data-state="error"] .radar { --c: var(--red); }
.status-card[data-state="error"] .radar span { animation: none; }

.mini-map { height: 210px; border-radius: 16px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); position: relative; }
.mini-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; padding: 20px; text-align: center; }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #2f80ed; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47, 128, 237, .25), 0 2px 6px rgba(0, 0, 0, .3); }
.leaflet-container { font-family: var(--font); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 16px; }
.stats > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 10px 8px; text-align: center; display: flex; flex-direction: column; }
.stats b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: 11.5px; }

.tip b { font-size: 14px; }
.tip p { font-size: 13px; margin-top: 2px; }
.switch { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-weight: 600; font-size: 14px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.track { width: 46px; height: 28px; border-radius: 999px; background: var(--border); position: relative; transition: background .2s; flex-shrink: 0; }
.thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track .thumb { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px var(--accent-soft); }

.avatar-xl { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; font-size: 26px; font-weight: 800; color: #fff; background: var(--brand-2); margin-bottom: 8px; }
.done-icon { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 8px; }
.done-icon svg { width: 36px; height: 36px; }

/* Alert */
.alert { padding: 12px 14px; border-radius: 14px; font-weight: 600; font-size: 14px; animation: rise .25s ease-out; }
.alert.error { background: #fde8e9; color: #b4232a; border: 1px solid #f6c7ca; }
.alert.success { background: #e3f7ee; color: #0b7a4b; border: 1px solid #bfe9d4; }
@media (prefers-color-scheme: dark) {
    .alert.error { background: #3a1519; color: #ffb3b6; border-color: #5a2228; }
    .alert.success { background: #0f2e22; color: #8ff0c3; border-color: #1c4a37; }
}

footer { margin-top: auto; text-align: center; color: var(--muted); font-size: 12px; padding-top: 8px; }

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

/* Video YouTube */
.video-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.video-head b { font-size: 14px; }
.video-head p { font-size: 13px; margin-top: 2px; }
.btn-mini { flex-shrink: 0; border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 6px 10px; font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--text); }
.video-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-note { font-size: 12px; margin-top: 10px; }
