/* Gated inventory — blur until lead form submitted */

body.inventory-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

html.inventory-locked {
  overflow: hidden;
  overscroll-behavior: none;
  height: 100%;
}

.inventory-gated-wrap {
  position: relative;
  transition: filter 0.4s ease, opacity 0.4s ease;
}

body.inventory-locked .inventory-gated-wrap {
  filter: blur(7px) saturate(0.9);
  opacity: 0.72;
  pointer-events: none;
  user-select: none;
  transform: scale(1);
  transform-origin: center top;
}

body.inventory-unlocked .inventory-gated-wrap {
  filter: none;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

/* ── Overlay ── */
.inventory-gate {
  position: fixed;
  inset: 0;
  z-index: 8500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(12px + env(safe-area-inset-top, 0px))
    16px
    calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(165deg, rgba(8, 28, 62, 0.55) 0%, rgba(13, 76, 174, 0.5) 100%);
  overscroll-behavior: none;
}

.inventory-gate[hidden] {
  display: none !important;
}

/* ── Panel ── */
.inventory-gate-panel {
  width: min(100%, 360px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.12);
  text-align: center;
  animation: inventory-gate-in 0.35s ease;
  flex-shrink: 0;
}

@keyframes inventory-gate-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.inventory-gate-header {
  flex-shrink: 0;
  background: linear-gradient(135deg, #0a3a8a 0%, #0d4cae 100%);
  padding: 18px 18px 14px;
  color: #fff;
}

.inventory-gate-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.inventory-gate-logo {
  display: block;
  height: 28px;
  width: auto;
  margin: 0 auto 10px;
  filter: brightness(0) invert(1);
}

.inventory-gate-eyebrow {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber, #F0A500);
  margin: 0 0 8px;
}

.inventory-gate-panel h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(18px, 4.5vw, 22px);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin: 0 0 6px;
}

.inventory-gate-lead {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
  margin: 0;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.inventory-gate-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.inventory-gate-stat {
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff;
}

/* ── Body / form ── */
.inventory-gate-body {
  padding: 14px 16px 4px;
  text-align: left;
}

.inventory-gate-form label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--dark-section, #0d4cae);
  margin: 0 0 5px;
  letter-spacing: 0.02em;
}

.inventory-gate-form input,
.inventory-gate-form select,
.inventory-gate-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1.5px solid var(--divider, #E8E4DC);
  border-radius: 10px;
  padding: 0 12px;
  font: 500 14px 'Inter', sans-serif;
  color: var(--text-primary, #1a1a1a);
  background: #fff;
  margin-bottom: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

.inventory-gate-form input:focus,
.inventory-gate-form select:focus,
.inventory-gate-form textarea:focus {
  outline: none;
  border-color: var(--dark-section, #0d4cae);
  box-shadow: 0 0 0 3px rgba(13, 76, 174, 0.12);
}

.inventory-gate-form button[type="submit"],
.inventory-gate-submit {
  width: 100%;
  min-height: 46px;
  border: none;
  border-radius: 10px;
  background: #0057C2;
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s, transform 0.1s;
}

.inventory-gate-form button[type="submit"]:hover,
.inventory-gate-submit:hover {
  background: #004a9f;
}

/* ── Form shell: fixed height ONLY for GHL iframe embeds (:has(iframe)).
   Native HTML forms must never get a fixed height — see FORM_GATE_QA.md ── */
.inventory-gate-form-shell:has(iframe) {
  height: 280px;
  max-height: 280px;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid rgba(13, 76, 174, 0.08);
  overscroll-behavior: none;
}

.inventory-gate-form-shell--native,
.inventory-gate-form-shell:not(:has(iframe)) {
  height: auto;
  max-height: none;
  overflow: visible;
  background: transparent;
  border: none;
  padding: 0;
}

.inventory-gate-form-error {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(177, 30, 38, 0.08);
  border: 1px solid rgba(177, 30, 38, 0.2);
  color: #8A141B;
  font-size: 13px;
  font-weight: 600;
}

.inventory-gate-form-disclaimer {
  margin: 10px 0 0;
  font-size: 10px;
  line-height: 1.45;
  color: var(--text-secondary, #777);
  font-weight: 400;
  text-align: center;
}

.inventory-gate-form-disclaimer a {
  color: inherit;
  text-decoration: underline;
}

.inventory-gate-form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.inventory-gate-turnstile {
  margin: 4px 0 10px;
}

.inventory-gate-form-shell iframe {
  display: block;
  width: 100%;
  height: 280px;
  max-height: 280px;
  border: none;
  overflow: hidden;
}

.inventory-gate-thank {
  display: none;
  padding: 32px 16px;
  text-align: center;
}

.inventory-gate-thank.is-visible {
  display: block;
}

.inventory-gate-thank-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(21, 128, 61, 0.12);
  color: #15803d;
  font-size: 30px;
  line-height: 60px;
  margin: 0 auto 14px;
}

.inventory-gate-thank h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--dark-section, #0d4cae);
  margin: 0 0 6px;
}

.inventory-gate-thank p {
  font-size: 14px;
  color: var(--text-secondary, #5a6478);
  margin: 0;
}

/* ── Footer (inside panel) ── */
.inventory-gate-footer {
  flex-shrink: 0;
  padding: 0 16px 14px;
  text-align: center;
}

.inventory-gate-trust {
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-muted, #7a8499);
  margin: 0;
}

/* ── Unlocked banner ── */
.inventory-unlocked-banner {
  display: none;
  width: min(calc(100% - 32px), 980px);
  margin: 16px auto 0;
  padding: 12px 18px;
  background: rgba(21, 128, 61, 0.08);
  border: 1px solid rgba(21, 128, 61, 0.2);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #166534;
  text-align: center;
}

body.inventory-unlocked .inventory-unlocked-banner {
  display: block;
}

/* ── Demo pill (demo page only) ── */
.demo-pill {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(240, 165, 0, 0.95);
  color: #1a1200;
  padding: 8px 12px;
  border-radius: 999px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.demo-reset {
  padding: 4px 10px;
  border: 1.5px solid #1a1200;
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 640px) {
  .inventory-gate {
    align-items: center;
    justify-content: center;
    padding:
      calc(12px + env(safe-area-inset-top, 0px))
      14px
      calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .inventory-gate-panel {
    width: min(100%, 360px);
    border-radius: 18px;
    animation: inventory-gate-in 0.35s ease;
  }

  .inventory-gate-header {
    padding: 14px 14px 10px;
  }

  .inventory-gate-logo {
    height: 24px;
    margin-bottom: 8px;
  }

  .inventory-gate-stats {
    margin-top: 8px;
  }

  .inventory-gate-body,
  .inventory-gate-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .inventory-gate-body {
    padding-top: 10px;
    padding-bottom: 2px;
  }

  .inventory-gate-form label {
    font-size: 11px;
    margin-bottom: 3px;
  }

  .inventory-gate-form input,
  .inventory-gate-form select {
    min-height: 44px;
    margin-bottom: 8px;
    font-size: 16px;
  }

  .inventory-gate-form button[type="submit"],
  .inventory-gate-submit {
    min-height: 44px;
    font-size: 14px;
  }

  .inventory-gate-form-disclaimer {
    font-size: 10px;
    line-height: 1.4;
    margin-top: 8px;
  }

  .inventory-gate-form-shell:has(iframe),
  .inventory-gate-form-shell:has(iframe) iframe {
    height: 260px;
    max-height: 260px;
  }

  .inventory-gate-footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .inventory-gate-trust {
    font-size: 9px;
  }
}
