/* OpenBMCS licensing portal styles — plain CSS, no framework.
   Kept intentionally terse; the portal serves admin + a handful of
   customer-facing pages, not a marketing site. Matching the clean
   look-and-feel of openbmcs.com but without replicating its full
   design system. */

:root {
  --fg: #1d2024;
  --fg-muted: #6b7280;
  --bg: #f7f8fa;
  --card: #ffffff;
  --border: #e5e7eb;
  --accent: #175ce6;            /* OpenBMCS blue (matches the logo path fill) */
  --accent-fg: #ffffff;
  --err: #b42318;
  --ok: #067647;
  --warn: #b54708;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Two-tier wrap: full topbar background, 960 inner column. Main
   content uses a narrower 720 column so the activation form doesn't
   look lost inside a 960 container. */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }
main.wrap { padding-top: 2.5rem; padding-bottom: 3rem; flex: 1; }

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 0;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--fg);
}
.brand img { height: 28px; width: auto; display: block; align-self: center; }
  font-size: 0.9rem;
  color: var(--fg-muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}
nav a { margin-left: 1rem; color: var(--fg-muted); text-decoration: none; font-size: 0.95rem; }
nav a:hover { color: var(--accent); }

h1 { font-size: 1.65rem; margin: 0 0 1rem 0; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 1rem 0; }

.muted { color: var(--fg-muted); }
.small { font-size: 0.875rem; }
.error { background: #fef2f2; color: var(--err); padding: 0.75rem 1rem; border-radius: 6px; border: 1px solid #fecaca; margin-bottom: 1rem; }
.msg { background: #f0fdf4; color: var(--ok); padding: 0.75rem 1rem; border-radius: 6px; border: 1px solid #bbf7d0; margin-bottom: 1rem; }

/* Product cards on the landing page */
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.features { list-style: none; padding: 0; margin: 0 0 1.25rem 0; }
.features li { border-top: 1px solid var(--border); padding: 0.85rem 0; }
.features li:first-child { border-top: none; padding-top: 0; }
.price { font-weight: 600; margin-top: 0.35rem; color: var(--fg); }

/* The activate form sits inside a card to echo the landing aesthetic.
   No inner max-width — the parent main.wrap already caps at 720px,
   and narrower than that on the form alone leaves the page feeling
   lopsided. */
form.activate {
  display: grid;
  gap: 1.1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
form.activate label { display: flex; flex-direction: column; gap: 0.35rem; }
form.activate label span { font-weight: 500; font-size: 0.95rem; }
form.activate input, form.activate select {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  background: var(--card);
}
form.activate input:focus, form.activate select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 92, 230, 0.15);
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.65rem 1.15rem;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  transition: filter 120ms ease, transform 120ms ease;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn.disabled-paypal { background: #9aa4b0; cursor: not-allowed; }
.btn.small { padding: 0.3rem 0.65rem; font-size: 0.85rem; }
.btn.muted { background: #6b7280; }

/* Order detail page */
dl.order { display: grid; grid-template-columns: 10rem 1fr; gap: 0.35rem 1rem; margin: 0 0 1.25rem 0; }
dl.order dt { font-weight: 500; color: var(--fg-muted); }
dl.order dd { margin: 0; }

pre.token {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.85rem;
  line-height: 1.45;
}

/* Admin orders table */
table.orders {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
table.orders th, table.orders td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: middle;
}
table.orders th { background: #f3f4f6; font-weight: 500; }
.actions { white-space: nowrap; }
.paypal-refs code { font-size: 0.75em; display: block; word-break: break-all; }

.status { padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.7rem; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; }
.status-pending_payment { background: #fef3c7; color: #92400e; }
.status-paid { background: #f0fdf4; color: var(--ok); }
.status-comp { background: #dbeafe; color: #1e40af; }
.status-refunded { background: #f3f4f6; color: var(--fg-muted); }
.status-cancelled { background: #f3f4f6; color: var(--fg-muted); }

code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; }

footer { margin-top: auto; padding-bottom: 1.5rem; }
footer p { color: var(--fg-muted); font-size: 0.875rem; margin: 0; }
