* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1 { font-family: var(--font-display); font-weight: 700; margin: 0; color: var(--ink); }
h2 { font-family: var(--font-display); font-weight: 700; font-size: 18px; margin: 0 0 8px; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.mono-id { font-family: var(--font-mono); }

/* ---- header / footer ---- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 32px;
  background: var(--cloud);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-seal {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--brand); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }

.site-footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 12px;
}

.btn {
  border: none;
  border-radius: var(--radius-btn);
  padding: 13px 22px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { background: var(--muted); opacity: 1; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { border-color: var(--muted); }
.btn-text { color: var(--brand); font-weight: 600; }
.btn-text:hover { color: var(--brand-dark); }

.page {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px 60px;
  position: relative;
  overflow: hidden;
}
.page::before {
  content: '';
  position: absolute;
  top: -180px;
  right: -160px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: var(--foil-gradient);
  opacity: 0.06;
  pointer-events: none;
}

/* ---- lookup / homepage ---- */
.lookup-view { width: 100%; max-width: 560px; text-align: center; margin-top: 4vh; }
.lookup-icon {
  width: 60px; height: 60px; border-radius: 50%;
  border: 2px solid var(--brand); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.lookup-view h1 { font-size: 32px; margin-bottom: 10px; }
.lookup-sub { color: var(--muted); font-size: 15px; margin: 0 0 28px; }
.lookup-form { display: flex; gap: 10px; }
.lookup-form input {
  flex: 1;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-btn);
  font-family: var(--font-mono);
  font-size: 14px;
  background: #fff;
  color: var(--muted);
}
.lookup-form input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20,22,28,0.1); outline: none; color: var(--ink); }
.field-error {
  color: var(--danger);
  background: var(--danger-bg);
  padding: 8px 12px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  margin: 14px 0 0;
  text-align: left;
}
.issued-by { color: var(--muted); font-size: 13px; margin-top: 32px; }
.issued-by strong { color: var(--ink-soft); }

/* ---- state views (loading / not found) ---- */
.state-view { width: 100%; max-width: 480px; text-align: center; margin-top: 8vh; }
.state-text { color: var(--ink-soft); margin-top: 12px; }

/* ---- status pill (shared visual language with dashboard) ---- */
.seal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 auto 16px;
}
.seal-badge.active   { color: var(--verified); background: var(--verified-bg); }
.seal-badge.pending  { color: var(--warn-fg);  background: var(--warn-bg); }
.seal-badge.notfound { color: var(--muted);    background: #F1F1F6; }

/* ---- certificate ---- */
.cert-view { width: 100%; max-width: 620px; }
.cert-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px;
}
.cert-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.cert-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 6px;
}
#cert-title { font-size: 24px; }
.cert-artist { color: var(--ink-soft); margin: 4px 0 0; }
.cert-view .seal-badge { margin: 0; flex-shrink: 0; }

.cert-fields {
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
}
.cert-fields dt { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.cert-fields dd { margin: 0; font-size: 14px; }

.verify-card {
  margin-top: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
}
.verify-sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 12px; }
.verify-note { color: var(--muted); font-size: 13px; margin: 0; font-style: italic; }

.verify-shot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.verify-shot-slot {
  border: 1px dashed var(--line);
  border-radius: var(--radius-btn);
  padding: 12px 10px;
  text-align: center;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  background: var(--brand-tint);
}
.verify-shot-slot .shot-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.verify-shot-slot input[type=file] { font-size: 11px; width: 100%; }
.verify-shot-slot .shot-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-btn);
  background: #fff;
}

.verify-result { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.verify-result-head { display: flex; align-items: center; gap: 14px; }
.verify-result .seal-badge { margin: 0; flex-shrink: 0; }
.verify-result-title { font-weight: 700; font-size: 16px; margin: 0; }
.verify-result-detail { color: var(--ink-soft); font-size: 13px; margin: 4px 0 0; }

@media (max-width: 560px) {
  .site-header { padding: 16px 20px; }
  .lookup-form { flex-direction: column; }
  .cert-card { padding: 24px 20px; }
  .cert-fields { grid-template-columns: 1fr; }
  .cert-card-head { flex-direction: column-reverse; }
}