/* ══════════════════════════════════════════════════════════════════
   AXON Data Room — styles (navy + mint brand)
   ══════════════════════════════════════════════════════════════════ */
:root {
  /* ---- Brand theme variables (per-viewer white-label) ----
     These carry the AXON defaults. When an investor has branding enabled,
     theme.js overrides --brand-* on :root (via setProperty) and the tokens
     below inherit the new values, re-theming the whole room. --brand-on-*
     are luminance-derived readable text colors, so brand surfaces always
     stay legible. */
  --brand-primary: #00d999;
  --brand-primary-strong: #00b381;
  --brand-primary-soft: rgba(0, 217, 153, 0.12);
  --brand-accent: #2f6fed;
  --brand-accent-soft: rgba(47, 111, 237, 0.12);
  --brand-on-primary: #0b1437; /* text on primary fills */
  --brand-on-accent: #ffffff;
  --brand-bg: #f6f7fb;
  --brand-surface: #ffffff;
  --brand-text: #0b1437;
  --brand-border: #e3e6ef;

  --navy: #0b1437;
  --navy-2: #141b3c;
  /* Mint tokens now flow from the brand primary, so existing rules that
     use --mint / --mint-soft automatically follow the active theme. */
  --mint: var(--brand-primary);
  --mint-soft: var(--brand-primary-soft);
  --ink: var(--brand-text);
  --muted: #5b6478;
  --line: var(--brand-border);
  --white: var(--brand-surface);
  --bg: var(--brand-bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

/* ---- Top bar (white, so the donut animation blends in) ---- */
.dr-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px;
  background: var(--white);
  color: var(--ink);
  border-bottom: 3px solid var(--brand-primary);
}
.dr-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: 0.02em; color: var(--ink);
}
.dr-brand .mint { color: var(--mint); }
/* Brand logo image (replaces the AXON mark when an investor is branded). */
.brand-logo-img { height: 44px; width: auto; max-width: 240px; display: block; object-fit: contain; }

/* Looping hero donut — animated GIF (not <video>) so it renders as an
   image with no play-button overlay in any browser or power mode. Full
   uncropped frame so the whole particle flow shows (mirrors the main
   site). On a white background, mix-blend-multiply drops the white so
   it floats on the header with no visible box. */
.dr-brand-anim {
  height: 52px;
  width: auto;
  display: block;
  flex-shrink: 0;
  mix-blend-mode: multiply;
  pointer-events: none; /* decorative */
}

.dr-topbar .dr-user { font-size: 13px; color: var(--muted); display: flex; gap: 14px; align-items: center; }
.dr-topbar button {
  background: transparent; border: 1px solid var(--line);
  color: var(--ink); padding: 6px 12px; border-radius: 8px; cursor: pointer;
  font-size: 13px;
}
.dr-topbar button:hover { border-color: var(--mint); color: #0a7f5c; }

/* ---- Layout ---- */
.dr-wrap { max-width: 1100px; margin: 0 auto; padding: 28px 24px; }
.dr-center { max-width: 460px; margin: 60px auto; padding: 0 24px; }

.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 14px; padding: 28px;
  box-shadow: 0 2px 8px rgba(11,20,55,0.05);
}

h1 { font-size: 24px; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }

/* "or" divider between the two equal-weight login options (email link vs
   access code) — same visual weight matters here since a code-only
   investor must not have to notice a small text link to find their way in. */
.login-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--muted); font-size: 13px;
}
.login-divider::before, .login-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

/* ---- Forms / buttons ---- */
input[type=email], input[type=text], input[type=date], select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 15px; margin-bottom: 12px; background: var(--white);
}
/* Scoped to :not([class*="btn--"]) so this legacy rule doesn't clobber the
   design-system's .btn--primary/.btn--secondary/etc (workspace.js and admin.js
   share those with room.js's legacy investor-room buttons). */
