:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #0e7490;
  --brand-dark: #155e75;
  --ok: #16a34a;
  --ok-bg: #ecfdf3;
  --bad: #dc2626;
  --bad-bg: #fef2f2;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

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

/* ---------- Header ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
}
.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand);
  display: grid;
  place-items: center;
  color: #fff;
}
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
}
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.active { background: #e0f2fe; color: var(--brand-dark); }

/* ---------- Layout ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
.narrow { max-width: 620px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.15; margin: 0 0 12px; }
h2 { font-size: 1.5rem; margin: 0 0 12px; }
h3 { font-size: 1.1rem; margin: 0 0 6px; }
.lead { font-size: 1.15rem; color: var(--muted); margin: 0 0 22px; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
section { margin-top: 44px; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  align-items: center;
}
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }
.tag {
  display: inline-block;
  background: #e0f2fe;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
}
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { background: #e9edf5; }
.btn.ok { background: var(--ok); }
.btn.ok:hover { background: #15803d; }
.btn.danger { background: var(--bad); }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 700; margin: 14px 0 6px; }
input[type=text], input[type=url], select, textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.82rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #7dd3fc; border-color: #38bdf8; }

/* ---------- Status (verify page) ---------- */
.status {
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  border: 2px solid transparent;
}
.status .icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  color: #fff;
}
.status h1 { font-size: 1.9rem; margin-bottom: 6px; }
.status p { margin: 0; }
.status.trusted { background: var(--ok-bg); border-color: #86efac; }
.status.trusted .icon { background: var(--ok); }
.status.trusted h1 { color: #166534; }
.status.tampered { background: var(--bad-bg); border-color: #fca5a5; }
.status.tampered .icon { background: var(--bad); }
.status.tampered h1 { color: #991b1b; }
.status.unknown { background: var(--warn-bg); border-color: #fcd34d; }
.status.unknown .icon { background: var(--warn); }
.status.unknown h1 { color: #92400e; }
.status.loading { background: var(--card); border-color: var(--line); }
.status.loading .icon { background: var(--muted); }

.details { margin-top: 18px; }
.details dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 0; }
.details dt { color: var(--muted); font-weight: 600; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.domain { font-size: 1.15rem; font-weight: 800; }

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

/* ---------- Steps / features ---------- */
.step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800;
  margin-bottom: 10px;
}
.state-card { border-top: 6px solid; }
.state-card.ok { border-top-color: var(--ok); }
.state-card.bad { border-top-color: var(--bad); }
.state-card.warn { border-top-color: var(--warn); }

/* ---------- QR output ---------- */
.qr-box { text-align: center; }
.qr-box canvas {
  width: 100%;
  max-width: 300px;
  height: auto;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.link-out {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  word-break: break-all;
  text-align: left;
  margin-top: 12px;
}

.notice {
  background: var(--warn-bg);
  border: 1px solid #fcd34d;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.92rem;
}
.notice.info { background: #eff6ff; border-color: #bfdbfe; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs button {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--muted);
}
.tabs button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.hidden { display: none !important; }

/* ---------- Demo kit (printable) ---------- */
.kit { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.kit-item { text-align: center; }
.kit-item canvas { width: 220px; height: 220px; image-rendering: pixelated; }
.kit-item .label { font-weight: 800; font-size: 1.1rem; margin-top: 8px; }

footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 30px 20px; }

@media print {
  .topbar, .no-print, footer { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
