/* ===== Lead popup + form (js/lead.js) - also used inside the AI chat ===== */
html.ld-lock, html.ld-lock body { overflow: hidden; }

.ld-modal { position: fixed; inset: 0; z-index: 30000; display: grid; place-items: center; padding: 16px; }
.ld-modal[hidden] { display: none; }
.ld-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
.ld-dialog { position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; border-radius: 26px; box-shadow: 0 40px 100px rgba(2, 6, 23, .45); opacity: 0; transform: translateY(24px) scale(.96); transition: opacity .28s ease, transform .35s cubic-bezier(.2, .9, .3, 1.2); overscroll-behavior: contain; }
.ld-modal.show .ld-backdrop { opacity: 1; }
.ld-modal.show .ld-dialog { opacity: 1; transform: none; }
.ld-x { position: absolute; top: 12px; right: 12px; z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .2); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; transition: background .2s, transform .2s; }
.ld-x:hover { background: rgba(255, 255, 255, .35); transform: rotate(90deg); }

.ld-hero { position: relative; overflow: hidden; padding: 30px 26px 24px; color: #e0e7ff; text-align: center; background: linear-gradient(135deg, #0b2a6f, #3730a3 55%, #be123c); }
.ld-orb { position: absolute; border-radius: 50%; filter: blur(30px); opacity: .55; animation: ld-float 7s ease-in-out infinite; }
.ld-orb.o1 { width: 160px; height: 160px; background: #f43f5e; top: -50px; left: -40px; }
.ld-orb.o2 { width: 140px; height: 140px; background: #fbbf24; bottom: -60px; right: -30px; animation-delay: -3s; }
@keyframes ld-float { 50% { transform: translate(18px, 12px) scale(1.1); } }
.ld-emoji { position: relative; display: inline-grid; place-items: center; width: 64px; height: 64px; font-size: 34px; border-radius: 20px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); margin-bottom: 12px; animation: ld-pop .6s cubic-bezier(.2, .9, .3, 1.4) both .1s; }
@keyframes ld-pop { from { transform: scale(.3) rotate(-20deg); opacity: 0; } }
.ld-hero h3 { position: relative; color: #fff; font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.ld-sub { position: relative; font-size: 14.5px; line-height: 1.5; max-width: 360px; margin: 0 auto; }
.ld-perks { position: relative; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 12.5px; font-weight: 600; color: #fde68a; }
.ld-body { padding: 22px 24px 24px; }

/* ---- form ---- */
.ld-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; text-align: left; font-family: "Poppins", system-ui, sans-serif; }
.ld-mobile input, .ld-input { width: 100%; }
.ld-label { font-size: 13.5px; font-weight: 600; color: #0f172a; margin-top: 6px; }
.ld-label em { color: #e11d2a; font-style: normal; }
.ld-label small { color: #64748b; font-weight: 400; }
.ld-mobile { position: relative; display: flex; align-items: center; border: 2px solid #e2e8f0; border-radius: 14px; background: #f8fafc; transition: border-color .2s, box-shadow .2s, background .2s; }
.ld-mobile:focus-within { border-color: #6366f1; background: #fff; box-shadow: 0 0 0 4px rgba(99, 102, 241, .15); }
.ld-mobile.ok { border-color: #16a34a; background: #fff; }
.ld-mobile.bad { border-color: #e11d2a; }
.ld-cc { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px 0 14px; font-weight: 700; color: #0b2a6f; border-right: 1.5px solid #e2e8f0; height: 28px; }
.ld-flag { width: 20px; height: 14px; border-radius: 2px; background: linear-gradient(#ff9933 33%, #fff 33% 66%, #138808 66%); box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.ld-mobile input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 19px; font-weight: 600; letter-spacing: .06em; color: #0f172a; padding: 13px 40px 13px 12px; outline: none; }
.ld-mobile input::placeholder { color: #cbd5e1; font-weight: 500; }
.ld-tick { position: absolute; right: 12px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #16a34a; color: #fff; font-size: 13px; font-weight: 800; transform: scale(0); transition: transform .3s cubic-bezier(.2, .9, .3, 1.6); }
.ld-mobile.ok .ld-tick { transform: scale(1); }
.ld-input { width: 100%; font: inherit; font-size: 15px; padding: 11px 14px; border: 2px solid #e2e8f0; border-radius: 14px; background: #f8fafc; color: #0f172a; outline: none; transition: border-color .2s, box-shadow .2s; }
.ld-input:focus { border-color: #6366f1; background: #fff; box-shadow: 0 0 0 4px rgba(99, 102, 241, .15); }

.ld-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ld-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13.5px; font-weight: 600; color: #334155; background: #fff; border: 1.5px solid #e2e8f0; border-radius: 999px; padding: 7px 12px 7px 9px; cursor: pointer; transition: background .2s, border-color .2s, color .2s, transform .15s, box-shadow .2s; }
.ld-chip:hover { border-color: #a5b4fc; transform: translateY(-1px); }
.ld-chip:active { transform: scale(.96); }
.ld-ico { font-size: 15px; }
.ld-chk { display: grid; place-items: center; width: 0; height: 18px; overflow: hidden; border-radius: 50%; background: #4f46e5; color: #fff; font-size: 11px; transition: width .2s; }
.ld-chip[aria-pressed="true"] { background: #eef2ff; border-color: #6366f1; color: #1e1b6b; box-shadow: 0 4px 12px -4px rgba(79, 70, 229, .45); }
.ld-chip[aria-pressed="true"] .ld-chk { width: 18px; }
.ld-chip.ld-all { background: linear-gradient(#fff, #fff) padding-box, linear-gradient(90deg, #e11d2a, #f97316, #6366f1) border-box; border-color: transparent; }
.ld-chip.ld-all[aria-pressed="true"] { background: linear-gradient(135deg, #fff1f2, #eef2ff) padding-box, linear-gradient(90deg, #e11d2a, #f97316, #6366f1) border-box; }

.ld-err { color: #e11d2a; font-size: 13.5px; font-weight: 500; }
.ld-err:empty { display: none; }
.ld-submit { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 8px; padding: 15px 20px; border: 0; border-radius: 16px; font: inherit; font-size: 16.5px; font-weight: 700; color: #fff; text-decoration: none; cursor: pointer; background: linear-gradient(135deg, #e11d2a, #f43f5e 50%, #f97316); box-shadow: 0 14px 30px -8px rgba(225, 29, 42, .6); transition: transform .2s, box-shadow .2s, filter .2s, opacity .2s; }
.ld-submit svg { width: 20px; height: 20px; transition: transform .2s; }
.ld-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 18px 36px -8px rgba(225, 29, 42, .7); }
.ld-submit:hover:not(:disabled) svg { transform: translateX(4px); }
.ld-submit::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent); transform: skewX(-20deg); animation: ld-shine 3s ease-in-out infinite; }
@keyframes ld-shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.ld-submit:disabled { filter: grayscale(.7); opacity: .55; cursor: not-allowed; box-shadow: none; }
.ld-submit:disabled::after { display: none; }
.ld-submit.ld-busy span::after { content: " …"; }
.ld-submit.ld-busy { pointer-events: none; }
.ld-submit.ld-pulse { animation: ld-pulse 1.6s ease-in-out infinite; }
@keyframes ld-pulse { 50% { box-shadow: 0 0 0 10px rgba(225, 29, 42, .12), 0 14px 30px -8px rgba(225, 29, 42, .6); } }
.ld-trust { font-size: 12px; color: #64748b; text-align: center; }

/* ---- success ---- */
.ld-done { position: relative; text-align: center; padding: 6px 0 2px; }
.ld-check svg { width: 76px; height: 76px; margin: 0 auto 10px; display: block; }
.ld-check circle { fill: #dcfce7; stroke: #16a34a; stroke-width: 2.5; stroke-dasharray: 152; stroke-dashoffset: 152; animation: ld-draw .6s ease forwards; }
.ld-check path { fill: none; stroke: #16a34a; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: ld-draw .4s ease forwards .45s; }
@keyframes ld-draw { to { stroke-dashoffset: 0; } }
.ld-done h4 { font-size: 22px; color: #0f172a; margin-bottom: 4px; }
.ld-done p { color: #475569; font-size: 15px; margin-bottom: 14px; }
.ld-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ld-actions .ld-submit { grid-column: 1 / -1; margin-top: 0; }
.ld-alt { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 14px; font-weight: 700; font-size: 14.5px; text-decoration: none; transition: transform .2s, filter .2s; }
.ld-alt:hover { transform: translateY(-2px); filter: brightness(1.05); }
.ld-alt.wa { background: #22c55e; color: #fff; }
.ld-alt.play { background: #0f172a; color: #fff; }
.ld-burst { position: absolute; left: 50%; top: 40px; width: 0; height: 0; pointer-events: none; }
.ld-burst i { position: absolute; width: 8px; height: 14px; border-radius: 2px; opacity: 0; animation: ld-confetti 1.1s ease-out forwards .3s; }
.ld-burst i:nth-child(3n) { background: #e11d2a; } .ld-burst i:nth-child(3n+1) { background: #fbbf24; } .ld-burst i:nth-child(3n+2) { background: #6366f1; }
.ld-burst i:nth-child(1) { --x: -110px; --y: -40px; } .ld-burst i:nth-child(2) { --x: 110px; --y: -50px; }
.ld-burst i:nth-child(3) { --x: -80px; --y: -90px; } .ld-burst i:nth-child(4) { --x: 80px; --y: -95px; }
.ld-burst i:nth-child(5) { --x: -140px; --y: 20px; } .ld-burst i:nth-child(6) { --x: 140px; --y: 15px; }
.ld-burst i:nth-child(7) { --x: -30px; --y: -110px; } .ld-burst i:nth-child(8) { --x: 30px; --y: -115px; }
.ld-burst i:nth-child(9) { --x: -120px; --y: 60px; } .ld-burst i:nth-child(10) { --x: 120px; --y: 70px; }
.ld-burst i:nth-child(11) { --x: -60px; --y: 80px; } .ld-burst i:nth-child(12) { --x: 60px; --y: 85px; }
@keyframes ld-confetti { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(320deg); } }

/* ---- compact (inside the AI chat bubble) ---- */
.ld-compact { gap: 6px; }
.ld-compact .ld-label { font-size: 12.5px; margin-top: 2px; }
.ld-compact .ld-mobile input { font-size: 17px; padding: 10px 36px 10px 10px; }
.ld-compact .ld-chip { font-size: 12px; padding: 6px 10px 6px 8px; }
.ld-compact .ld-submit { padding: 12px 16px; font-size: 15px; border-radius: 14px; }
.ld-compact .ld-trust { font-size: 11px; }

/* ---- phone: bottom sheet ---- */
@media (max-width: 560px) {
  .ld-modal { place-items: end center; padding: 0; }
  .ld-dialog { max-width: none; border-radius: 26px 26px 0 0; max-height: 94vh; transform: translateY(100%); padding-bottom: env(safe-area-inset-bottom); }
  .ld-hero { padding: 26px 20px 20px; }
  .ld-hero h3 { font-size: 21px; }
  .ld-body { padding: 18px 16px 20px; }
  .ld-chip { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .ld-orb, .ld-submit::after, .ld-burst { display: none; }
  .ld-pulse { animation: none !important; }
}

/* ---- AI chat: mobile number first ---- */
.aic-panel.aic-locked .aic-form, .aic-panel.aic-locked .aic-chips { display: none !important; }
.aic-row.aic-lead .aic-col { max-width: 100%; flex: 1; }
.aic-row.aic-lead .aic-bubble { padding: 14px; }
.aic-lead-q { margin-bottom: 8px; }
.aic-lead .ld-chips { gap: 6px; }
.aic-bubble a.ld-submit, .aic-bubble a.ld-alt, .aic-demo-cta a.ld-submit, .aic-demo-cta a.ld-alt { color: #fff; text-decoration: none; }
.aic-demo-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; padding: 12px; border-radius: 16px; background: linear-gradient(135deg, #fff1f2, #eef2ff); border: 1px solid #e0e7ff; }
.aic-demo-cta span { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: #1e1b6b; }
.aic-demo-cta .ld-submit { margin: 0; padding: 10px 12px; font-size: 13.5px; border-radius: 12px; }
.aic-demo-cta .ld-alt { padding: 10px 12px; font-size: 13.5px; border-radius: 12px; }

/* popup: keep the main button in view while the visitor scrolls the options (phones) */
.ld-modal .ld-form:not(.ld-compact) > .ld-submit { position: sticky; bottom: 10px; z-index: 2; }
.ld-modal .ld-form:not(.ld-compact) > .ld-submit:disabled { opacity: 1; filter: none; background: linear-gradient(135deg, #f1a1a7, #f8b4c0 50%, #fbc79f); }

/* ---------- Exit offer: discount + 1 hour timer (js/lead.js "exit-offer") ---------- */
.ld-is-offer .ld-hero { background: linear-gradient(135deg, #7f1d1d, #be123c 50%, #ea580c); }
.ld-offer { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 14px auto 0; padding: 10px 14px; max-width: 360px; border-radius: 14px; background: rgba(255, 255, 255, .14); border: 1px dashed rgba(253, 230, 138, .8); }
.ld-offer[hidden] { display: none; }
.ld-offer-pct { font-size: 26px; font-weight: 800; color: #fde047; letter-spacing: -.02em; animation: ld-pop 1.4s ease-in-out infinite; }
.ld-offer-time { font-size: 13.5px; color: #fff; }
.ld-clock { display: inline-block; min-width: 54px; margin-left: 4px; padding: 2px 8px; border-radius: 8px; background: #0f172a; color: #fde047; font-variant-numeric: tabular-nums; }
.ld-locked { background: #dcfce7; color: #166534 !important; border-radius: 12px; padding: 8px 12px; }
@keyframes ld-pop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.ld-pill { position: fixed; right: 20px; bottom: 24px; z-index: 940; display: flex; align-items: center; border-radius: 999px; background: linear-gradient(135deg, #be123c, #ea580c); color: #fff; box-shadow: 0 14px 30px rgba(190, 18, 60, .4); opacity: 0; transform: translateY(20px); transition: opacity .3s, transform .3s; }
.ld-pill.show { opacity: 1; transform: none; }
.ld-pill button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.ld-pill-open { display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 16px; font-size: 14px; font-weight: 600; }
.ld-pill-pct { background: #fde047; color: #7f1d1d; font-weight: 800; padding: 3px 9px; border-radius: 999px; font-size: 13px; }
.ld-pill b { font-variant-numeric: tabular-nums; }
.ld-pill-x { width: 34px; height: 34px; margin-right: 4px; border-radius: 50%; font-size: 20px !important; line-height: 1; opacity: .8; }
.ld-pill-x:hover { opacity: 1; background: rgba(255, 255, 255, .18) !important; }
@media (max-width: 960px) { .ld-pill { right: 14px; bottom: 88px; } .ld-pill-open { font-size: 13px; padding-left: 12px; } }
@media (prefers-reduced-motion: reduce) { .ld-offer-pct { animation: none; } }

/* ---------- Push notifications: soft prompt (js/push.js) + bell button on the thank-you screen ---------- */
.ld-alt.bell { grid-column: 1 / -1; background: #fef3c7; color: #92400e; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.ld-alt.bell:disabled { cursor: default; opacity: .9; }
.ps-card { position: fixed; top: 92px; right: 20px; z-index: 960; width: 360px; max-width: calc(100vw - 32px); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 14px; padding: 16px 18px; background: #fff; border-radius: 18px; border: 1px solid #e2e8f0; box-shadow: 0 24px 60px rgba(11, 42, 111, .22); opacity: 0; transform: translateY(-16px); transition: opacity .3s, transform .3s; }
.ps-card.show { opacity: 1; transform: none; }
.ps-bell { font-size: 26px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: #fef3c7; animation: ps-ring 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
.ps-text b { display: block; color: #0f172a; font-size: 15.5px; }
.ps-text span { display: block; color: #64748b; font-size: 13.5px; line-height: 1.45; margin-top: 2px; }
.ps-btns { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.ps-btns button { font: inherit; font-weight: 600; font-size: 14px; padding: 8px 18px; border-radius: 999px; cursor: pointer; border: 0; }
.ps-later { background: #f1f5f9; color: #475569; }
.ps-allow { background: linear-gradient(135deg, #e11d2a, #f43f5e); color: #fff; box-shadow: 0 8px 18px rgba(225, 29, 42, .3); }
.ps-allow:disabled { opacity: .6; }
@keyframes ps-ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 80% { transform: rotate(-12deg); } 85% { transform: rotate(8deg); } 90% { transform: rotate(-5deg); } }
@media (max-width: 720px) { .ps-card { top: auto; bottom: 84px; right: 16px; left: 16px; width: auto; max-width: none; } }
@media (prefers-reduced-motion: reduce) { .ps-bell { animation: none; } }
