/* ============================================================
   Agratix Lead Engine
   Floating assistant + Project Estimator + Book-a-Call + Sticky CTA
   Self-contained, brand-aligned (navy #1c3765 / green #489156)
   ============================================================ */

:root {
  --le-navy: #1c3765;
  --le-navy-2: #16213e;
  --le-green: #489156;
  --le-green-2: #5da86a;
  --le-ink: #0f172a;
  --le-radius: 16px;
  --le-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
  --le-shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.18);
}

/* Hide placeholder social icons until real profiles exist */
.footer-social a[href="#"] { display: none !important; }

/* Old floating "Get Started" widget is superseded by the lead assistant */
.floating-cta { display: none !important; }

/* ---------- Floating launcher ---------- */
.le-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99980;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 14px 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--le-green-2) 0%, var(--le-green) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: var(--le-shadow);
  transition: transform .25s ease, box-shadow .25s ease, opacity .25s ease;
}
.le-fab:hover { transform: translateY(-2px) scale(1.02); }
.le-fab .le-fab-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.6);
  animation: le-pulse 2s infinite;
}
.le-fab i { font-size: 1.15rem; }
@keyframes le-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,.55); }
  70% { box-shadow: 0 0 0 12px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
.le-fab.le-hidden { opacity: 0; pointer-events: none; transform: translateY(20px); }

/* ---------- Chat / assistant panel ---------- */
.le-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: min(640px, calc(100vh - 48px));
  z-index: 99985;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--le-shadow);
  transform: translateY(24px) scale(.96);
  opacity: 0;
  pointer-events: none;
  transition: transform .28s cubic-bezier(.16,1,.3,1), opacity .28s ease;
}
.le-panel.le-open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }

.le-panel-head {
  background: linear-gradient(135deg, var(--le-navy) 0%, var(--le-navy-2) 100%);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.le-panel-head .le-avatar {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--le-green-2), var(--le-green));
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.le-panel-head h4 { margin: 0; font-size: 1.02rem; line-height: 1.2; }
.le-panel-head p { margin: 2px 0 0; font-size: .78rem; opacity: .8; }
.le-panel-head .le-status { display:inline-flex; align-items:center; gap:6px; }
.le-panel-head .le-status::before {
  content:""; width:8px; height:8px; border-radius:50%; background:#41d67e;
  box-shadow:0 0 0 0 rgba(65,214,126,.7); animation: le-pulse 2s infinite;
}
.le-panel-head .le-close {
  margin-left: auto; background: rgba(255,255,255,.12); border: none; color:#fff;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: .95rem;
  display:flex; align-items:center; justify-content:center; transition: background .2s;
}
.le-panel-head .le-close:hover { background: rgba(255,255,255,.25); }

