/* Login gate overlay + user bar for the assessment portal.
   The report itself is styled by the template inherited from html.py; these styles only
   cover the auth chrome layered on top. */
/* The `hidden` attribute must win over the display rules below, or `gate.hidden = true`
   leaves the overlay covering the rendered report. */
.ca-gate[hidden], .ca-userbar[hidden] { display: none !important; }
.ca-gate {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, #1b2638, #0c1019);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif; color: #f2f6fc;
}
.ca-gate-card {
  width: min(420px, 90vw); padding: 34px 30px; text-align: center;
  background: rgba(13, 20, 33, 0.92); border: 1px solid rgba(120, 150, 200, 0.35);
  border-radius: 16px; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}
.ca-gate-logo { font-size: 40px; margin-bottom: 6px; }
.ca-gate-card h2 { margin: 4px 0 10px; font-size: 21px; }
.ca-gate-sub { color: #c3cee0; font-size: 13.5px; margin: 0 0 20px; }
.ca-btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  padding: 11px 20px; border-radius: 8px; color: #fff;
  background: linear-gradient(180deg, #2b88d8, #1d6fbf);
}
.ca-btn:hover { filter: brightness(1.08); }
.ca-btn-ghost { background: transparent; border: 1px solid rgba(120, 150, 200, 0.55); color: #cfe0f5; }
.ca-btn-ghost:hover { filter: none; background: rgba(120, 150, 200, 0.14); }
/* Gate buttons stack full-width; the kit link is an <a> styled as a button. */
#ca-anon .ca-btn, #ca-authed .ca-btn { display: block; width: 100%; margin: 8px 0 0; box-sizing: border-box; }
#ca-kit, #ca-kit-authed { text-decoration: none; text-align: center; }
/* Signed-in "or upload" row: Download kit + Upload JSON side by side. */
.ca-row { display: flex; gap: 8px; }
.ca-row .ca-btn { width: auto; flex: 1; }
.ca-gate-or {
  display: flex; align-items: center; gap: 10px; margin: 14px 2px; color: #7e8aa0;
  font-size: 12px; text-transform: uppercase; letter-spacing: .12em;
}
.ca-gate-or::before, .ca-gate-or::after { content: ""; flex: 1; height: 1px; background: rgba(120, 150, 200, 0.28); }
/* Build / environment indicator — small amber pill, top-centre (test + feature builds only). */
#ca-build-banner {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 9600;
  background: #9a6700; color: #fff; pointer-events: none;
  font: 600 11px/1 -apple-system, "Segoe UI", Roboto, sans-serif;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 4px 12px; border-radius: 0 0 8px 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.ca-gate-msg { min-height: 18px; margin: 14px 0 4px; font-size: 13px; color: #ffd479; }
.ca-gate-msg.err { color: #ff8a8a; }
.ca-log {
  text-align: left; margin: 12px 0 4px; max-height: 200px; overflow-y: auto;
  background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(120, 150, 200, 0.25); border-radius: 8px;
  padding: 9px 11px; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #cfe0f5; white-space: pre-wrap; word-break: break-word;
}
.ca-log > div { margin: 1px 0; animation: ca-fade 0.25s ease-out; }
@keyframes ca-fade { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ca-log > div { animation: none; } }
.ca-gate-fine { margin-top: 16px; font-size: 11.5px; color: #7e8aa0; }
.ca-userbar {
  /* sit to the LEFT of the report's fixed top-right controls (theme select + "⬇ Download") */
  position: fixed; top: 10px; right: 250px; z-index: 9000;
  display: flex; align-items: center; gap: 8px;
  background: rgba(13, 20, 33, 0.9); color: #e8edf6; border: 1px solid rgba(120, 150, 200, 0.3);
  padding: 6px 10px; border-radius: 10px; font: 12px/1 -apple-system, "Segoe UI", Roboto, sans-serif;
}
.ca-btn-sm {
  appearance: none; cursor: pointer; font: inherit; font-weight: 600;
  border: 1px solid rgba(120, 150, 200, 0.4); background: transparent; color: inherit;
  padding: 4px 8px; border-radius: 6px;
}
.ca-btn-sm:hover { background: rgba(120, 150, 200, 0.18); }
@media (prefers-reduced-motion: reduce) { .ca-btn { transition: none; } }
