:root {
  --bg: #0f172a;
  --panel: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --border: #e2e8f0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 260px, #f1f5f9 260px);
  color: var(--text);
  min-height: 100vh;
}

header.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  color: white;
}

header.topbar h1 {
  font-size: 20px;
  margin: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.lang-switcher {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.lang-switcher option {
  color: var(--text);
}

.how-it-works .steps li {
  margin-bottom: 8px;
}

/* The logo's wordmark is dark navy on a transparent background, which
   disappears against the header's dark navy backdrop -- a small white
   chip behind it keeps the mark legible regardless of the page's header
   color. */
/* .eq-brand is a wrapper (not the <img> itself) so the white chip's size is
   set independently of the logo's rendered size -- setting height+padding
   directly on an <img> is unreliable across browsers because "height"
   on a replaced element doesn't consistently subtract padding the way it
   does on a block box, which is what made the logo render oversized. */
.eq-brand {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  padding: 5px 10px;
  border-radius: 6px;
  line-height: 0;
}
.eq-brand img {
  display: block;
  height: 22px;
  width: auto;
}

header.topbar nav a {
  color: #cbd5e1;
  text-decoration: none;
  margin-left: 20px;
  font-size: 14px;
}
header.topbar nav a:hover { color: white; }

main.container {
  max-width: 640px;
  margin: 40px auto 80px;
  padding: 0 20px;
}

.card {
  background: var(--panel);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  margin-bottom: 24px;
}

.card h2 {
  margin-top: 0;
  font-size: 18px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 16px 0 6px;
  color: var(--muted);
}

input[type=text], input[type=email], input[type=password], textarea, input[type=file] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

textarea { resize: vertical; }

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
}
button:hover { background: var(--accent-dark); }
button:disabled { background: #94a3b8; cursor: not-allowed; }
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button.secondary:hover { background: #eff6ff; }

.msg { padding: 12px 14px; border-radius: 8px; font-size: 14px; margin-top: 16px; }
.msg.error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.msg.success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.msg.info { background: #eff6ff; color: var(--accent-dark); border: 1px solid #bfdbfe; }

.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

a.link { color: var(--accent); text-decoration: none; }
a.link:hover { text-decoration: underline; }

.terms-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  max-height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 13px;
  color: #334155;
  background: #f8fafc;
  margin-top: 12px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
}
.checkbox-row input { margin-top: 3px; }
.checkbox-row label { margin: 0; font-weight: 400; color: var(--text); font-size: 14px; }

.key-display {
  font-family: ui-monospace, SFMono-Regular, monospace;
  background: #0f172a;
  color: #86efac;
  padding: 14px;
  border-radius: 8px;
  word-break: break-all;
  font-size: 13px;
  margin-top: 12px;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.available { background: #f0fdf4; color: var(--success); }
.badge.assigned { background: #eff6ff; color: var(--accent-dark); }
.badge.revoked { background: #fef2f2; color: var(--danger); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-box {
  background: white;
  border-radius: 12px;
  padding: 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-box h3 { margin-top: 0; font-size: 17px; }
.modal-box p { font-size: 14px; color: var(--text); line-height: 1.5; }
.modal-box button { margin-top: 16px; }

.set-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}
.set-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--accent-dark);
  font-size: 13px;
  text-decoration: none;
  border: 1px solid #bfdbfe;
}
.set-pill.active { background: var(--accent); color: white; border-color: var(--accent); }

.set-select-row { display: flex; gap: 8px; align-items: center; }
.set-select-row select { flex: 1; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.stat { background: #f8fafc; border-radius: 8px; padding: 16px; text-align: center; }
.stat .n { font-size: 24px; font-weight: 700; }
.stat .label { font-size: 12px; color: var(--muted); }

.steps { padding-left: 20px; }
.steps li { margin-bottom: 10px; line-height: 1.5; }

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