/* ============================================================
   GLP-1 hub lead-capture widget -- faithful to "Prototype Option B".
   Mobile: amber+green sticky bar. Desktop: floating pill.
   Both open a full-height eligibility sheet (6-step quiz).
   Palette and metrics replicate the design export exactly.
   All ids/classes are peglp- prefixed.
   ============================================================ */

#peglp-sticky, #peglp-fab, #peglp-modal { box-sizing: border-box; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
#peglp-sticky *, #peglp-fab *, #peglp-modal * { box-sizing: border-box; }

/* ---------- mobile sticky bar (<=860px) ---------- */
/* solid backdrop behind the floating card, so page content doesn't show through
   the margins/gap -- it reads as the body background, like the design */
#peglp-tray {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2147482999; pointer-events: none;
  height: calc(84px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(245,247,248,0) 0, #F5F7F8 22px);
}
#peglp-sticky {
  display: none; align-items: center; gap: 10px;
  position: fixed; left: 10px; right: 10px; bottom: calc(9px + env(safe-area-inset-bottom)); z-index: 2147483000;
  background: #008880; border: 0; border-radius: 18px;
  box-shadow: 0 8px 24px rgba(8,50,44,0.28); cursor: pointer;
  padding: 9px 10px 9px 14px;
}
#peglp-sticky .peglp-s-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
#peglp-sticky .peglp-s-q { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.82); line-height: 1.3; }
#peglp-sticky .peglp-s-main { display: flex; align-items: center; gap: 6px; line-height: 1.2; white-space: nowrap; }
#peglp-sticky .peglp-s-q, #peglp-sticky .peglp-s-cb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#peglp-sticky .peglp-s-free { color: #FFFFFF; font-size: 17px; font-weight: 800; }
#peglp-sticky .peglp-s-consult { font-size: 17px; font-weight: 800; color: #FFFFFF; }
#peglp-sticky .peglp-s-cb { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.82); line-height: 1.3; }
#peglp-sticky .peglp-bar-btn {
  flex: none; height: 42px; padding: 0 15px; border: 0; border-radius: 12px;
  background: #FFFFFF; color: #008880; font-size: 14px; font-weight: 800; font-family: inherit; cursor: pointer;
}

/* ---------- desktop floating pill (>860px) ---------- */
#peglp-fab {
  display: none;
  position: fixed; right: 24px; bottom: 24px; z-index: 2147483000;
  align-items: center; gap: 10px; cursor: pointer;
  background: #008880; color: #fff; border: 0; border-radius: 999px;
  padding: 13px 22px; font-family: inherit; font-size: 16px; font-weight: 800;
  box-shadow: 0 8px 24px rgba(0,136,128,0.30);
}
#peglp-fab:hover { background: #00736C; }
#peglp-fab .peglp-fab-dot { width: 9px; height: 9px; border-radius: 999px; background: #FFD966; flex: none; }
#peglp-fab .peglp-fab-sub { font-size: 11.5px; font-weight: 600; opacity: 0.85; }

/* ---------- modal + sheet ---------- */
#peglp-modal { display: none; position: fixed; inset: 0; z-index: 2147483600; align-items: flex-end; justify-content: center; font-family: inherit; }
#peglp-modal .peglp-backdrop { position: absolute; inset: 0; background: rgba(10,30,26,0.55); }
#peglp-sheet {
  position: relative; width: 100%; max-width: 440px; height: 92vh; max-height: 860px;
  background: #FFFFFF; border-radius: 24px 24px 0 0; box-shadow: 0 -8px 32px rgba(0,0,0,0.25);
  display: flex; flex-direction: column; overflow: hidden; color: #12302B;
  animation: peglpSheetUp .28s cubic-bezier(.22,.61,.36,1);
}
@keyframes peglpSheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes peglpFade { from { opacity: 0; } to { opacity: 1; } }

