/* Gaya dasar Evoove (sementara). Sistem desain lengkap dibangun bersama Pola Layar Seragam di Fase 0.3. */

:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --text: #1c2529;
  --muted: #5d6b72;
  --brand: #22313a;
  --brand-contrast: #ffffff;
  --accent: #3f8f6b;
  --radius: 16px;
  --space: 16px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12191c;
    --surface: #1b2428;
    --text: #e8eef0;
    --muted: #9aa9b0;
    --brand: #e8eef0;
    --brand-contrast: #12191c;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.view {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--space) + env(safe-area-inset-top)) var(--space) calc(96px + env(safe-area-inset-bottom));
  outline: none;
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.kerangka {
  margin-top: 12vh;
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px var(--space);
}

.kerangka h1 { font-size: 1.4rem; margin: 16px 0 8px; }

.kerangka-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: var(--brand-contrast);
  font-size: 40px;
  font-weight: 700;
}

.pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(63, 143, 107, 0.15);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--text);
  font-size: 0.9rem;
}
.pill[data-state='not-ready'],
.pill[data-state='unsupported'] {
  background: rgba(93, 107, 114, 0.18);
  background: color-mix(in srgb, var(--muted) 18%, transparent);
}

.bottom-nav:empty { display: none; }

/* ---------- Komponen dasar (sementara, dirapikan di Fase 0.3) ---------- */
:root { --line: #d5dde0; --danger: #b3261e; --warn: #8a5a00; --surface-2: #eef2f3; }
@media (prefers-color-scheme: dark) { :root { --line: #33424a; --danger: #ffb4ab; --warn: #ffcf7a; --surface-2: #243036; } }

a { color: inherit; }
h1, h2 { line-height: 1.25; }
h2 { font-size: 1.05rem; margin: 0 0 6px; }

.page-head { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; }
.page-head h1 { font-size: 1.3rem; margin: 0; }
.back { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; text-decoration: none; font-size: 1.3rem; }

.card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin: 0 0 12px; }
.card p { margin: 6px 0; }
.status-card { display: flex; gap: 12px; align-items: flex-start; }
.status-dot { flex: none; width: 14px; height: 14px; margin-top: 5px; border-radius: 50%; background: var(--muted); }
.status-dot[data-state='ok'] { background: var(--accent); }
.status-dot[data-state='syncing'] { background: #3f7fbf; }
.status-dot[data-state='error'] { background: var(--danger); }
.status-dot[data-state='offline'] { background: var(--warn); }

.row { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: 600 0.95rem var(--font); text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--brand); color: var(--brand-contrast); border-color: var(--brand); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-text { color: var(--danger); }
.btn.block { display: flex; width: 100%; margin: 10px 0 0; }
.btn:disabled { opacity: 0.45; cursor: default; }
.file-btn { position: relative; }

.label { display: block; font-weight: 600; font-size: 0.9rem; margin: 12px 0 4px; }
.input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg); color: var(--text); font: 0.95rem var(--font); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8rem; }
.err { color: var(--danger); font-weight: 600; }
.warn { color: var(--warn); }
.note { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }

.segmented { display: flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 4px; }
.seg { flex: 1; min-height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--text); font: 600 0.9rem var(--font); cursor: pointer; }
.seg.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.tab { border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--text); padding: 8px 4px; cursor: pointer; display: flex; flex-direction: column; font: 600 0.85rem var(--font); }
.tab small { font-weight: 400; color: var(--muted); font-size: 0.75rem; }
.tab.on { border-color: var(--brand); background: var(--surface-2); }

.stepper { margin-top: 12px; touch-action: pan-y; }
.step-img { display: block; width: 100%; aspect-ratio: 9 / 16; max-height: 60vh; border: 0; padding: 0; border-radius: 14px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.step-img img { width: 100%; height: 100%; object-fit: contain; }
.step-img.placeholder { display: grid; place-items: center; color: var(--muted); cursor: default; border: 2px dashed var(--line); aspect-ratio: 4 / 3; }
.step-text { font-size: 1rem; }
.dots { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.dot { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 0; background: var(--line); cursor: pointer; }
.dot.on { background: var(--brand); }

.dialog { border: 0; border-radius: 20px; padding: 20px; width: min(92vw, 440px); background: var(--surface); color: var(--text); }
.dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.dialog h2 { margin-top: 0; }
.qr { display: grid; place-items: center; background: #fff; border-radius: 12px; padding: 8px; }
.qr svg { max-width: 100%; height: auto; }
.scanner { width: 100%; border-radius: 12px; background: #000; aspect-ratio: 1; object-fit: cover; }
.zoomed { width: 100%; height: auto; border-radius: 12px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  max-width: min(92vw, 440px); background: #1c2529; color: #fff; padding: 12px 16px; border-radius: 14px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 50; font-size: 0.92rem;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.kerangka .btn { margin-top: 8px; }
.sync-pill { display: inline-block; margin-left: 6px; text-decoration: none; }
.sync-pill[data-state='error'] { background: rgba(179, 38, 30, 0.15); }