.le-body {
  flex: 1; overflow-y: auto; padding: 18px;
  background: #f5f7fb; display: flex; flex-direction: column; gap: 12px;
}
.le-msg {
  max-width: 85%; padding: 11px 14px; border-radius: 14px; font-size: .9rem; line-height: 1.45;
  animation: le-fade .35s ease both;
}
.le-msg.bot { background: #fff; color: #1f2937; border-bottom-left-radius: 4px; box-shadow: var(--le-shadow-sm); align-self: flex-start; }
.le-msg.user { background: linear-gradient(135deg, var(--le-green-2), var(--le-green)); color:#fff; border-bottom-right-radius: 4px; align-self: flex-end; }
@keyframes le-fade { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none; } }

.le-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.le-chip {
  background: #fff; border: 1.5px solid var(--le-green); color: var(--le-green);
  padding: 9px 14px; border-radius: 999px; font-size: .85rem; font-weight: 600; cursor: pointer;
  transition: all .2s ease;
}
.le-chip:hover { background: var(--le-green); color: #fff; transform: translateY(-1px); }

.le-typing { display:flex; gap:4px; padding: 12px 14px; }
.le-typing span { width:7px; height:7px; border-radius:50%; background:#c3cad6; animation: le-bounce 1.2s infinite; }
.le-typing span:nth-child(2){ animation-delay:.2s; } .le-typing span:nth-child(3){ animation-delay:.4s; }
@keyframes le-bounce { 0%,60%,100%{ transform: translateY(0); opacity:.5;} 30%{ transform: translateY(-5px); opacity:1;} }

/* Inline form inside chat */
.le-form { display:flex; flex-direction:column; gap:10px; background:#fff; padding:14px; border-radius:14px; box-shadow: var(--le-shadow-sm); }
.le-form input, .le-form textarea, .le-form select {
  width:100%; padding:11px 13px; border:1.5px solid #e2e8f0; border-radius:10px; font-size:.9rem;
  font-family:inherit; outline:none; transition:border-color .2s; box-sizing:border-box;
}
.le-form input:focus, .le-form textarea:focus, .le-form select:focus { border-color: var(--le-green); }
.le-btn {
  border:none; border-radius:10px; padding:12px 16px; font-size:.92rem; font-weight:700; cursor:pointer;
  background: linear-gradient(135deg, var(--le-green-2), var(--le-green)); color:#fff; transition: transform .2s, opacity .2s;
}
.le-btn:hover { transform: translateY(-1px); }
.le-btn:disabled { opacity:.6; cursor:not-allowed; }
.le-btn.le-secondary { background:#eef2f7; color: var(--le-navy); }

.le-foot { text-align:center; font-size:.72rem; color:#94a3b8; padding:8px; background:#f5f7fb; }
.le-foot a { color: var(--le-green); text-decoration:none; font-weight:600; }

/* ---------- Modal shell (estimator + booking) ---------- */
.le-modal-backdrop {
  position: fixed; inset: 0; z-index: 99990; display: none;
  background: rgba(10,15,28,.72); backdrop-filter: blur(8px);
  padding: 24px 16px; overflow-y: auto; align-items: flex-start; justify-content: center;
}
.le-modal-backdrop.le-open { display: flex; }
.le-modal {
  background: #fff; border-radius: 22px; width: 100%; max-width: 560px; margin: auto;
  box-shadow: var(--le-shadow); overflow: hidden; animation: le-pop .3s cubic-bezier(.16,1,.3,1);
}
@keyframes le-pop { from { opacity:0; transform: translateY(18px) scale(.97);} to { opacity:1; transform:none;} }
.le-modal-head {
  background: linear-gradient(135deg, var(--le-navy) 0%, var(--le-navy-2) 100%);
  color:#fff; padding: 22px 26px; display:flex; align-items:center; gap:14px;
}
.le-modal-head .le-icon { width:46px; height:46px; border-radius:13px; flex:none; display:flex; align-items:center; justify-content:center; font-size:1.3rem; background: linear-gradient(135deg, var(--le-green-2), var(--le-green)); }
.le-modal-head h3 { margin:0; font-size:1.25rem; }
.le-modal-head p { margin:3px 0 0; font-size:.82rem; opacity:.82; }
.le-modal-head .le-close { margin-left:auto; background:rgba(255,255,255,.12); border:none; color:#fff; width:36px; height:36px; border-radius:50%; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background .2s; }
.le-modal-head .le-close:hover { background:rgba(255,255,255,.25); }
.le-modal-body { padding: 24px 26px 28px; }

/* progress */
.le-steps { display:flex; gap:6px; margin-bottom:22px; }
.le-steps span { flex:1; height:5px; border-radius:999px; background:#e6eaf1; transition: background .3s; }
.le-steps span.active { background: linear-gradient(90deg, var(--le-green-2), var(--le-green)); }

.le-step { display:none; animation: le-fade .3s ease both; }
.le-step.active { display:block; }
.le-step h4 { margin:0 0 4px; font-size:1.12rem; color: var(--le-ink); }
.le-step .le-sub { margin:0 0 18px; font-size:.88rem; color:#64748b; }

.le-options { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.le-option {
  border:1.5px solid #e2e8f0; border-radius:14px; padding:16px; cursor:pointer; text-align:left;
  background:#fff; transition: all .2s; display:flex; flex-direction:column; gap:6px;
}
.le-option:hover { border-color: var(--le-green-2); transform: translateY(-2px); box-shadow: var(--le-shadow-sm); }
.le-option.selected { border-color: var(--le-green); background: rgba(72,145,86,.06); box-shadow: 0 0 0 3px rgba(72,145,86,.12); }
.le-option .le-opt-ico { font-size:1.4rem; color: var(--le-green); }
.le-option strong { font-size:.95rem; color: var(--le-ink); }
.le-option small { font-size:.78rem; color:#64748b; }

.le-field { margin-bottom:14px; }
.le-field label { display:block; font-size:.82rem; font-weight:600; color:#334155; margin-bottom:6px; }
.le-field input, .le-field select, .le-field textarea {
  width:100%; padding:12px 14px; border:1.5px solid #e2e8f0; border-radius:11px; font-size:.92rem;
  font-family:inherit; outline:none; box-sizing:border-box; transition:border-color .2s;
}
.le-field input:focus, .le-field select:focus, .le-field textarea:focus { border-color: var(--le-green); }

.le-nav { display:flex; justify-content:space-between; gap:12px; margin-top:22px; }
.le-nav .le-btn { flex:1; }

.le-estimate-box {
  background: linear-gradient(135deg, rgba(28,55,101,.05), rgba(72,145,86,.08));
  border:1.5px solid rgba(72,145,86,.25); border-radius:16px; padding:20px; text-align:center; margin-bottom:18px;
}
.le-estimate-box .le-range { font-size:1.7rem; font-weight:800; color: var(--le-navy); }
.le-estimate-box .le-range-label { font-size:.8rem; color:#64748b; margin-top:4px; }

/* booking slots */
.le-dates { display:grid; grid-template-columns: repeat(auto-fill, minmax(82px,1fr)); gap:8px; max-height:200px; overflow-y:auto; padding:2px; }
.le-date {
  border:1.5px solid #e2e8f0; border-radius:12px; padding:10px 6px; text-align:center; cursor:pointer; background:#fff; transition: all .2s;
}
.le-date:hover { border-color: var(--le-green-2); }
.le-date.selected { border-color: var(--le-green); background: var(--le-green); color:#fff; }
.le-date .le-dow { font-size:.7rem; text-transform:uppercase; opacity:.7; }
.le-date .le-day { font-size:1.15rem; font-weight:700; }
.le-date .le-mon { font-size:.7rem; opacity:.7; }
.le-slots { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; }
.le-slot { border:1.5px solid #e2e8f0; border-radius:10px; padding:9px 4px; text-align:center; cursor:pointer; font-size:.84rem; font-weight:600; background:#fff; transition: all .2s; }
.le-slot:hover { border-color: var(--le-green-2); }
.le-slot.selected { border-color: var(--le-green); background: var(--le-green); color:#fff; }

.le-success { text-align:center; padding:14px 6px; }
.le-success .le-check { width:64px; height:64px; border-radius:50%; margin:0 auto 16px; background:linear-gradient(135deg, var(--le-green-2), var(--le-green)); display:flex; align-items:center; justify-content:center; color:#fff; font-size:1.8rem; animation: le-pop .4s ease; }
.le-success h4 { font-size:1.25rem; margin:0 0 8px; color:var(--le-ink); }
.le-success p { color:#64748b; font-size:.92rem; margin:0; }

/* ---------- Sticky CTA bar ---------- */
.le-sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 99970;
  background: linear-gradient(135deg, var(--le-navy) 0%, var(--le-navy-2) 100%);
  color:#fff; padding: 12px 20px; display:flex; align-items:center; justify-content:center; gap:18px;
  box-shadow: 0 -8px 24px rgba(15,23,42,.18); transform: translateY(110%); transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.le-sticky.le-show { transform: translateY(0); }
.le-sticky p { margin:0; font-size:.95rem; font-weight:600; }
.le-sticky p span { color: var(--le-green-2); }
.le-sticky .le-btn { padding:10px 22px; }
.le-sticky .le-sticky-close { background:transparent; border:none; color:rgba(255,255,255,.6); font-size:1.1rem; cursor:pointer; position:absolute; right:14px; top:50%; transform:translateY(-50%); }

@media (max-width: 600px) {
  .le-fab { bottom: 16px; right: 16px; padding: 13px 16px; font-size:.9rem; }
  .le-fab .le-fab-label { display:none; }
  .le-panel { bottom: 0; right: 0; left:0; width:100%; max-width:100%; max-height: 86vh; border-radius: 20px 20px 0 0; }
  .le-options { grid-template-columns: 1fr; }
  .le-sticky { flex-direction: column; gap:10px; padding: 12px 16px 14px; text-align:center; }
  .le-sticky .le-sticky-close { top:8px; transform:none; }
  .le-sticky.le-show ~ .le-fab, .le-fab { bottom: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  .le-fab, .le-panel, .le-modal, .le-msg, .le-sticky { animation: none !important; transition: none !important; }
  .le-fab .le-fab-dot, .le-panel-head .le-status::before { animation: none !important; }
}
