/* ============================================================
   LEADS.CSS — TrufinOps Lead Capture System
   Premium, non-intrusive, mobile-first
   ============================================================ */

/* ── Lead Form Base ── */
.tf-lead-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.tf-lead-form::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.tf-lead-form-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--text);
  margin-bottom: 6px;
  line-height: var(--lh-snug);
}
.tf-lead-form-subtitle {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-bottom: 20px;
  line-height: var(--lh-normal);
}
.tf-lead-form-icon {
  font-size: 1.5rem;
  margin-bottom: 10px;
  display: block;
}

/* ── Form Fields ── */
.tf-field-group {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.tf-field-group.two-col {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 560px) {
  .tf-field-group.two-col { grid-template-columns: 1fr; }
}
.tf-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tf-field label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tf-field label .optional {
  font-weight: var(--fw-normal);
  text-transform: none;
  color: rgba(154,163,178,.6);
  letter-spacing: 0;
}
.tf-field input,
.tf-field select {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-base);
  padding: 11px 14px;
  width: 100%;
  outline: none;
  transition: border-color .18s, background .18s;
  appearance: none;
  -webkit-appearance: none;
}
.tf-field input::placeholder { color: rgba(154,163,178,.5); }
.tf-field input:focus,
.tf-field select:focus {
  border-color: var(--accent);
  background: rgba(108,242,194,.04);
}
.tf-field 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='%239aa3b2' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.tf-field select option {
  background: var(--surface);
  color: var(--text);
}

/* ── OTP Section ── */
.tf-otp-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.tf-otp-row .tf-field { flex: 1; }
.tf-otp-btn {
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  padding: 11px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s;
  flex-shrink: 0;
}
.tf-otp-btn:hover { background: rgba(255,255,255,.12); }
.tf-otp-btn:disabled { opacity: .5; cursor: default; }
.tf-otp-verify-row {
  display: none;
  gap: 10px;
  align-items: flex-end;
  margin-top: 10px;
}
.tf-otp-verify-row.visible { display: flex; }
.tf-otp-status {
  font-size: var(--fs-xs);
  margin-top: 4px;
  height: 16px;
}
.tf-otp-status.success { color: var(--accent); }
.tf-otp-status.error { color: var(--danger); }

/* ── Consent ── */
.tf-consent {
  margin-top: 14px;
  margin-bottom: 16px;
}
.tf-consent label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: var(--lh-relaxed);
}
.tf-consent input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  accent-color: var(--accent);
  margin-top: 2px;
  cursor: pointer;
}
.tf-consent a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Submit Button ── */
.tf-submit-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  cursor: pointer;
  transition: opacity .18s, transform .18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.tf-submit-btn:hover { opacity: .88; transform: translateY(-1px); }
.tf-submit-btn:disabled { opacity: .5; cursor: default; transform: none; }
.tf-submit-btn .spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(0,0,0,.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: none;
}
.tf-submit-btn.loading .spinner { display: block; }
.tf-submit-btn.loading .btn-text { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Success State ── */
.tf-success {
  display: none;
  text-align: center;
  padding: 24px 16px;
}
.tf-success.visible { display: block; }
.tf-success-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}
.tf-success-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--accent);
  margin-bottom: 8px;
}
.tf-success-msg {
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: var(--lh-normal);
}

/* ── Error Message ── */
.tf-form-error {
  display: none;
  background: rgba(248,113,113,.1);
  border: 1px solid rgba(248,113,113,.3);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: var(--fs-xs);
  padding: 10px 14px;
  margin-bottom: 12px;
}
.tf-form-error.visible { display: block; }

/* ── Field Error ── */
.tf-field input.error,
.tf-field select.error {
  border-color: var(--danger);
}
.tf-field-error {
  font-size: var(--fs-xs);
  color: var(--danger);
  margin-top: 3px;
}

/* ============================================================
   INLINE BLOG CTA BLOCK
   ============================================================ */
.tf-blog-cta {
  background: linear-gradient(135deg, rgba(108,242,194,.08), rgba(122,162,255,.06));
  border: 1px solid rgba(108,242,194,.2);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin: 36px 0;
  display: flex;
  align-items: center;
  gap: 24px;
}
.tf-blog-cta-icon { font-size: 2rem; flex-shrink: 0; }
.tf-blog-cta-content { flex: 1; }
.tf-blog-cta-title {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--text);
  margin-bottom: 4px;
}
.tf-blog-cta-desc {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-bottom: 14px;
  line-height: var(--lh-normal);
}
.tf-blog-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  border: none;
  cursor: pointer;
  transition: opacity .18s, transform .18s;
  font-family: inherit;
}
.tf-blog-cta-btn:hover { opacity: .88; transform: translateY(-1px); }
@media (max-width: 600px) {
  .tf-blog-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }
}

