/* Shared look for the BBCred holder demo. Also mirrored (near-identically) at
   verifier/static/css/style.css so the holder and the demo shop feel like one system,
   even though they're two separate FastAPI apps with their own static mounts. */

:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1c1e26;
  --muted: #6b7280;
  --border: #e2e4ea;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --success: #16a34a;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 2rem 1rem;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.page {
  max-width: 640px;
  margin: 0 auto;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
}

h2 {
  font-size: 1.05rem;
  margin: 1.75rem 0 0.5rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

p.lede {
  color: var(--muted);
  margin-top: 0;
}

nav.top-links {
  margin: 0.75rem 0 1.5rem;
  display: flex;
  gap: 0.75rem;
}

nav.top-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
nav.top-links a:hover { text-decoration: underline; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

textarea { resize: vertical; }

.field {
  margin-bottom: 1rem;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

video {
  display: block;
  width: 100%;
  max-width: 320px;
  border-radius: 8px;
  background: #000;
  margin: 0.75rem 0;
}

button {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: background 0.15s ease;
}
button:hover { background: var(--accent-hover); }
button:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }

.pre-wrap {
  position: relative;
}
.pre-wrap pre {
  margin: 0;
}
.copy-icon-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #d1d5db;
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.copy-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.copy-icon-btn.copied {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

button.danger { background: var(--danger); }
button.danger:hover { background: var(--danger-hover); }

button.icon-btn-sm {
  padding: 0.3rem 0.55rem;
  font-size: 0.9rem;
  line-height: 1;
  border-radius: 6px;
  flex-shrink: 0;
}

button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
button.secondary:hover { background: #eef2ff; }

#status, .status {
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 1.2em;
  margin: 0.5rem 0;
}

pre, #result, #tryResult, #deleteResult, #challengeOut {
  background: #0f1117;
  color: #d1d5db;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
}

ul.bundle-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
ul.bundle-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: var(--card);
}
ul.bundle-list a {
  color: var(--accent);
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
}
ul.bundle-list a:hover { text-decoration: underline; }

table.bundle-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
table.bundle-table th, table.bundle-table td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
table.bundle-table th {
  background: #f9fafb;
  width: 140px;
}
table.bundle-table code {
  font-size: 0.82rem;
  word-break: break-all;
}

.verdict {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0.5rem 0;
}
.verdict.pass { color: var(--success); }
.verdict.fail { color: var(--danger); }

ul.ticklist {
  list-style: none;
  padding: 0;
}
ul.ticklist li {
  padding: 0.3rem 0;
  font-size: 0.92rem;
}

/* QR code <img> tags from qrcode-generator have a fixed pixel width baked into the tag
   itself -- without this, a dense QR for a long payload (session cookie, presentation JWT)
   can overflow a narrow phone screen instead of shrinking to fit. */
img {
  max-width: 100%;
  height: auto;
}

/* Mobile: this demo is routinely used on a phone (both as a public holder instance and for
   scanning QR codes), and the desktop-oriented layout above renders too small/cramped at
   phone widths without this -- requires the <meta name="viewport"> tag in each template's
   <head> to actually take effect; this alone does nothing on a page missing that tag. */
@media (max-width: 480px) {
  body {
    padding: 1rem 0.75rem;
  }
  .card {
    padding: 1rem;
  }
  h1 {
    font-size: 1.3rem;
  }
  /* Full-width, stacked primary actions are easier to tap accurately than side-by-side
     small buttons -- but not the small inline icon buttons (copy/delete), which should stay
     compact regardless of screen size. */
  button:not(.copy-icon-btn):not(.icon-btn-sm) {
    width: 100%;
    margin-top: 0.4rem;
  }
  nav.top-links {
    flex-direction: column;
    gap: 0.5rem;
  }
  video {
    max-width: 100%;
  }
}