.btn:not([class*="btn--"]) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand-primary); color: var(--brand-on-primary); font-weight: 600;
  border: 0; border-radius: 9px; padding: 11px 18px; cursor: pointer; font-size: 15px;
}
.btn:not([class*="btn--"]):hover { filter: brightness(1.05); }
.btn.secondary:not([class*="btn--"]) { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn.danger:not([class*="btn--"]) { background: #ffe5e5; color: #b30000; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Folder tree / files ---- */
.folder { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; background: var(--white); }
.folder-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  cursor: pointer; font-weight: 600; background: var(--white);
}
.folder-head:hover { background: var(--mint-soft); }
.folder-head .count { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 13px; }
.file-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 18px 11px 42px;
  border-top: 1px solid var(--line); font-size: 14px;
}
.file-row .name { flex: 1; }
.file-row .status { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: var(--mint-soft); color: #0a7f5c; }
.tag.pending { background: #fff3d6; color: #8a6d00; }
.tag.missing { background: #ffe5e5; color: #b30000; }

/* ---- Banners ---- */
.banner {
  padding: 12px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 18px;
  border: 1px solid var(--line);
}
.banner.warn { background: #fff8e6; border-color: #f0dca0; color: #7a5c00; }
/* Info banner picks up the brand accent so branded rooms feel themed. */
.banner.info {
  background: var(--brand-accent-soft, #eef6ff);
  border-color: var(--brand-accent, #cfe3ff);
  color: var(--brand-text, #234a86);
}
/* Section heading accent underline (brand primary). */
.dr-wrap > h1 { border-bottom: 2px solid var(--brand-primary); padding-bottom: 8px; display: inline-block; }

/* ---- NDA gate ---- */
.nda-text {
  max-height: 320px; overflow-y: auto; border: 1px solid var(--line);
  border-radius: 10px; padding: 16px; font-size: 13.5px; color: var(--ink);
  background: #fafbff; margin-bottom: 16px; white-space: pre-wrap;
}
.nda-check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; font-size: 14px; }

/* ---- Admin table ---- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.muted { color: var(--muted); }
.right { text-align: right; }

/* SignWell embedded signer injects a full-screen fixed wrapper with no
   z-index. These are element IDs (not classes) — target with `#`. Lift
   ONLY the outer wrapper (as its own stacking context) so it sits above
   the document viewer (z-index 50); SignWell's internal layering then
   works inside it. Flattening every child to one z-index makes the dark
   overlay paint over the editor. */
#SignWell-Modal-Embedded {
  z-index: 2147483000 !important;
  isolation: isolate;
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
}
#SignWell-Modal-Embedded-Overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
}

/* ---- Viewer ---- */
.viewer-overlay {
  position: fixed; inset: 0; background: rgba(11,20,55,0.9);
  display: none; align-items: stretch; justify-content: stretch; z-index: 50;
}
.viewer-overlay.open { display: flex; }
/* Near-fullscreen document viewer — reads online, drives page/time
   telemetry. Full-bleed on smaller screens; a max width with margins on
   very large screens so lines don't get uncomfortably wide. */
.viewer-frame {
  width: 100%; height: 100%; background: var(--white);
  border-radius: 0; overflow: hidden; display: flex; flex-direction: column;
}
@media (min-width: 1400px) {
  .viewer-overlay { padding: 24px; }
  .viewer-frame { width: min(1500px, 100%); margin: 0 auto; border-radius: 12px; }
}
.viewer-frame header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 10px 16px; background: var(--navy); color: var(--white);
}
.viewer-frame header #viewerTitle {
  color: rgba(255,255,255,0.9); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
/* High-contrast buttons on the navy header */
.viewer-frame header .btn {
  background: var(--brand-primary); color: var(--brand-on-primary); border: 0; font-weight: 600;
}
.viewer-frame header .btn:hover { filter: brightness(1.06); }
.viewer-frame header .btn.secondary {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.5);
}
.viewer-frame header .btn.secondary:hover {
  background: rgba(255,255,255,0.12); border-color: #fff;
}
.viewer-frame iframe { flex: 1; border: 0; width: 100%; }
.viewer-frame iframe[hidden] { display: none; }

/* PDF.js multi-page scroll container */
.viewer-pages { flex: 1; overflow-y: auto; background: #525659; padding: 20px 0; }
.viewer-pages[hidden] { display: none; }
.viewer-loading {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: #525659; color: #eee; font-size: 14px; gap: 10px;
}
.viewer-loading[hidden] { display: none; }
.viewer-loading::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
  animation: viewer-spin 0.8s linear infinite;
}
@keyframes viewer-spin { to { transform: rotate(360deg); } }
.pdf-page { max-width: 1100px; margin: 0 auto 16px; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.35); border-radius: 2px; overflow: hidden; min-height: 40px; }
.pdf-page canvas { display: block; width: 100%; height: auto; }
.pdf-page-fail { padding: 40px; text-align: center; color: #999; font-size: 13px; }

/* ---- No-access / expired state (deliberately alerting) ---- */
.na-card { text-align: center; padding: 36px 28px; }
.na-icon {
  width: 68px; height: 68px; margin: 0 auto 18px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fdeaea; color: #c02b2b;
}
.na-icon svg { width: 34px; height: 34px; }
.na-card.is-warning .na-icon { background: #fef6e7; color: #b7791f; }
.na-card.is-info .na-icon { background: #eaf1ff; color: #2f6fed; }
.na-card h1 { font-size: 24px; margin: 0 0 10px; letter-spacing: -0.01em; }
.na-card .sub { margin: 0 0 18px; }
.na-detail {
  background: #fdeaea; color: #8c1f1f; border: 1px solid #f3c9c9;
  border-radius: 10px; padding: 12px 14px; font-size: 13.5px;
  margin: 0 0 18px; text-align: left; line-height: 1.5;
}
.na-card.is-warning .na-detail { background: #fef6e7; color: #7a5c00; border-color: #f0dca0; }
.na-card.is-info .na-detail { background: #eaf1ff; color: #234a86; border-color: #cfe3ff; }
.na-detail strong { display: block; margin-bottom: 2px; }

.hidden { display: none !important; }
.small { font-size: 12.5px; }
.spacer { height: 20px; }

/* ---- NDA sign gate ---- */
.nda-gate { margin: 8px 0 16px; }
.nda-doc-chip {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  background: var(--brand-surface, #fff);
}
.nda-doc-ico { font-size: 22px; }
.nda-doc-name { font-weight: 600; color: var(--brand-text, var(--ink)); }

/* ─────────────────────── BRANDED LOADER ─────────────────────────────
   Same pulsing-wordmark-in-spinning-ring loader as axon.inc, adapted
   for the data room: pairs the mark with a line about what's on the
   other side of the gate, rather than a generic "loading" message. */
.axon-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--brand-bg, #fff);
  opacity: 1;
  transition: opacity 500ms ease;
}
.axon-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.axon-loader-mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 132px;
  height: 132px;
}
.axon-loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(0, 217, 153, 0.16);
  border-top-color: var(--mint);
  animation: axon-spin 0.9s linear infinite;
}
.axon-loader-logo {
  width: 96px;
  height: auto;
  animation: axon-pulse 1.6s ease-in-out infinite;
}
.axon-loader-caption {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  max-width: 320px;
  line-height: 1.5;
}
@keyframes axon-spin {
  to { transform: rotate(360deg); }
}
@keyframes axon-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.97); }
  50%      { opacity: 1;    transform: scale(1.03); }
}
@media (prefers-reduced-motion: reduce) {
  .axon-loader-ring { animation-duration: 1.8s; }
  .axon-loader-logo { animation: none; opacity: 1; }
}