/* ============================================================
   SIDEBAR WIDGET
   ============================================================ */
.tf-sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: sticky;
  top: 90px;
}
.tf-sidebar-widget .tf-lead-form {
  padding: 0;
  background: none;
  border: none;
}
.tf-sidebar-widget .tf-lead-form::before { display: none; }

/* ============================================================
   FLOATING STICKY CTA (Desktop bottom-right)
   ============================================================ */
.tf-float-cta {
  position: fixed;
  bottom: 88px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.tf-float-cta * { pointer-events: auto; }

.tf-float-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
  padding: 13px 20px;
  border-radius: 50px;
  border: none;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(108,242,194,.3);
  transition: transform .2s, box-shadow .2s;
}
.tf-float-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(108,242,194,.4);
}
.tf-float-trigger-pulse {
  width: 8px; height: 8px;
  background: #000;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: .6; }
}

.tf-float-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 340px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .35s cubic-bezier(.4,0,.2,1), opacity .25s ease;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.tf-float-panel.open {
  max-height: 620px;
  opacity: 1;
}
.tf-float-panel-inner {
  padding: 24px;
}
.tf-float-close {
  position: absolute;
  top: 12px; right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.tf-float-close:hover { color: var(--text); }
.tf-float-panel { position: relative; }

@media (max-width: 640px) {
  .tf-float-cta { bottom: 80px; right: 16px; left: 16px; align-items: stretch; }
  .tf-float-panel { width: 100%; }
  .tf-float-trigger { justify-content: center; }
}

/* ============================================================
   MOBILE STICKY BOTTOM BAR
   ============================================================ */
.tf-mobile-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 8500;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  backdrop-filter: blur(12px);
}
@media (max-width: 768px) {
  .tf-mobile-bar { display: flex; gap: 10px; align-items: center; }
  body { padding-bottom: 68px; }
}
.tf-mobile-bar-text {
  flex: 1;
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: var(--lh-snug);
}
.tf-mobile-bar-text strong { color: var(--text); display: block; font-size: var(--fs-sm); }
.tf-mobile-bar-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  padding: 10px 16px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.tf-mobile-bar-btn:hover { opacity: .88; }

/* ============================================================
   EXIT INTENT POPUP
   ============================================================ */
.tf-exit-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}
.tf-exit-overlay.visible { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.tf-exit-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  position: relative;
  animation: slideUp .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.tf-exit-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.tf-exit-modal-inner { padding: 28px 28px 24px; }
.tf-exit-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  color: var(--muted); font-size: 20px;
  cursor: pointer; line-height: 1; padding: 4px;
}
.tf-exit-close:hover { color: var(--text); }
.tf-exit-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(108,242,194,.12);
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}

/* ============================================================
   CALCULATOR CTA SECTION
   ============================================================ */
.tf-calc-cta {
  background: linear-gradient(135deg, rgba(108,242,194,.06), rgba(122,162,255,.05));
  border: 1px solid rgba(108,242,194,.15);
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 40px;
  text-align: center;
}
.tf-calc-cta-title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  margin-bottom: 8px;
}
.tf-calc-cta-subtitle {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-bottom: 20px;
  line-height: var(--lh-normal);
}
.tf-calc-cta-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.tf-calc-cta-btns button {
  padding: 12px 22px;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  cursor: pointer;
  transition: opacity .18s, transform .18s;
}
.tf-calc-cta-btns .primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
}
.tf-calc-cta-btns .secondary {
  background: rgba(255,255,255,.07);
  color: var(--text);
  border: 1px solid var(--border);
}
.tf-calc-cta-btns button:hover { opacity: .88; transform: translateY(-1px); }

/* ============================================================
   END-OF-BLOG SECTION
   ============================================================ */
.tf-end-cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  margin: 48px 0 24px;
  position: relative;
  overflow: hidden;
}
.tf-end-cta::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.tf-end-cta-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.tf-end-cta-emoji { font-size: 2rem; }
.tf-end-cta-heading { font-size: var(--fs-xl); font-weight: var(--fw-bold); }
.tf-end-cta-subhead { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }

/* ── Trust Badges ── */
.tf-trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.tf-trust-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: var(--fs-xs);
  color: var(--muted);
  padding: 5px 12px;
}
.tf-trust-badge span { color: var(--accent); }

/* ── Responsive adjustments ── */
@media (max-width: 600px) {
  .tf-lead-form { padding: 20px; }
  .tf-end-cta { padding: 22px; }
  .tf-calc-cta { padding: 22px; }
  .tf-float-cta { bottom: 80px; }
}
