/* ============================================================
   ZVERA - Deployment Blueprint
   A drafting-table UI: blueprint-blue canvas, fine grid,
   technical linework, monospace annotation, title block.
   ============================================================ */

.bp-overlay {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 3vh, 2rem) clamp(0.75rem, 4vw, 2rem);
  background: rgba(2, 6, 14, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-out-expo), visibility 0.4s var(--ease-out-expo);
}
.bp-overlay.is-open { opacity: 1; visibility: visible; }

.bp-sheet {
  --bp-ink: #bcdcff;
  --bp-ink-dim: rgba(188, 220, 255, 0.55);
  --bp-line: rgba(150, 200, 255, 0.32);
  position: relative;
  width: min(1000px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 6px;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  color: var(--bp-ink);
  font-family: 'Montserrat', system-ui, sans-serif;
  background-color: #062544;
  background-image:
    linear-gradient(rgba(150, 200, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 200, 255, 0.09) 1px, transparent 1px),
    linear-gradient(rgba(150, 200, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 200, 255, 0.045) 1px, transparent 1px),
    linear-gradient(160deg, #073059, #04182e 70%);
  background-size: 96px 96px, 96px 96px, 16px 16px, 16px 16px, 100% 100%;
  border: 1px solid rgba(150, 200, 255, 0.28);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7), inset 0 0 120px rgba(4, 20, 40, 0.6);
  transform: translateY(20px) scale(0.985);
  transition: transform 0.5s var(--ease-out-expo);
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 200, 255, 0.4) transparent;
}
.bp-overlay.is-open .bp-sheet { transform: translateY(0) scale(1); }

/* Registration marks in each corner, like a real drawing */
.bp-sheet::before,
.bp-sheet::after {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  border: 1px solid var(--bp-line);
  pointer-events: none;
}
.bp-sheet::before { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.bp-sheet::after  { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }

.bp-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 3px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--bp-ink-dim);
  background: rgba(6, 30, 56, 0.7);
  border: 1px solid var(--bp-line);
  transition: color 0.3s, border-color 0.3s;
  z-index: 3;
}
.bp-close:hover { color: #fff; border-color: rgba(188, 220, 255, 0.7); }

/* ---- Header / title block ---- */
.bp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.9rem;
  margin-bottom: 1.6rem;
  border-bottom: 1px solid var(--bp-line);
}
.bp-mono {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bp-ink-dim);
}
.bp-head h2 {
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #eaf5ff;
}

/* ---- Question steps ---- */
.bp-step { display: none; }
.bp-step.is-active { display: block; animation: panelIn 0.45s var(--ease-out-expo); }

.bp-q {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 600;
  color: #eaf5ff;
  margin-bottom: 0.4rem;
}
.bp-hint { font-size: 0.86rem; color: var(--bp-ink-dim); margin-bottom: 1.5rem; line-height: 1.55; }

.bp-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.7rem;
}
.bp-opt {
  position: relative;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  padding: 1rem 1.1rem;
  border-radius: 3px;
  color: var(--bp-ink);
  background: rgba(8, 38, 68, 0.55);
  border: 1px solid var(--bp-line);
  transition: border-color 0.3s var(--ease-out-expo),
              background-color 0.3s var(--ease-out-expo),
              transform 0.3s var(--ease-out-expo);
}
.bp-opt:hover { border-color: rgba(188, 220, 255, 0.75); background: rgba(12, 52, 92, 0.7); transform: translateY(-2px); }
.bp-opt.is-sel {
  border-color: var(--plasma-edge);
  background: rgba(255, 149, 0, 0.12);
  box-shadow: inset 0 0 0 1px rgba(253, 214, 0, 0.35);
}
.bp-opt b { display: block; font-size: 0.95rem; font-weight: 600; color: #eaf5ff; margin-bottom: 0.2rem; }
.bp-opt span { font-size: 0.78rem; color: var(--bp-ink-dim); line-height: 1.4; }

.bp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--bp-line);
}
.bp-back {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bp-ink-dim);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0;
}
.bp-back:hover { color: #fff; }
.bp-progress { display: flex; gap: 0.4rem; }
.bp-progress i {
  width: 26px; height: 3px;
  background: rgba(150, 200, 255, 0.22);
  border-radius: 2px;
}
.bp-progress i.on { background: var(--plasma-edge); }

/* ---- Drafting stage ---- */
.bp-draft { display: none; }
.bp-draft.is-active { display: block; }

.bp-canvas { width: 100%; height: auto; display: block; }

/* Animated linework */
.bp-canvas .draw {
  stroke-dasharray: var(--len, 400);
  stroke-dashoffset: var(--len, 400);
  animation: bpDraw 0.9s var(--ease-out-expo) forwards;
}
.bp-canvas .fade { opacity: 0; animation: bpFade 0.5s ease forwards; }
@keyframes bpDraw { to { stroke-dashoffset: 0; } }
@keyframes bpFade { to { opacity: 1; } }

.bp-node rect { fill: rgba(8, 40, 74, 0.85); stroke: var(--plasma-edge); stroke-width: 1.2; }
.bp-node text.t { fill: #eaf5ff; font-size: 11px; font-weight: 600; }
.bp-node text.s { fill: rgba(188, 220, 255, 0.6); font-size: 8.5px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.bp-conn { stroke: rgba(253, 214, 0, 0.55); stroke-width: 1.1; fill: none; stroke-dasharray: 4 3; }
.bp-dim { stroke: rgba(188, 220, 255, 0.5); stroke-width: 0.8; }
.bp-dim-label { fill: rgba(188, 220, 255, 0.75); font-size: 8.5px; font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.08em; }
.bp-axis { stroke: rgba(150, 200, 255, 0.22); stroke-width: 0.7; }

/* ---- Spec output ---- */
.bp-spec {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(1rem, 3vw, 2rem);
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--bp-line);
}
.bp-spec h4 {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bp-ink-dim);
  margin-bottom: 0.8rem;
}
.bp-list { list-style: none; margin: 0; padding: 0; }
.bp-list li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: #eaf5ff;
  padding: 0.42rem 0;
  border-bottom: 1px dashed rgba(150, 200, 255, 0.18);
}
.bp-list li::before { content: '\25B8'; color: var(--plasma-edge); font-size: 0.75rem; }
.bp-impact { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.bp-impact .k b {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  background: linear-gradient(100deg, var(--plasma-mid), var(--plasma-edge));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.bp-impact .k span {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: var(--bp-ink-dim);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* Title block, bottom-right like an engineering drawing */
.bp-titleblock {
  margin-top: 1.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  border: 1px solid var(--bp-line);
}
.bp-titleblock div {
  padding: 0.6rem 0.75rem;
  border-right: 1px solid var(--bp-line);
}
.bp-titleblock div:last-child { border-right: 0; }
.bp-titleblock dt {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bp-ink-dim);
  margin-bottom: 0.25rem;
}
.bp-titleblock dd { margin: 0; font-size: 0.82rem; font-weight: 600; color: #eaf5ff; }

.bp-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}
.bp-note { font-size: 0.72rem; color: var(--bp-ink-dim); line-height: 1.5; margin-top: 0.9rem; }

@media (max-width: 720px) {
  .bp-spec { grid-template-columns: 1fr; }
  .bp-options { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .bp-canvas .draw { animation: none; stroke-dashoffset: 0; }
  .bp-canvas .fade { animation: none; opacity: 1; }
}
