/* ── LenderFinder Calculator Plugin Styles ──
   All classes prefixed .lf- to avoid theme conflicts
──────────────────────────────────────────────── */

.lf-wrap *,.lf-wrap *::before,.lf-wrap *::after{box-sizing:border-box;margin:0;padding:0}

.lf-wrap {
  --lf-bg: #ffffff;
  --lf-surface: #f4f6fb;
  --lf-card: #ffffff;
  --lf-border: #e2e6f0;
  --lf-border2: #cdd2e1;
  --lf-text: #0d1120;
  --lf-muted: #5a607a;
  --lf-dim: #9ba3bc;
  --lf-green: #00c985;
  --lf-green2: #00a86e;
  --lf-blue: #4d7cff;
  --lf-blue2: #2855e0;
  --lf-amber: #e09400;
  --lf-red: #e03f3f;
  --lf-radius: 18px;
  --lf-radius-sm: 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--lf-text);
  background: var(--lf-bg);
}

/* ── Modal ── */
.lf-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,15,40,0.72);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
.lf-modal.lf-open { display: flex; }
.lf-modal-inner {
  position: relative;
  width: 95%;
  max-width: 880px;
  max-height: 92vh;
  background: #fff;
  border-radius: var(--lf-radius);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(10,15,40,0.35);
  display: flex;
  flex-direction: column;
}
.lf-modal-close {
  position: absolute;
  top: 10px; right: 14px;
  background: rgba(10,15,40,0.08);
  border: none;
  font-size: 22px;
  line-height: 1;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  color: var(--lf-text);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.lf-modal-close:hover { background: rgba(10,15,40,0.18); }
/* Scrollable area inside modal so the iframe.global embed can expand freely */
.lf-modal-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  padding-top: 44px; /* room for close button */
}
/* iframe.global sets its own height via postMessage — don't constrain it */
#application-form {
  width: 100%;
  border: none;
  display: block;
  min-height: 840px;
}
@media (max-width: 768px) {
  #application-form { min-height: 1000px; }
  .lf-modal-inner { width: 100%; max-height: 100vh; border-radius: 0; }
}

/* ── Hero ── */
.lf-hero-strip {
  background: linear-gradient(90deg,rgba(0,201,133,0.07) 0%,rgba(77,124,255,0.05) 100%);
  border-bottom: 1px solid var(--lf-border);
  padding: 40px 32px 36px;
  text-align: center;
}
.lf-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--lf-green);
  text-transform: uppercase;
  border: 1px solid rgba(0,201,133,0.3);
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.lf-hero-h1 {
  font-size: clamp(22px,3.5vw,38px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 10px;
  color: var(--lf-green);
}
.lf-hero-p { font-size: 15px; color: var(--lf-muted); max-width: 460px; margin: 0 auto; line-height: 1.6; }

/* ── Page layout ── */
.lf-page {
  max-width: 1140px;
  margin: 0 auto;
  padding: 36px 20px 72px;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 26px;
  align-items: start;
}
@media(max-width:860px){ .lf-page{ grid-template-columns:1fr } }

/* ── Card ── */
.lf-card {
  background: var(--lf-card);
  border: 1px solid var(--lf-border);
  border-radius: var(--lf-radius);
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(10,15,40,0.06);
}
.lf-card-hd {
  padding: 16px 22px;
  border-bottom: 1px solid var(--lf-border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--lf-surface);
}
.lf-hd-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.lf-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--lf-text);
  margin: 0;
}
.lf-badge-live {
  margin-left: auto;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(0,201,133,0.10);
  color: var(--lf-green);
  border: 1px solid rgba(0,201,133,0.25);
  display: flex; align-items: center; gap: 5px;
}
.lf-dot-pulse {
  width: 6px; height: 6px;
  background: var(--lf-green);
  border-radius: 50%;
  animation: lf-dpulse 1.8s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes lf-dpulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.5;transform:scale(1.4)}}

/* ── Calc body ── */
.lf-calc-body { padding: 26px; }
.lf-left-col,.lf-right-col { display: flex; flex-direction: column; gap: 22px; }

.lf-field { margin-bottom: 20px; }
.lf-field label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  font-weight: 500;
  color: var(--lf-muted);
  margin-bottom: 10px;
}
.lf-field label strong { font-size: 20px; font-weight: 700; color: var(--lf-text); }
.lf-field label strong em { color: var(--lf-green); font-style: normal; }

/* Range sliders */
.lf-wrap input[type=range] {
  width: 100%;
  -webkit-appearance: none;
  height: 5px;
  border-radius: 3px;
  background: var(--lf-border2);
  outline: none;
  border: none;
  padding: 0;
  display: block;
}
.lf-wrap input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--lf-green);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--lf-green);
}
.lf-wrap input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--lf-green);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--lf-green);
}
.lf-range-ends { display:flex; justify-content:space-between; font-size:11px; color:var(--lf-dim); margin-top:5px; }

