/* BAMS PDF Viewer v2 – document reader */

.bpv {
  --bpv-brand: var(--as-brand, #0b6b52);
  --bpv-brand-700: var(--as-brand-700, #064433);
  --bpv-brand-50: var(--as-brand-50, #e7f4ef);
  --bpv-accent: var(--as-accent, #f2a516);
  --bpv-ink: var(--as-ink, #0f1f1a);
  --bpv-ink-2: var(--as-ink-2, #34443e);
  --bpv-muted: var(--as-muted, #66756f);
  --bpv-line: var(--as-line, #e3e9e6);
  --bpv-bg: var(--as-bg, #f6f8f7);
  --bpv-font: var(--as-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  position: relative;
  margin: 0 0 24px;
  border: 1px solid var(--bpv-line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  font-family: var(--bpv-font);
  color: var(--bpv-ink-2);
}
.bpv *, .bams-modal * { box-sizing: border-box; }
.bpv [hidden], .bams-modal[hidden] { display: none !important; }

/* Toolbar */
.bpv-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--bpv-line); background: #fff;
}
.bpv-bar__left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bpv-bar__right { display: flex; align-items: center; gap: 6px; flex: none; }
.bpv-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px;
  background: #fde8e8; color: #b42318; font-size: 12px; font-weight: 700; letter-spacing: .04em;
}
.bpv-status { font-size: 13.5px; color: var(--bpv-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bpv-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--bpv-line); background: #fff; cursor: pointer;
  font: 600 14px/1 var(--bpv-font); color: var(--bpv-ink-2); transition: background .15s, border-color .15s, color .15s;
}
.bpv-btn:hover:not(:disabled) { border-color: var(--bpv-brand); color: var(--bpv-brand); }
.bpv-btn:disabled { opacity: .45; cursor: not-allowed; }
.bpv-btn--accent { background: var(--bpv-accent); border-color: var(--bpv-accent); color: #2a1c00; }
.bpv-btn--accent:hover:not(:disabled) { background: var(--as-accent-600, #d98e05); border-color: var(--as-accent-600, #d98e05); color: #2a1c00; }

.bpv-share { position: relative; }
.bpv-share__menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 170px; padding: 6px;
  background: #fff; border: 1px solid var(--bpv-line); border-radius: 12px; box-shadow: 0 14px 34px rgba(15, 31, 26, .14);
}
.bpv-share__menu button {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-radius: 8px;
  background: transparent; font: 500 14px var(--bpv-font); color: var(--bpv-ink-2); cursor: pointer;
}
.bpv-share__menu button:hover { background: var(--bpv-bg); color: var(--bpv-brand); }

/* Stage: where the document is read */
.bpv-stage {
  position: relative; height: min(82vh, 980px); min-height: 520px;
  background: #e9eeec;
  background-image: radial-gradient(rgba(15, 31, 26, .06) 1px, transparent 1px);
  background-size: 16px 16px;
  overflow: hidden;
}
.bpv-stage:fullscreen { height: 100vh; min-height: 0; }
.bpv-stage:-webkit-full-screen { height: 100vh; }
.bpv-stage__preview {
  position: absolute; left: 50%; top: 28px; transform: translateX(-50%);
  width: min(640px, 86%); height: auto; aspect-ratio: 400 / 520; object-fit: cover; object-position: top;
  border-radius: 4px; background: #fff;
  box-shadow: 0 2px 4px rgba(15, 31, 26, .08), 0 18px 40px rgba(15, 31, 26, .16);
  filter: blur(1.5px) saturate(.9); opacity: .9;
}
.bpv .bams-iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #fff;
}

/* Promo gate over the preview */
.bpv-gate {
  position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(180deg, rgba(233, 238, 236, .35), rgba(15, 31, 26, .45));
  transition: opacity .35s ease;
}
.bpv-gate.is-leaving { opacity: 0; }
.bpv-gate__card {
  width: min(460px, 100%); max-height: 100%; overflow: auto; background: #fff; border-radius: 18px; padding: 14px;
  box-shadow: 0 24px 60px rgba(15, 31, 26, .28);
}
.bpv-gate__fallback { text-align: center; margin-bottom: 4px; }
.bpv-gate__fallback img { max-width: 100%; height: auto; border-radius: 10px; }
.bpv-gate__fallback a { color: var(--bpv-brand); font-weight: 600; }

.bpv .bams-promo-slot { position: relative; border-radius: 12px; overflow: hidden; background: #0f1f1a; margin: 0 0 4px; }
.bpv .bams-promo-slot img, .bpv .bams-promo-slot video { display: block; width: 100%; height: auto; max-height: 52vh; object-fit: contain; background: #0f1f1a; }
.bpv .bams-promo-media { display: block; }
.bpv .bams-promo-tag { position: absolute; top: 8px; left: 8px; z-index: 2; padding: 2px 8px; border-radius: 5px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.bpv .bams-promo-unmute { position: absolute; top: 8px; right: 8px; z-index: 2; border: 0; border-radius: 999px; padding: 5px 11px; background: rgba(0, 0, 0, .6); color: #fff; font: 500 13px var(--bpv-font); cursor: pointer; }
.bpv .bams-promo-cta { display: block; padding: 12px 14px; text-align: center; background: var(--bpv-brand); color: #fff !important; font-weight: 700; text-decoration: none !important; }
.bpv .bams-promo-cta:hover { background: var(--bpv-brand-700); }

.bpv-gate__timer { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 6px 4px; }
.bpv-ring { flex: none; transform: rotate(-90deg); }
.bpv-ring__bg { fill: none; stroke: var(--bpv-line); stroke-width: 4; }
.bpv-ring__fg { fill: none; stroke: var(--bpv-brand); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.bpv-ring__num { position: absolute; left: 6px; width: 44px; text-align: center; font: 700 15px var(--bpv-font); color: var(--bpv-ink); }
.bpv .bams-countdown-text { font-size: 14.5px; color: var(--bpv-ink-2); line-height: 1.4; }
.bpv .bams-countdown-text strong { color: var(--bpv-ink); }
.bpv .bams-gate-retry { margin-left: 6px; padding: 6px 14px; border: 0; border-radius: 999px; background: var(--bpv-brand); color: #fff; font: 600 13px var(--bpv-font); cursor: pointer; }

.bpv-note { padding: 10px 16px; border-top: 1px solid var(--bpv-line); background: var(--bpv-brand-50); font-size: 14px; text-align: center; }
.bpv-note a { color: var(--bpv-brand-700) !important; font-weight: 600; }
.bpv-note p { margin: 0; }

/* Premium modal */
html.bpv-lock { overflow: hidden; }
.bams-modal {
  position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(15, 31, 26, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  font-family: var(--as-font, system-ui, sans-serif);
}
.bams-modal-content { position: relative; width: min(440px, 100%); background: #fff; border-radius: 20px; padding: 26px 24px 22px; box-shadow: 0 30px 70px rgba(0, 0, 0, .3); }
.bams-modal-close { position: absolute; right: 12px; top: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--as-bg, #f6f8f7); font-size: 22px; line-height: 1; color: var(--as-ink-2, #34443e); cursor: pointer; }
.bams-modal-eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--as-accent-600, #d98e05); }
.bams-modal-title { margin: 0 0 12px; font: 800 1.3rem/1.25 var(--as-font-head, inherit); color: var(--as-ink, #0f1f1a); }
.bams-modal-benefits { margin: 0 0 16px; padding: 0 0 0 18px; color: var(--as-ink-2, #34443e); font-size: 14.5px; line-height: 1.7; }
.bams-prof-options { display: grid; gap: 8px; margin-bottom: 16px; }
.bams-prof-option {
  padding: 13px 14px; text-align: left; border: 1.5px solid var(--as-line, #e3e9e6); border-radius: 12px; background: #fff;
  font: 600 15px var(--as-font, inherit); color: var(--as-ink, #0f1f1a); cursor: pointer; transition: border-color .15s, background .15s;
}
.bams-prof-option:hover { border-color: var(--as-brand-100, #cfe9df); }
.bams-prof-option.is-selected { border-color: var(--as-brand, #0b6b52); background: var(--as-brand-50, #e7f4ef); }
.bams-modal-submit {
  width: 100%; height: 48px; border: 0; border-radius: 999px; background: var(--as-brand, #0b6b52); color: #fff;
  font: 700 15px var(--as-font, inherit); cursor: pointer;
}
.bams-modal-submit:disabled { opacity: .45; cursor: not-allowed; }

/* Phones */
@media (max-width: 640px) {
  .bpv { border-radius: 14px; margin-left: -4px; margin-right: -4px; }
  .bpv-bar { padding: 8px 8px 8px 12px; }
  .bpv-status { display: none; }
  .bpv-btn { height: 36px; padding: 0 11px; }
  .bpv-btn span { display: none; }
  .bpv-btn--accent span { display: inline; }
  .bpv-stage { height: 78vh; min-height: 460px; }
  .bpv-gate { padding: 12px; align-items: flex-end; }
  .bpv-gate__card { padding: 10px; border-radius: 16px; }
  .bpv .bams-promo-slot img, .bpv .bams-promo-slot video { max-height: 46vh; }
}
