/* Shared by all three demo sites: the wallet imports it, and cert-site and
   consent-o-tron embed it. Each site sets its accent with a body class. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1b1f24;
  --muted: #5d6673;
  --border: #dde1e6;
  --accent: #3b5bdb;
  --accent-text: #ffffff;
  --ok: #2b8a3e;
  --warn: #c92a2a;
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --surface: #1a1e24;
    --text: #e6e9ee;
    --muted: #98a2b0;
    --border: #2c323b;
    --accent: #748ffc;
    --accent-text: #0b0d10;
    --ok: #69db7c;
    --warn: #ff8787;
    color-scheme: dark;
  }
}

body.cert { --accent: #0c8599; }
body.consent { --accent: #c2255c; }
body.registry { --accent: #6741d9; }
@media (prefers-color-scheme: dark) {
  body.cert { --accent: #3bc9db; }
  body.consent { --accent: #f783ac; }
  body.registry { --accent: #b197fc; }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

#app, main {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

header { margin-bottom: 20px; }
header h1 { margin: 0; font-size: 22px; }
header .site { color: var(--accent); font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
h2 { font-size: 17px; margin: 24px 0 8px; }
h3 { font-size: 14px; margin: 16px 0 6px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
}

.row { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.actions { justify-content: flex-end; margin-top: 12px; }
.center { text-align: center; padding: 32px 0; }
.muted { color: var(--muted); }
.warn { color: var(--warn); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; word-break: break-all; }

.badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); }
.badge.ok { color: var(--ok); border-color: currentColor; }
.badge.fail { color: var(--warn); border-color: currentColor; }

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
form .row input { flex: 1; width: auto; min-width: 0; }
label { display: block; margin: 12px 0 4px; font-weight: 500; }
label > input, label > select, label > textarea { margin-top: 4px; font-weight: 400; }

button, .button {
  font: inherit;
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-text);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:disabled { opacity: .5; cursor: default; }
button.secondary, .button.secondary { background: transparent; color: var(--text); border-color: var(--border); }
button.link { background: none; border: none; color: var(--accent); padding: 4px; font-weight: 500; }
button.danger { color: var(--warn); }

.steps { list-style: none; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.steps li { font-size: 12px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); }
.steps li.done { color: var(--ok); border-color: currentColor; }
.steps li.now { color: var(--accent); border-color: currentColor; font-weight: 600; }

.asset { display: flex; gap: 12px; align-items: center; margin: 12px 0; }
.asset img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.asset.large img { width: 100%; height: auto; max-height: 360px; object-fit: contain; }
.asset.large { flex-direction: column; align-items: stretch; }

dl.terms { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
dl.terms dt { color: var(--muted); }
dl.terms dd { margin: 0; }

pre.agreement {
  white-space: pre-wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font: 13px/1.5 ui-monospace, Menlo, monospace;
  max-height: 260px;
  overflow: auto;
}

ul.history, ul.outcomes { list-style: none; padding: 0; margin: 0; }
ul.history li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
ul.outcomes li { display: grid; grid-template-columns: 20px 1fr; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--border); }
ul.outcomes .code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
ul.outcomes .pass { color: var(--ok); }
ul.outcomes .fail { color: var(--warn); }

.notice { border-left: 3px solid var(--accent); padding: 8px 12px; background: var(--surface); border-radius: 0 8px 8px 0; }

@media (max-width: 480px) {
  dl.terms { grid-template-columns: 1fr; }
  .asset { flex-direction: column; align-items: flex-start; }
}

/* The wallet dialog that sites open over their own page. */
dialog.wallet-dialog {
  width: min(480px, calc(100vw - 32px));
  height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}
dialog.wallet-dialog::backdrop { background: rgb(0 0 0 / .45); }
dialog.wallet-dialog .wallet-bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--border); font-weight: 600; }
dialog.wallet-dialog iframe { flex: 1; border: 0; width: 100%; }

fieldset.identities { border: 0; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
fieldset.identities legend { font-weight: 500; margin-bottom: 6px; }
label.identity { display: flex; gap: 10px; align-items: center; margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-weight: 400; }
label.identity:has(input:checked) { border-color: var(--accent); }
label.identity input { width: auto; margin: 0; }
label.identity > span { display: flex; flex-direction: column; }