/* Selects & inputs */
.lf-wrap select,
.lf-wrap input[type=text],
.lf-wrap input[type=email],
.lf-wrap input[type=tel] {
  width: 100%;
  background: var(--lf-surface);
  border: 1px solid var(--lf-border2);
  border-radius: var(--lf-radius-sm);
  color: var(--lf-text);
  font-size: 14px;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  margin-bottom: 0;
}
.lf-wrap select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a607a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.lf-wrap select:focus,
.lf-wrap input:focus { border-color: var(--lf-green); }

/* Results */
.lf-results {
  margin-top: 4px;
  background: var(--lf-surface);
  border: 1px solid var(--lf-border);
  border-radius: var(--lf-radius-sm);
  overflow: hidden;
}
.lf-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--lf-border);
}
.lf-result-row:last-child { border-bottom: none; }
.lf-result-label { font-size: 13px; color: var(--lf-muted); }
.lf-result-val { font-size: 17px; font-weight: 700; }
.lf-result-val.lf-green  { color: var(--lf-green); }
.lf-result-val.lf-amber  { color: var(--lf-amber); }
.lf-result-val.lf-red    { color: var(--lf-red); }
.lf-result-val.lf-blue   { color: var(--lf-blue); }

/* Cost bar */
.lf-cost-bar { padding: 16px; border-top: 1px solid var(--lf-border); }
.lf-cost-bar-label { font-size: 12px; color: var(--lf-muted); margin-bottom: 8px; }
.lf-bar-track { height: 10px; border-radius: 5px; background: var(--lf-border2); overflow: hidden; display: flex; }
.lf-bar-principal { background: #4d7cff; height: 100%; transition: width 0.5s ease; }
.lf-bar-interest  { background: #e09400; height: 100%; transition: width 0.5s ease; }
.lf-bar-legend { display:flex; gap:14px; margin-top:8px; }
.lf-bar-legend-item { display:flex; align-items:center; gap:5px; font-size:11px; color:var(--lf-muted); }
.lf-bar-dot { width:8px; height:8px; border-radius:2px; }



/* ── AI Tips ── */
.lf-ai-tips { border-top: 1px solid var(--lf-border); padding: 18px 24px; }
.lf-ai-tips-header { display:flex; align-items:center; gap:8px; margin-bottom:12px; }
.lf-ai-tips-header h4 { font-size:14px; font-weight:500; color:var(--lf-text); margin:0; }
.lf-ai-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(77,124,255,0.10);
  color: var(--lf-blue);
  border: 1px solid rgba(77,124,255,0.2);
}
.lf-tips-list { display:flex; flex-direction:column; gap:9px; }
.lf-tip-item {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  background: var(--lf-surface);
  border: 1px solid var(--lf-border);
  border-radius: var(--lf-radius-sm);
  border-left: 3px solid var(--lf-blue);
  font-size: 13px;
  color: var(--lf-muted);
  line-height: 1.5;
  animation: lf-fadein 0.4s ease both;
}
.lf-tip-icon { font-size:15px; flex-shrink:0; }
@keyframes lf-fadein{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}

/* ── Buttons ── */
.lf-btn-main {
  width: 100%;
  padding: 13px;
  border-radius: var(--lf-radius-sm);
  background: var(--lf-green);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: -0.2px;
}
.lf-btn-main:hover { background: var(--lf-green2); transform: translateY(-1px); }

/* ── Chat ── */
.lf-chat-card { position: sticky; top: 24px; }
.lf-chat-window {
  height: 380px;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--lf-border2) transparent;
}
.lf-chat-window::-webkit-scrollbar { width: 4px; }
.lf-chat-window::-webkit-scrollbar-thumb { background: var(--lf-border2); border-radius: 2px; }

.lf-msg { display:flex; gap:9px; align-items:flex-end; animation:lf-fadein 0.3s ease both; }
.lf-msg.lf-user { flex-direction:row-reverse; }
.lf-msg-av {
  width:28px; height:28px;
  border-radius:50%;
  flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-size:13px;
}
.lf-msg-av.lf-bot-av { background:rgba(0,201,133,0.12); border:1px solid rgba(0,201,133,0.25); }
.lf-msg-av.lf-user-av { background:rgba(77,124,255,0.12); border:1px solid rgba(77,124,255,0.2); }
.lf-msg-bubble {
  max-width:82%;
  padding:10px 13px;
  border-radius:13px;
  font-size:13px;
  line-height:1.55;
}
.lf-msg.lf-bot .lf-msg-bubble {
  background: var(--lf-surface);
  border: 1px solid var(--lf-border);
  color: var(--lf-text);
  border-bottom-left-radius: 4px;
}
.lf-msg.lf-user .lf-msg-bubble {
  background: var(--lf-blue2);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* typing */
.lf-typing { display:flex; gap:4px; align-items:center; padding:12px 13px; }
.lf-typing span {
  width:7px; height:7px;
  background:var(--lf-dim);
  border-radius:50%;
  animation:lf-bounce 1.2s ease-in-out infinite;
}
.lf-typing span:nth-child(2){animation-delay:.15s}
.lf-typing span:nth-child(3){animation-delay:.3s}
@keyframes lf-bounce{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-5px)}}