/* top: handle + header + progress */
#peglp-sheet .peglp-top { flex: none; padding: 10px 16px 0; display: flex; flex-direction: column; gap: 12px; }
#peglp-sheet .peglp-handle { width: 40px; height: 4px; border-radius: 2px; background: #CFD8D5; align-self: center; }
#peglp-sheet .peglp-head { display: flex; align-items: center; justify-content: space-between; height: 44px; }
#peglp-sheet .peglp-head-l { display: flex; align-items: center; gap: 8px; min-width: 0; }
#peglp-sheet .peglp-iconbtn { width: 44px; height: 44px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
#peglp-sheet .peglp-back { margin-left: -12px; }
#peglp-sheet .peglp-close { margin-right: -8px; }
#peglp-sheet .peglp-htitle { font-size: 15px; font-weight: 800; color: #12302B; }
#peglp-sheet .peglp-free { background: #FFD966; color: #4A3500; font-size: 11px; font-weight: 800; letter-spacing: 0.8px; padding: 3px 7px; border-radius: 6px; }
#peglp-sheet .peglp-progress { display: flex; flex-direction: column; gap: 6px; }
#peglp-sheet .peglp-segs { display: flex; gap: 4px; }
#peglp-sheet .peglp-seg { flex: 1; height: 5px; border-radius: 3px; background: #DCE8E4; }
#peglp-sheet .peglp-seg.on { background: #008880; }
#peglp-sheet .peglp-steptxt { font-size: 12px; font-weight: 700; color: #4A5E59; }

/* body */
#peglp-sheet .peglp-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 12px; }
#peglp-sheet .peglp-screen { display: flex; flex-direction: column; gap: 12px; animation: peglpFade .18s ease-out; }
#peglp-sheet .peglp-qhead { display: flex; flex-direction: column; gap: 6px; }
#peglp-sheet .peglp-q { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 800; color: #12302B; }
#peglp-sheet .peglp-qsub { font-size: 13.5px; line-height: 1.4; color: #5A6F6A; }
#peglp-sheet .peglp-qsub strong, #peglp-sheet .peglp-qsub .lead { color: #3C514C; font-weight: 400; }

/* answered edit chips (wrap so nothing gets cropped) */
#peglp-sheet .peglp-chiprow { display: flex; flex-wrap: wrap; gap: 8px; }
#peglp-sheet .peglp-echip { flex: 0 1 auto; max-width: 100%; min-width: 0; height: 36px; padding: 0 12px; border: 1px solid #CFE3DE; border-radius: 18px; background: #F3F9F7; color: #12302B; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; cursor: pointer; font-family: inherit; }
#peglp-sheet .peglp-echip .peglp-echip-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#peglp-sheet .peglp-echip svg { flex: none; }

/* option buttons */
#peglp-sheet .peglp-opts { display: flex; flex-direction: column; gap: 8px; }
#peglp-sheet .peglp-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
#peglp-sheet .peglp-opt { min-height: 46px; padding: 0 16px; border-radius: 12px; font-size: 15px; font-weight: 700; text-align: left; box-sizing: border-box; display: flex; align-items: center; border: 1.5px solid #B9CCC7; background: #FFFFFF; color: #12302B; cursor: pointer; font-family: inherit; }
#peglp-sheet .peglp-opt.on { border: 2px solid #008880; background: #E3F1ED; color: #17493F; }
#peglp-sheet .peglp-conds { display: flex; flex-wrap: wrap; gap: 8px; }
#peglp-sheet .peglp-cond { min-height: 38px; padding: 0 14px; border-radius: 19px; font-size: 13.5px; font-weight: 700; display: flex; align-items: center; border: 1.5px solid #B9CCC7; background: #FFFFFF; color: #12302B; cursor: pointer; font-family: inherit; }
#peglp-sheet .peglp-cond.on { border: 2px solid #008880; background: #E3F1ED; color: #17493F; }

/* sliders + bmi */
#peglp-sheet .peglp-slab { display: flex; flex-direction: column; gap: 6px; }
#peglp-sheet .peglp-slrow { display: flex; justify-content: space-between; align-items: baseline; }
#peglp-sheet .peglp-sllbl { font-size: 14px; font-weight: 700; color: #12302B; }
#peglp-sheet .peglp-slval { font-size: 17px; font-weight: 800; color: #008880; }
#peglp-sheet input[type=range] { width: 100%; height: 44px; margin: 0; accent-color: #008880; }
#peglp-sheet .peglp-bmicard { background: #17493F; color: #FFFFFF; border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; }
#peglp-sheet .peglp-bmilbl-s { font-size: 14px; font-weight: 600; }
#peglp-sheet .peglp-bmi-wrap { display: flex; align-items: baseline; gap: 8px; }
#peglp-sheet .peglp-bmi-n { font-size: 24px; font-weight: 800; }
#peglp-sheet .peglp-bmi-tag { font-size: 14px; font-weight: 700; padding: 3px 10px; border-radius: 6px; }

