/* ============================================================
   BA Document Protection Module · v1.0
   Watermark overlay, copy/print/select blocking, confidentiality
   footer, viewer name field. Drop into any internal IP doc.
   ============================================================ */

/* --- Disable text selection everywhere except inputs --- */
body.protected {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
body.protected input,
body.protected textarea,
body.protected [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* --- Confidentiality bar (top, sticky) --- */
.confidential-bar {
  position: sticky;
  top: 0;
  z-index: 9000;
  background: #1A2756;
  color: #fff;
  padding: 8px 14px;
  font-family: 'Avenir Next', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  border-bottom: 2px solid #E07B3C;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.confidential-bar .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #E07B3C;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* --- Viewer gate (asks who is viewing before content loads) --- */
.viewer-gate {
  position: fixed;
  inset: 0;
  background: #1A2756;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: 'Avenir Next', -apple-system, BlinkMacSystemFont, sans-serif;
}
.viewer-gate.hidden { display: none; }
.viewer-gate-card {
  background: #fff;
  border-radius: 12px;
  padding: 36px 40px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  border-top: 6px solid #E07B3C;
}
.viewer-gate-card h2 {
  margin: 0 0 6px 0;
  font-family: 'Avenir Next', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: #1A2756;
  letter-spacing: -0.01em;
}
.viewer-gate-card .subhead {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #E07B3C;
  margin-bottom: 18px;
}
.viewer-gate-card p {
  font-size: 13px;
  line-height: 1.6;
  color: #5a667a;
  margin: 0 0 18px 0;
}
.viewer-gate-card label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1A2756;
  margin: 14px 0 6px 0;
}
.viewer-gate-card input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: 'Avenir Next', sans-serif;
  border: 1px solid #d6dce5;
  border-radius: 6px;
  box-sizing: border-box;
}
.viewer-gate-card input:focus {
  outline: none;
  border-color: #E07B3C;
  box-shadow: 0 0 0 3px rgba(224, 123, 60, 0.15);
}
.viewer-gate-card .acknowledge {
  display: flex;
  gap: 10px;
  margin: 16px 0 4px 0;
  font-size: 12px;
  line-height: 1.5;
  color: #1A2756;
  cursor: pointer;
}
.viewer-gate-card .acknowledge input {
  width: auto;
  margin-top: 2px;
  flex-shrink: 0;
}
.viewer-gate-card button {
  width: 100%;
  margin-top: 18px;
  padding: 14px 20px;
  background: #E07B3C;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: 'Avenir Next', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease;
}
.viewer-gate-card button:hover { background: #c46930; }
.viewer-gate-card button:disabled {
  background: #c5ccd6;
  cursor: not-allowed;
}

/* --- Diagonal watermark overlay --- */
.watermark-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8000;
  overflow: hidden;
  opacity: 0.08;
}
.watermark-text {
  position: absolute;
  white-space: nowrap;
  font-family: 'Avenir Next', sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #1A2756;
  transform: rotate(-30deg);
  transform-origin: center;
}

/* --- Per-page corner stamp --- */
.protection-stamp {
  position: fixed;
  bottom: 14px;
  right: 14px;
  z-index: 8500;
  background: rgba(26, 39, 86, 0.92);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  font-family: 'Avenir Next', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  max-width: 280px;
  line-height: 1.5;
  border-left: 3px solid #E07B3C;
}
.protection-stamp .label {
  color: #E07B3C;
  font-weight: 800;
  letter-spacing: 0.14em;
  display: block;
  font-size: 9px;
  margin-bottom: 2px;
}
.protection-stamp .viewer { font-size: 11px; letter-spacing: 0.04em; }
.protection-stamp .timestamp { opacity: 0.7; font-size: 9px; margin-top: 2px; }

/* --- Confidentiality footer (bottom of page content) --- */
.confidentiality-footer {
  margin-top: 40px;
  padding: 20px 24px;
  background: #1A2756;
  color: #fff;
  border-radius: 8px;
  font-family: 'Avenir Next', sans-serif;
  font-size: 11px;
  line-height: 1.65;
  border-left: 5px solid #E07B3C;
}
.confidentiality-footer .heading {
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #E07B3C;
  margin-bottom: 8px;
  font-size: 11px;
}
.confidentiality-footer p { margin: 6px 0; opacity: 0.92; }
.confidentiality-footer strong { color: #fff; font-weight: 700; }

/* --- Print blocking --- */
@media print {
  body.protected * { display: none !important; }
  body.protected::before {
    content: 'PRINTING DISABLED · Better Athlete confidential material. Contact Tomas Anthony for authorized distribution.';
    display: block !important;
    padding: 40px;
    font-family: 'Avenir Next', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: #1A2756;
    text-align: center;
  }
}

/* --- Mobile adjustments --- */
@media (max-width: 600px) {
  .confidential-bar { font-size: 9px; padding: 6px 10px; gap: 8px; }
  .protection-stamp { font-size: 9px; padding: 6px 10px; max-width: 200px; bottom: 8px; right: 8px; }
  .watermark-text { font-size: 18px; }
}
