/* === FMF Funnel Styles (v1.1.0) === */
:root{
  --fmf-green: #2596be;
  --fmf-bg: #ffffff;
  --fmf-text: #042c44;
  --fmf-shadow: 0 10px 30px rgba(0,0,0,.15);
  --fmf-z: 2147483647; /* MAX to top on desktop */
}

#fmf-funnel-bubble{
  position: fixed; right: 18px; bottom: 18px;
  width: 110px; height: 60px; border-radius: 999px;
  background: var(--fmf-green);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 14px;
  cursor: pointer; box-shadow: var(--fmf-shadow);
  z-index: var(--fmf-z);
  transition: transform .2s ease, box-shadow .2s ease;
  pointer-events: auto; user-select: none; isolation: isolate;
  font-family: 'Source Sans Pro', sans-serif;
}
#fmf-funnel-bubble:hover{ transform: translateY(-2px); }
#fmf-funnel-bubble img{ width: 36px; height: auto; pointer-events: none; }

/* Small label text inside bubble */
#fmf-funnel-bubble .fmf-bubble-text{
  position: absolute; bottom: 6px; left: 6px; right: 6px;
  font-size: 10px; line-height: 1.1; text-align: center;
  color:#ffffff; font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
  pointer-events: none;
}

#fmf-funnel-modal{ position: fixed; inset: 0; display: none; z-index: calc(var(--fmf-z) - 1); }
#fmf-funnel-modal.active{ display: block; }
#fmf-funnel-modal .fmf-funnel-backdrop{
  position: absolute; inset: 0; background: rgba(0,0,0,.45);
}
#fmf-funnel-modal .fmf-funnel-card{
  position: relative; width: min(560px, 92vw); max-height: 86vh; overflow: auto;
  margin: 8vh auto 0; background: var(--fmf-bg); color: var(--fmf-text);
  border-radius: 16px; box-shadow: var(--fmf-shadow); padding: 20px 20px 16px;
}
.fmf-close{
  position:absolute; top:10px; right:12px; border:0; background:transparent;
  font-size: 28px; line-height: 1; cursor:pointer; color:#444;
}
.fmf-step{ display:none; }
.fmf-step.active{ display:block; }
.fmf-steps h3{ margin:0 0 8px; font-size:22px; color:#059669; }
.fmf-steps p{ margin: 0 0 14px; }

.fmf-grid{
  display:grid; grid-template-columns: repeat(6,1fr); gap:10px; margin: 12px 0 6px;
}
.fmf-grid label{
  display:block; text-align:center; border:1px solid #e5e7eb; border-radius:10px; padding:10px 6px; cursor:pointer;
}
.fmf-grid input{ display:none; }
.fmf-grid input:checked + span{
  background: var(--fmf-green); color:#fff; border-radius: 8px; padding: 6px 10px; display:inline-block;
}
.fmf-fields{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0; }
.fmf-fields label{ display:flex; flex-direction:column; gap:6px; font-size:14px; }
.fmf-fields input{ height:42px; border:1px solid #e5e7eb; border-radius:10px; padding:0 12px; }
textarea#fmf-activities{
  width:100%; border:1px solid #e5e7eb; border-radius:10px; padding:10px 12px; resize:vertical;
}
.req{ color:#e11d48; }

.fmf-nav{ display:flex; justify-content: space-between; gap:10px; margin-top: 12px; }
.fmf-nav button{
  appearance:none; border:0; border-radius: 12px; padding: 12px 16px;
  font-weight:600; cursor:pointer; box-shadow: var(--fmf-shadow);
}
.fmf-prev{ background:#f3f4f6; }
.fmf-next, .fmf-submit{ background: var(--fmf-green); color:#fff; }

.fmf-small{ font-size:12px; color:#6b7280; margin-top: 6px; }
.fmf-status{ margin-top:10px; min-height: 22px; font-size: 14px; }

/* Ensure Divi content doesn't overlay */


@media (max-width: 980px){
  #fmf-funnel-bubble{ bottom: 51px; width: 120px; height: 60px; }
  #fmf-funnel-bubble .fmf-bubble-text{ font-size: 12px; }
}
  .fmf-grid{ grid-template-columns: repeat(3,1fr); }
  .fmf-fields{ grid-template-columns: 1fr; }
}

body, #fmf-funnel-modal, .fmf-step, .fmf-bubble-text { font-family: 'Source Sans Pro', sans-serif; }


#fmf-funnel-bubble img{
  width: 30px; height: 30px; object-fit: contain; display:block; pointer-events: none;
}
#fmf-funnel-bubble .fmf-bubble-text{
  position: static; /* no absolute; allow flex layout */
  color:#ffffff; font-weight:700; font-size:12px; line-height:1; white-space:nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
  pointer-events: none;
}
@media (max-width: 980px){
  #fmf-funnel-bubble{ bottom: 51px; width: 120px; height: 60px; }
  #fmf-funnel-bubble .fmf-bubble-text{ font-size: 12px; }
}
  #fmf-funnel-bubble .fmf-bubble-text{ font-size: 12px; }
}


/* Scoped z-index without touching theme containers */
#fmf-funnel-bubble, #fmf-funnel-modal { position: fixed !important; }
#fmf-funnel-bubble { z-index: 2147483647; }
#fmf-funnel-modal { z-index: 2147483646; }