/* contact inputs */
#peglp-sheet .peglp-field { display: flex; flex-direction: column; gap: 6px; }
#peglp-sheet .peglp-flbl { font-size: 14px; font-weight: 700; color: #12302B; }
#peglp-sheet .peglp-inp { height: 48px; padding: 0 14px; border: 1.5px solid #B9CCC7; border-radius: 12px; font-size: 15px; color: #12302B; box-sizing: border-box; font-family: inherit; background: #fff; width: 100%; }
#peglp-sheet .peglp-inp:focus { outline: none; border-color: #008880; box-shadow: 0 0 0 3px rgba(0,136,128,0.14); }
#peglp-sheet .peglp-phone { display: flex; gap: 8px; }
#peglp-sheet .peglp-cc { width: 56px; height: 48px; border-radius: 12px; background: #EEF5F3; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; flex: none; }
#peglp-sheet .peglp-fine { font-size: 13px; color: #5A6F6A; }
#peglp-sheet .peglp-err { font-size: 13px; color: #E5483B; font-weight: 600; }

/* done screen */
#peglp-sheet .peglp-done-top { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding-top: 8px; }
#peglp-sheet .peglp-check { width: 80px; height: 80px; border-radius: 50%; background: #17493F; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 10px #E3F1ED; }
#peglp-sheet .peglp-done-h { margin: 10px 0 0; font-size: 23px; line-height: 1.2; font-weight: 800; color: #12302B; }
#peglp-sheet .peglp-done-b { font-size: 16px; line-height: 1.5; color: #3C514C; }
#peglp-sheet .peglp-done-b strong { color: #12302B; }
#peglp-sheet .peglp-done-badge { background: #FFD966; color: #4A3500; font-size: 13px; font-weight: 800; letter-spacing: 0.6px; padding: 5px 12px; border-radius: 8px; }
#peglp-sheet .peglp-next { background: #F3F9F7; border: 1px solid #CFE3DE; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
#peglp-sheet .peglp-next-h { font-size: 14px; font-weight: 800; letter-spacing: 0.4px; color: #17493F; }
#peglp-sheet .peglp-next-row { display: flex; gap: 12px; align-items: flex-start; }
#peglp-sheet .peglp-next-n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #008880; color: #fff; font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
#peglp-sheet .peglp-next-t { font-size: 15px; line-height: 1.4; color: #12302B; }
#peglp-sheet .peglp-disc { font-size: 13px; line-height: 1.5; color: #5A6F6A; text-align: center; }

/* footer + security line */
#peglp-sheet .peglp-footer { flex: none; padding: 12px 16px 8px; border-top: 1px solid #E3ECE9; background: #FFFFFF; }
#peglp-sheet .peglp-primary { width: 100%; height: 48px; border: 0; border-radius: 12px; font-size: 15px; font-weight: 800; cursor: pointer; font-family: inherit; }
#peglp-sheet .peglp-primary.on { background: #008880; color: #FFFFFF; }
#peglp-sheet .peglp-primary.off { background: #DCE8E4; color: #3C514C; cursor: default; }
#peglp-sheet .peglp-primary.on.pay { box-shadow: 0 4px 12px rgba(0,136,128,0.35); }
#peglp-sheet .peglp-secondary { width: 100%; height: 48px; margin-top: 6px; border: 0; background: transparent; color: #008880; font-size: 15px; font-weight: 800; cursor: pointer; font-family: inherit; }
#peglp-sheet .peglp-secure { flex: none; padding: 6px 16px 18px; font-size: 12px; color: #4A5E59; display: flex; align-items: center; justify-content: center; gap: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  #peglp-sticky { display: flex; }
  #peglp-tray { display: block; }
  #peglp-fab { display: none !important; }
  body { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }   /* clear the floating card */
  #peglp-sheet .peglp-echip { height: 32px; padding: 0 10px; font-size: 11.5px; }
  /* keep the sheet inside the VISIBLE viewport (dvh), so the header/close is
     never covered by the browser's top bar on iOS Safari/Chrome */
  #peglp-modal { align-items: flex-end; top: 0; bottom: auto; height: 100vh; height: 100dvh; }
  #peglp-sheet { height: 90vh; height: 90dvh; max-height: 90vh; max-height: 90dvh; border-radius: 16px 16px 0 0; }
  #peglp-sheet .peglp-top { padding-top: max(12px, calc(env(safe-area-inset-top) + 4px)); }
}
@media (min-width: 861px) {
  /* same floating card as mobile, docked bottom-right (no full-width backdrop) */
  #peglp-fab { display: none !important; }
  #peglp-sticky { display: flex; left: auto; right: 24px; bottom: 24px; width: 360px; max-width: calc(100vw - 48px); }
  #peglp-modal { align-items: center; }
  #peglp-sheet { border-radius: 24px; height: auto; max-height: 90vh; }
  #peglp-sheet .peglp-handle { display: none; }
}
