/* Forttic lead magnet popup + inline capture — responsive */

.lm-lock {
  overflow: hidden;
  touch-action: none;
}

.lm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  background: rgba(14, 22, 34, 0.78);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  overscroll-behavior: contain;
}
.lm-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lm-modal {
  position: relative;
  width: min(460px, 100%);
  max-height: min(92dvh, 720px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #0E1622;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 28px 26px 24px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 24px 64px rgba(14, 22, 34, 0.55);
  transform: translateY(10px);
  transition: transform 0.2s ease;
  isolation: isolate;
}
.lm-overlay.is-open .lm-modal { transform: translateY(0); }

.lm-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: #1B2533;
  color: #A8B0BD;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  touch-action: manipulation;
}
.lm-close:hover,
.lm-close:focus-visible {
  background: #243041;
  color: #fff;
  outline: none;
}
.lm-close:focus-visible {
  box-shadow: 0 0 0 3px rgba(1, 183, 134, 0.35);
}

.lm-badge {
  display: inline-flex;
  align-items: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #084F47;
  background: #CFE7E3;
  border: 1px solid rgba(15, 139, 126, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
  margin: 0 48px 12px 0;
}
.lm-badge--inline { margin: 0 0 10px; }

.lm-title {
  font-family: "Bricolage Grotesque", ui-serif, Georgia, serif;
  font-size: clamp(1.2rem, 2.5vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: #ffffff;
  margin: 0 0 10px;
  padding-right: 8px;
  clear: both;
}
.lm-blurb {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #B8C0CE;
  margin: 0 0 18px;
}

.lm-form { margin: 0; }
.lm-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94A3B8;
  margin-bottom: 7px;
}
.lm-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.lm-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 1px solid #2E3A4E;
  background: #0B1018;
  color: #ffffff;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px; /* prevents iOS zoom */
  font-family: inherit;
  line-height: 1.3;
  -webkit-appearance: none;
  appearance: none;
}
.lm-input::placeholder { color: #64748B; }
.lm-input:focus {
  outline: none;
  border-color: #01B786;
  box-shadow: 0 0 0 3px rgba(1, 183, 134, 0.28);
  background: #101722;
}
.lm-btn {
  border: 0;
  border-radius: 10px;
  background: #01B786;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 0 16px;
  min-height: 46px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(1, 183, 134, 0.28);
  touch-action: manipulation;
  flex-shrink: 0;
}
.lm-btn:hover { background: #019A72; }
.lm-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(1, 183, 134, 0.45);
}
.lm-btn:disabled { opacity: 0.7; cursor: wait; }
.lm-status {
  min-height: 18px;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #94A3B8;
}
.lm-status--error { color: #F87171; }
.lm-status--ok { color: #34D399; }
.lm-status a { color: #01B786; }
.lm-note {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: #7B869C;
}

/* Light-theme inline form on landing / blog */
.lm-capture--light .lm-badge {
  color: #084F47;
  background: #CFE7E3;
}
.lm-capture--light .lm-title { color: #0E1622; }
.lm-capture--light .lm-blurb { color: #4A5466; }
.lm-capture--light .lm-label { color: #4A5466; }
.lm-capture--light .lm-input {
  border: 1px solid #D7CFC0;
  background: #FFFFFF;
  color: #0E1622;
}
.lm-capture--light .lm-input:focus {
  border-color: #0F8B7E;
  box-shadow: 0 0 0 3px rgba(15, 139, 126, 0.18);
  background: #FFFFFF;
}
.lm-capture--light .lm-note { color: #6B7380; }
.lm-capture--light .lm-status { color: #4A5466; }

.lm-inline-cta {
  display: grid;
  gap: 14px;
  padding: 18px 0 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(14, 22, 34, 0.08);
}
.lm-inline-copy {
  display: grid;
  gap: 6px;
}
.lm-inline-copy strong {
  font-family: "Bricolage Grotesque", ui-serif, Georgia, serif;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.lm-inline-copy span {
  font-size: 0.92rem;
  color: #4A5466;
  line-height: 1.5;
}

.sidebar-card--lead-magnet {
  background: #FFFFFF;
  border: 1px solid #E8DFD0;
  border-radius: 14px;
  padding: 16px;
  margin: 16px 0;
}
.sidebar-card--lead-magnet h4 {
  font-family: "Bricolage Grotesque", ui-serif, Georgia, serif;
  font-size: 1.05rem;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.sidebar-card--lead-magnet > p {
  font-size: 0.9rem;
  color: #4A5466;
  line-height: 1.5;
  margin: 0 0 12px;
}
.sidebar-card--lead-magnet .lm-row {
  flex-direction: column;
}
.sidebar-card--lead-magnet .lm-btn {
  width: 100%;
  padding: 12px 14px;
}

/* —— Tablet —— */
@media (max-width: 900px) {
  .lm-overlay {
    align-items: center;
    padding:
      max(20px, env(safe-area-inset-top))
      max(20px, env(safe-area-inset-right))
      max(20px, env(safe-area-inset-bottom))
      max(20px, env(safe-area-inset-left));
  }
  .lm-modal {
    width: min(480px, 100%);
    padding: 26px 24px 22px;
  }
  .lm-inline-cta {
    grid-template-columns: 1fr;
  }
}

/* —— Mobile / small phones —— */
@media (max-width: 640px) {
  .lm-overlay {
    align-items: flex-end;
    padding:
      max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }
  .lm-modal {
    width: 100%;
    max-height: min(88dvh, 100%);
    border-radius: 18px 18px 14px 14px;
    padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
    transform: translateY(16px);
  }
  .lm-overlay.is-open .lm-modal { transform: translateY(0); }
  .lm-close {
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
  }
  .lm-badge { margin-right: 52px; }
  .lm-title {
    font-size: 1.25rem;
    margin-bottom: 8px;
  }
  .lm-blurb {
    font-size: 0.92rem;
    margin-bottom: 16px;
  }
  .lm-row {
    flex-direction: column;
    gap: 10px;
  }
  .lm-btn {
    width: 100%;
    min-height: 48px;
    padding: 14px 16px;
    font-size: 15px;
  }
  .lm-note { font-size: 12px; }
}

/* Very small screens */
@media (max-width: 380px) {
  .lm-modal { padding: 18px 14px calc(16px + env(safe-area-inset-bottom)); }
  .lm-title { font-size: 1.15rem; }
}

/* Short landscape / keyboard open */
@media (max-height: 520px) {
  .lm-overlay {
    align-items: flex-start;
    padding-top: max(8px, env(safe-area-inset-top));
  }
  .lm-modal {
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .lm-overlay,
  .lm-modal {
    transition: none;
  }
}

/* Large desktop */
@media (min-width: 1200px) {
  .lm-modal {
    width: min(480px, 100%);
    padding: 30px 28px 26px;
  }
  .lm-title { font-size: 1.45rem; }
}
