/* =============================================================
   BAA modal viewer + standalone /baa page typography
   ============================================================= */

/* ---------- Modal shell ---------- */

.baa-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  animation: baa-fade 0.18s ease;
}
.baa-modal[hidden] { display: none; }
@keyframes baa-fade { from { opacity: 0; } to { opacity: 1; } }

.baa-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(11, 19, 32, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.baa-modal-shell {
  position: relative;
  width: 100%;
  max-width: 860px;
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 22px;
  box-shadow:
    0 50px 120px -30px rgba(11, 19, 32, 0.45),
    0 8px 24px -10px rgba(11, 19, 32, 0.18);
  animation: baa-pop 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
  overflow: hidden;
}
@keyframes baa-pop {
  from { transform: translateY(12px) scale(0.985); opacity: 0; }
  to   { transform: translateY(0)    scale(1);     opacity: 1; }
}

.baa-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, var(--surface-subtle));
}
.baa-modal-eyebrow {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--teal-wash);
  color: var(--teal-deep);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.baa-modal-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.baa-modal-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.baa-modal-close {
  width: 32px; height: 32px;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 22px;
  line-height: 1;
  border-radius: 8px;
  cursor: pointer;
}
.baa-modal-close:hover { background: var(--surface-muted); color: var(--text); }

.baa-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 22px 30px 6px;
  /* Smooth inertial scroll on iOS */
  -webkit-overflow-scrolling: touch;
}

.baa-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
  flex-wrap: wrap;
}
.baa-modal-footer-note {
  font-size: 12px;
  color: var(--text-soft);
  flex: 1;
  min-width: 0;
}
.baa-modal-footer-note a {
  color: var(--teal-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Shimmering skeleton placeholders */
.baa-skel {
  background: linear-gradient(90deg, var(--surface-subtle) 0%, var(--surface-muted) 50%, var(--surface-subtle) 100%);
  background-size: 200% 100%;
  animation: baa-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes baa-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.baa-fallback {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-muted);
  font-size: 14px;
}
.baa-fallback a { color: var(--teal-deep); text-decoration: underline; }


/* ---------- BAA document typography (used in modal + on /baa) ---------- */

.baa-doc {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text);
  max-width: 760px;
  margin: 0 auto;
}
.baa-doc-header { margin: 0 0 28px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.baa-doc-header h1 {
  margin: 0 0 6px;
  font-size: 28px; line-height: 1.2;
  font-weight: 700; letter-spacing: -0.02em;
}
.baa-doc-sub { margin: 0 0 10px; font-size: 14px; color: var(--text-muted); font-weight: 500; }
.baa-doc-meta { margin: 0; font-size: 12.5px; color: var(--text-soft); }

.baa-doc h2 {
  margin: 32px 0 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  scroll-margin-top: 16px;
}
.baa-doc h2:first-of-type { margin-top: 4px; }

.baa-doc p {
  margin: 0 0 14px;
}
.baa-doc strong { font-weight: 600; }

.baa-doc ul {
  margin: 0 0 16px;
  padding-left: 22px;
}
.baa-doc li {
  margin: 4px 0;
}

/* Signature block */
.baa-sig {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin: 40px 0 8px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
@media (max-width: 600px) {
  .baa-sig { grid-template-columns: 1fr; gap: 24px; }
}
.baa-sig-block {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-subtle);
}
.baa-sig-label {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-deep);
  font-weight: 700;
  margin-bottom: 6px;
}
.baa-sig-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 14px;
}
.baa-sig-line {
  font-size: 13px;
  color: var(--text-muted);
  margin: 6px 0;
}
.baa-sig-fill {
  display: inline-block;
  min-width: 160px;
  border-bottom: 1px solid var(--border);
  margin-left: 4px;
  height: 14px;
}


/* ---------- /baa standalone page wrapper ---------- */

.baa-page { padding: 4px 0 24px; }


/* ---------- Modal responsive ---------- */

@media (max-width: 640px) {
  .baa-modal { padding: 12px; }
  .baa-modal-shell { border-radius: 16px; max-height: calc(100vh - 24px); }
  .baa-modal-header { padding: 16px 18px 12px; }
  .baa-modal-body { padding: 16px 18px 6px; }
  .baa-modal-footer { padding: 10px 18px; flex-direction: column; align-items: stretch; }
  .baa-modal-actions { width: 100%; }
}


/* ---------- Print styles ---------- */

@media print {
  /* Hide everything but the BAA content when printing */
  body * { visibility: hidden; }
  .baa-page, .baa-page *,
  .baa-modal-body, .baa-modal-body * {
    visibility: visible;
  }
  .baa-page, .baa-modal-body { position: absolute; left: 0; top: 0; width: 100%; padding: 0; }
  .baa-modal, .baa-modal-shell {
    position: static !important;
    box-shadow: none !important;
    background: none !important;
    max-height: none !important;
    width: 100% !important;
    max-width: none !important;
    overflow: visible !important;
  }
  .baa-modal-header, .baa-modal-footer, .baa-modal-backdrop { display: none !important; }
  .baa-doc { font-size: 11pt; line-height: 1.45; color: #000; }
  .baa-doc h1 { font-size: 18pt; }
  .baa-doc h2 { font-size: 13pt; margin-top: 18pt; }
  .baa-doc p, .baa-doc li { font-size: 11pt; }
  .baa-sig-block { background: none; border: 1px solid #999; }
  /* Hide chrome on print */
  nav, footer, .nav-shell, .site-footer, .scroll-wave { display: none !important; }
}
