:root {
  --bg: #f6f7f8;
  --fg: #0a0c10;
  --muted: #5a606b;
  --card: #fff;
  --border: #d8dbe0;
  --accent: #2563eb;
  --accent-fg: #fff;
  --error: #b91c1c;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
}
html.dark {
  --bg: #0d1117;
  --fg: #e6edf3;
  --muted: #8b949e;
  --card: #161b22;
  --border: #30363d;
  --accent: #58a6ff;
  --accent-fg: #0d1117;
  --error: #f85149;
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.5);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  padding-top: 56px;
}
body.center {
  display: grid;
  place-items: center;
}

/* Sticky top bar — marketplace.alittlebit.io brand always visible, "." = theme switch */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 18px;
  z-index: 100;
}
.brand {
  justify-self: center;
  font-size: 18px; font-weight: 700;
  letter-spacing: 0.2px; margin: 0;
  color: var(--fg);
  white-space: nowrap;
}
.brand .theme-glyph {
  display: inline-block;
  background: transparent; border: 0; cursor: pointer;
  padding: 0; margin: 0 1px;
  vertical-align: middle;
  color: var(--accent);
  line-height: 0;
}
.brand .theme-glyph svg {
  width: 1em; height: 1em;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  display: block;
}
.brand .theme-glyph:hover { transform: rotate(20deg); transition: transform .12s; }
.lang-switch {
  justify-self: end;
  display: flex; gap: 2px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 7px; padding: 2px;
}
.lang-switch button {
  background: transparent; border: 0; padding: 4px 9px;
  color: var(--muted); font-size: 11px; cursor: pointer;
  border-radius: 5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.lang-switch button.active {
  background: var(--accent); color: var(--accent-fg);
}
.tagline {
  text-align: center; color: var(--muted); font-size: 13px;
  margin: 0 0 22px 0;
}
.auth-title {
  text-align: center; font-size: 16px; font-weight: 600;
  margin: 0 0 4px;
}
.auth-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 36px 28px;
  width: 380px;
  box-shadow: var(--shadow);
}
form label {
  display: block; margin-bottom: 12px;
  font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  font-weight: 500;
}
form input, form select {
  display: block; width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  font-family: inherit;
}
form input:focus, form select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
form button[type=submit] {
  width: 100%;
  padding: 12px;
  margin-top: 14px;
  background: var(--accent);
  color: var(--accent-fg);
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.2px;
}
form button[type=submit]:hover { filter: brightness(1.05); }
form button[type=submit]:disabled { opacity: 0.6; cursor: wait; }

.alt-link {
  text-align: center; font-size: 13px; color: var(--muted);
  margin: 18px 0 0;
}
.alt-link a { color: var(--accent); text-decoration: none; font-weight: 500; }
.alt-link a:hover { text-decoration: underline; }

.err { color: var(--error); font-size: 13px; margin: 10px 0 0; min-height: 1em; text-align: center; }
.ok  { color: #16a34a; font-size: 13px; margin: 10px 0 0; min-height: 1em; text-align: center; }

.site-footer {
  position: fixed; bottom: 12px; left: 0; right: 0;
  text-align: center; font-size: 12px; color: var(--muted);
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* check-email */
.info-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 36px 40px;
  max-width: 460px; text-align: center;
  box-shadow: var(--shadow);
}
.info-box .icon {
  width: 56px; height: 56px; margin: 0 auto 14px;
  background: rgba(59,130,246,0.10); border-radius: 50%;
  display: grid; place-items: center; color: var(--accent);
}
.info-box .icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; }
.info-box h2 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.info-box p { margin: 0 0 6px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.info-box .email-hint { color: var(--fg); font-weight: 500; }

/* dashboard layout */
body.dash {
  padding: 80px 28px 60px;
}
.dash-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
}
.btn-ghost {
  background: transparent; border: 1px solid var(--border);
  color: var(--fg); padding: 7px 12px; border-radius: 7px;
  cursor: pointer; font-size: 13px;
}
.module-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
/* viewfinder frame (4 corner brackets, no full border) */
.module-card {
  position: relative;
  background: transparent;
  padding: 22px 26px;
  color: var(--fg);
}
.module-card::before, .module-card::after,
.module-card > i::before, .module-card > i::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid var(--fg);
  opacity: 0.85;
  transition: opacity .15s, border-color .15s;
}
.module-card > i { display: inline; position: static; font-style: normal; }
.module-card::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.module-card::after  { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.module-card > i::before { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.module-card > i::after  { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.module-card:hover::before, .module-card:hover::after,
.module-card:hover > i::before, .module-card:hover > i::after {
  opacity: 1; border-color: var(--accent);
}
.module-card.locked { opacity: 0.55; }
.module-card.locked:hover::before, .module-card.locked:hover::after,
.module-card.locked:hover > i::before, .module-card.locked:hover > i::after {
  border-color: var(--fg);
}
.module-card h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--fg); }
.module-card p { margin: 0; font-size: 13px; color: var(--fg); opacity: 0.78; line-height: 1.45; }
.module-card .badge {
  display: inline-block; padding: 3px 9px; border-radius: 5px;
  font-size: 10px; font-weight: 700; margin-top: 14px;
  text-transform: uppercase; letter-spacing: 0.6px;
}
.module-card .badge.soon { background: rgba(90,96,107,0.15); color: var(--muted); }
.module-card .badge.ready { background: rgba(22,163,74,0.15); color: #15803d; }
