/* ==========================================================================
   VirtualID — Design System (shared stylesheet)
   This is the DESIGN/TEMPLATE layer. Keep it separate from page content.
   Minimalist, fast, responsive, near-zero graphics. System fonts only.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-inset: #eef1f4;
  --fg: #1a1d21;
  --fg-soft: #565d66;
  --fg-faint: #8a929c;
  --border: #e3e7ec;
  --brand: #3b5bdb;      /* indigo */
  --brand-fg: #ffffff;
  --brand-soft: #edf0fd;
  --ok: #2f9e44;
  --warn: #e8590c;
  --danger: #e03131;
  --radius: 10px;
  --radius-lg: 16px;
  --maxw: 1080px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --bg-soft: #151922; --bg-inset: #1c212b;
    --fg: #e8ecf1; --fg-soft: #aab3bf; --fg-faint: #727c88;
    --border: #262c37; --brand: #748ffc; --brand-soft: #1a2036;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--fg);
  background: var(--bg); line-height: 1.55; font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 680; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; color: var(--fg-soft); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
small { color: var(--fg-faint); }
code { font-family: var(--mono); font-size: .9em; background: var(--bg-inset); padding: .12em .4em; border-radius: 6px; }

/* Layout */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section-sm { padding: 40px 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { text-align: center; }
.muted { color: var(--fg-faint); }
.stack > * + * { margin-top: 14px; }
@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
  .hide-mobile { display: none !important; }
}

/* Header / nav */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 720; color: var(--fg); font-size: 1.1rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--fg-soft); font-weight: 550; font-size: .95rem; }
.nav-links a:hover { color: var(--fg); text-decoration: none; }
@media (max-width: 760px) { .nav-links a.nav-collapse { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius); font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: var(--brand-fg); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }

/* Cards */
.card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 6px; }
.card .icon { width: 30px; height: 30px; color: var(--brand); margin-bottom: 12px; }

/* Hero */
.hero { padding: 80px 0 56px; text-align: center; }
.hero .tagline { color: var(--brand); font-weight: 640; letter-spacing: .02em; text-transform: uppercase; font-size: .8rem; }
.hero p.lead { font-size: 1.2rem; max-width: 620px; margin: 12px auto 26px; }
.eyebrow { display:inline-block; background: var(--brand-soft); color: var(--brand); font-weight:600; font-size:.78rem; padding: 5px 12px; border-radius: 999px; margin-bottom: 18px; }

/* Badges / pills */
.badge { display:inline-flex; align-items:center; gap:6px; font-size:.75rem; font-weight:600; padding: 3px 10px; border-radius: 999px; background: var(--bg-inset); color: var(--fg-soft); }
.badge-ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge-warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge-brand { background: var(--brand-soft); color: var(--brand); }

/* Forms (mock) */
.field { margin-bottom: 16px; }
.label { display:block; font-weight:600; font-size:.85rem; margin-bottom:6px; color: var(--fg); }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--fg); font: inherit;
}
.input:focus, .textarea:focus { outline: 2px solid var(--brand); border-color: transparent; }
.toggle { width: 40px; height: 24px; border-radius: 999px; background: var(--bg-inset); position: relative; border: none; cursor: pointer; }
.toggle.on { background: var(--brand); }
.toggle::after { content:""; position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:#fff; transition:.15s; }
.toggle.on::after { left: 19px; }

/* Table */
.table { width:100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align:left; padding: 11px 12px; border-bottom: 1px solid var(--border); }
.table th { color: var(--fg-faint); font-weight:600; font-size:.78rem; text-transform:uppercase; letter-spacing:.03em; }
.table tr:hover td { background: var(--bg-soft); }

/* App shell (portal) */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--border); background: var(--bg-soft); padding: 18px 14px; }
.sidebar .brand { padding: 6px 8px 18px; }
.side-link { display:flex; align-items:center; gap:10px; padding: 9px 10px; border-radius: 8px; color: var(--fg-soft); font-weight:550; font-size:.93rem; }
.side-link:hover { background: var(--bg-inset); color: var(--fg); text-decoration:none; }
.side-link.active { background: var(--brand-soft); color: var(--brand); }
.side-link .icon { width: 18px; height: 18px; }
.main { padding: 26px 30px; min-width: 0; display: flex; flex-direction: column; }
.portal-footer { margin-top: auto; padding-top: 22px; border-top: 1px solid var(--border); color: var(--fg-soft); font-size: .82rem; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.avatar-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.avatar-preview { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: var(--brand-soft); color: var(--brand); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 720; font-size: 1.6rem; flex: none; }
.avatar-hint { color: var(--fg-soft); font-size: .82rem; margin: 4px 0 0; }
.vlink { color: var(--brand); text-decoration: none; border-bottom: 1px solid transparent; }
.vlink:hover { border-bottom-color: currentColor; }
.vlink-off { color: var(--fg); cursor: text; border-bottom: none; }
.portal-footer a { color: var(--fg-soft); }
.portal-footer a:hover { color: var(--brand); }
.card-stale { opacity: .62; filter: grayscale(.4); }
.card-stale::after { content: ""; }
.page-head { margin-bottom: 22px; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 20px; }
}

/* QR mock (CSS only, no image) */
.qr { width: 120px; height: 120px; border-radius: 10px; background:
  conic-gradient(from 0deg, var(--fg) 0 25%, transparent 0 50%, var(--fg) 0 75%, transparent 0);
  background-size: 20px 20px; border: 6px solid var(--fg); background-color: var(--bg); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--fg-faint); font-size:.9rem; margin-top: 40px; }
.site-footer a { color: var(--fg-soft); }
.footer-cols { display:flex; gap:60px; flex-wrap: wrap; }
.footer-cols h4 { font-size:.8rem; text-transform:uppercase; letter-spacing:.04em; color: var(--fg-faint); }
.footer-cols a { display:block; margin: 6px 0; }

/* Utilities */
.mockup-banner { background: var(--warn); color:#fff; text-align:center; font-size:.8rem; padding:6px; font-weight:600; letter-spacing:.02em; }
.pill-row { display:flex; gap:8px; flex-wrap:wrap; }
.divider { height:1px; background: var(--border); margin: 24px 0; border:0; }
.kpi { font-size: 2rem; font-weight: 720; letter-spacing:-.02em; }
