/* ==========================================================
   लेंडी मन्याड फाउंडेशन — मदत केंद्र widget + form additions
   Every class is lmf- prefixed so nothing collides with the
   approved stylesheet. Colours fall back to literals when the
   host page has no CSS variables.
   ========================================================== */

.lmf-hide { display: none !important; }

/* The chat is full screen on EVERY device — the client wants the
   assistant and nothing else, desktop included. Page scroll locks and
   the launcher hides while it is open. */
html.lmf-open, html.lmf-open body { overflow: hidden; }
html.lmf-open .lmf-fab { display: none; }

/* ---------- launcher ------------------------------------- */

.lmf-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 500;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--green, #1e5631);
  color: #fff;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(30, 86, 49, 0.4);
  transition: transform 0.25s;
}
.lmf-fab:hover { transform: scale(1.08); }
.lmf-fab:focus-visible { outline: 3px solid var(--feta, #f0a500); outline-offset: 3px; }

.lmf-fab-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--feta, #f0a500);
  border: 2px solid #fff;
}

/* ---------- panel ---------------------------------------- */

.lmf-panel {
  position: fixed !important;
  bottom: 94px;
  left: 24px;
  z-index: 600;
  width: min(92vw, 396px);
  height: min(74vh, 600px);
  display: flex;
  flex-direction: column;
  background: var(--paper, #faf9f4);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(12, 40, 20, 0.28);
  font-family: 'Mukta', system-ui, sans-serif;
  animation: lmf-pop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.lmf-panel {
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: none;
  border-radius: 0;
  animation: lmf-slide 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* On wide screens the conversation column stays readable instead of
   stretching wall-to-wall across a 27-inch monitor. */
.lmf-body, .lmf-head { width: 100%; }
@media (min-width: 900px) {
  .lmf-body { max-width: 760px; margin: 0 auto; }
  .lmf-head { justify-content: center; }
  .lmf-head .lmf-close { position: absolute; right: 22px; }
  .lmf-head { position: relative; }
}

@keyframes lmf-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes lmf-slide {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lmf-panel { animation: none; }
}

.lmf-panel, .lmf-head, .lmf-body, .lmf-opts, .lmf-msg {
  box-sizing: border-box;
}

/* The approved stylesheet styles bare element selectors — header is
   position:fixed;inset:0 0 auto 0 for the site navbar. Anything we
   inject must state its own positioning or it inherits that. */
.lmf-head {
  position: relative;
  inset: auto;
  top: auto; right: auto; bottom: auto; left: auto;
  z-index: auto;
  margin: 0;
  width: auto;
  max-width: none;
  transition: none;
  background: var(--green-deep, #123a20);
  flex: 0 0 auto;
  color: #fff;
  padding: 12px 14px 12px 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding-top: max(12px, env(safe-area-inset-top));
}
.lmf-head img { width: 46px; height: 46px; border-radius: 50%; background: #fff; object-fit: cover; flex: 0 0 auto; }
.lmf-head-txt { flex: 1 1 auto; min-width: 0; }
.lmf-head b { font-size: 1.12rem; font-weight: 700; display: block; line-height: 1.3; }
.lmf-head small { display: block; color: var(--olive, #8a9a5b); font-size: 0.8rem; }

.lmf-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}
.lmf-close:hover { background: rgba(255, 255, 255, 0.22); }

/* ---------- the single scroll region ---------------------- */

.lmf-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lmf-msg {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.65;
  max-width: 92%;
  word-break: break-word;
}
.lmf-bot {
  background: #fff;
  border: 1px solid var(--line, #e3e2d8);
  color: var(--ink, #22301f);
  align-self: flex-start;
}
.lmf-user {
  background: var(--green, #1e5631);
  color: #fff;
  align-self: flex-end;
}
.lmf-body img { max-width: 100%; height: auto; }
.lmf-msg, .lmf-opts button { overflow-wrap: anywhere; }
.lmf-msg a { color: var(--feta-deep, #c98a00); text-decoration: underline; word-break: break-all; }
.lmf-bot b { color: var(--green-ink, #0c2814); }

/* options live in the stream — one scrollbar, not two */
.lmf-opts {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-self: stretch;
  margin-top: 2px;
}
.lmf-opts button {
  text-align: left;
  padding: 12px 15px;
  border-radius: 12px;
  border: 1.5px solid var(--olive-soft, #eef1e2);
  background: #fff;
  color: var(--green-ink, #0c2814);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.45;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lmf-opts button:hover {
  background: var(--green, #1e5631);
  border-color: var(--green, #1e5631);
  color: #fff;
}
.lmf-opts button:focus-visible { outline: 3px solid var(--feta, #f0a500); outline-offset: 2px; }

@media (max-width: 640px) {
  .lmf-fab { left: 16px; bottom: 16px; }
  .lmf-msg { max-width: 100%; font-size: 0.95rem; }
}

/* ---------- membership form additions --------------------- */

.lmf-consent {
  display: block;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--ink-soft, #5c6657);
  margin: 12px 0 0;
  text-align: center;
}
.lmf-consent a { color: var(--green, #1e5631); font-weight: 600; text-decoration: underline; }

.lmf-guardian {
  border: 1.5px dashed var(--feta, #f0a500);
  background: var(--feta-soft, #fff6e0);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}
.lmf-guardian > p {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--feta-deep, #c98a00);
  margin-bottom: 10px;
}

.lmf-busy { opacity: 0.6; pointer-events: none; }

.lmf-spin {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lmf-rot 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 8px;
}
@keyframes lmf-rot { to { transform: rotate(360deg); } }