.lf-quick-replies { display:flex; flex-wrap:wrap; gap:6px; padding:0 18px 12px; }
.lf-qr {
  font-size:12px;
  padding:6px 12px;
  border-radius:20px;
  border:1px solid var(--lf-border2);
  color:var(--lf-muted);
  cursor:pointer;
  background:transparent;
  transition:all 0.2s;
}
.lf-qr:hover { border-color:var(--lf-green); color:var(--lf-green); background:rgba(0,201,133,0.05); }

.lf-chat-input-bar {
  display:flex;
  align-items:center;
  gap:9px;
  padding:12px 14px;
  border-top:1px solid var(--lf-border);
}
.lf-chat-input-bar input {
  flex:1;
  background:var(--lf-surface);
  border:1px solid var(--lf-border2);
  border-radius:24px;
  padding:9px 16px;
  font-size:13px;
  color:var(--lf-text);
  outline:none;
}
.lf-chat-input-bar input::placeholder { color:var(--lf-dim); }
.lf-chat-input-bar input:focus { border-color:var(--lf-green); }
.lf-send-btn {
  width:36px; height:36px;
  border-radius:50%;
  background:var(--lf-green);
  border:none;
  cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:all 0.2s;
  flex-shrink:0;
  padding:0;
}
.lf-send-btn:hover { background:var(--lf-green2); transform:scale(1.05); }
.lf-send-btn svg { width:15px; height:15px; }

/* Lead form in chat */
.lf-chat-lead-form {
  background:var(--lf-surface);
  border:1px solid var(--lf-border);
  border-radius:var(--lf-radius-sm);
  padding:13px;
}
.lf-chat-lead-form h4 { font-size:13px; font-weight:500; color:var(--lf-text); margin:0 0 10px; }
.lf-chat-lead-form input,
.lf-chat-lead-form select {
  margin-bottom:7px;
  font-size:13px;
  padding:9px 12px;
  background:#fff;
  border:1px solid var(--lf-border);
  border-radius:var(--lf-radius-sm);
  width:100%;
  outline:none;
  color:var(--lf-text);
  -webkit-appearance:none;
}
.lf-chat-lead-form input:focus,
.lf-chat-lead-form select:focus { border-color:var(--lf-green); }

/* Handoff card */
.lf-handoff-card {
  background:var(--lf-surface);
  border:1px solid var(--lf-border);
  border-radius:var(--lf-radius-sm);
  padding:13px;
}
.lf-handoff-card h4 { font-size:13px; font-weight:500; color:var(--lf-text); margin:0 0 10px; }
.lf-handoff-lender {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:9px 11px;
  background:#fff;
  border:1px solid var(--lf-border);
  border-radius:8px;
  margin-bottom:5px;
  cursor:pointer;
  transition:all 0.2s;
  text-decoration:none;
}
.lf-handoff-lender:hover { border-color:var(--lf-green); }
.lf-handoff-lender-left { display:flex; align-items:center; gap:9px; }
.lf-handoff-name { font-size:13px; color:var(--lf-text); font-weight:500; }
.lf-handoff-meta { font-size:11px; color:var(--lf-dim); }
.lf-handoff-go { font-size:12px; color:var(--lf-green); font-weight:600; }
.lf-lender-av {
  width:30px; height:30px;
  border-radius:7px;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:11px; color:#fff; flex-shrink:0;
}

/* Trust card */
.lf-trust-card { padding:18px 22px; }
.lf-trust-label { font-size:11px; font-weight:600; letter-spacing:0.1em; color:var(--lf-dim); text-transform:uppercase; margin-bottom:13px; }
.lf-trust-list { display:flex; flex-direction:column; gap:9px; }
.lf-trust-item { display:flex; gap:10px; align-items:center; font-size:13px; color:var(--lf-muted); }
.lf-trust-item span { font-size:18px; }

/* Disclaimer */
.lf-disclaimer {
  font-size:11px;
  color:var(--lf-dim);
  line-height:1.6;
  padding:14px 22px;
  border-top:1px solid var(--lf-border);
}

/* ── Apply CTA ── */
.lf-apply-cta {
  border-top: 1px solid var(--lf-border);
  padding: 20px 26px;
}
