/* ==========================================================================
   Stepper Lead Capture Modal / Tab — Innoventory
   ========================================================================== */

/* ── Modal Backdrop ────────────────────────────────────── */
.sf-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 25, 18, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sf-modal-overlay.sf-open {
  opacity: 1;
  visibility: visible;
}

/* ── Modal Dialog Tab ──────────────────────────────────── */
.sf-modal-dialog {
  background: #ffffff;
  border-radius: 24px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(24, 78, 52, 0.08);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  position: relative;
}

.sf-modal-overlay.sf-open .sf-modal-dialog {
  transform: translateY(0) scale(1);
}

/* ── Modal Header Bar ──────────────────────────────────── */
.sf-modal-header {
  padding: 24px 28px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
  background: #ffffff;
}

.sf-modal-header-text {
  flex: 1;
}

.sf-modal-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #184e34;
  background: rgba(24, 78, 52, 0.08);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.sf-modal-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.sf-modal-subtitle {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.85rem;
  color: #64748b;
  margin: 4px 0 0;
}

.sf-modal-close {
  background: #f1f5f9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: 16px;
}

.sf-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: rotate(90deg);
}

.sf-modal-close svg {
  width: 18px;
  height: 18px;
}

/* ── Modal Body ────────────────────────────────────────── */
.sf-modal-body {
  padding: 24px 28px 28px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Step Indicators ───────────────────────────────────── */
.sf-indicators {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
}

.sf-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.sf-dot-inner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  background: #e8f0ec;
  color: #94a3b8;
  transition: background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.sf-dot.active .sf-dot-inner {
  background: #184e34;
  color: #ffffff;
  box-shadow: 0 0 0 5px rgba(24, 78, 52, 0.15);
}

.sf-dot.complete .sf-dot-inner {
  background: #184e34;
  color: #ffffff;
  font-size: 0;
}

.sf-dot.complete .sf-dot-inner::after {
  content: '';
  display: block;
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

/* Connector lines */
.sf-conn {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  position: relative;
  overflow: hidden;
  margin: 0 6px;
  border-radius: 2px;
}

.sf-conn-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0;
  background: #184e34;
  transition: width 0.4s ease;
  border-radius: 2px;
}

.sf-conn.complete .sf-conn-fill {
  width: 100%;
}

/* ── Panels ────────────────────────────────────────────── */
.sf-panels {
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
}

.sf-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(40px);
}

.sf-panel.active {
  position: relative;
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}

.sf-step-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 0 0 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.sf-question {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  display: block;
  margin-bottom: 16px;
  line-height: 1.4;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.sf-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: #0f172a;
  background: #f8fafc;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  outline: none;
  box-sizing: border-box;
}

.sf-input:focus {
  border-color: #184e34;
  box-shadow: 0 0 0 4px rgba(24, 78, 52, 0.1);
  background: #ffffff;
}

.sf-input.sf-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.sf-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-color: #f8fafc;
  padding-right: 48px;
}

.sf-select:focus {
  background-color: #ffffff;
}

/* ── Navigation ────────────────────────────────────────── */
.sf-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sf-btn-back {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #94a3b8;
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px 4px;
  transition: color 0.2s;
  letter-spacing: -0.01em;
}

.sf-btn-back:hover {
  color: #475569;
}

.sf-btn-back.sf-invisible {
  visibility: hidden;
  pointer-events: none;
}

.sf-btn-next,
.sf-btn-submit {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff;
  background: #184e34;
  border: none;
  border-radius: 40px;
  padding: 14px 28px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.01em;
}

.sf-btn-next:hover,
.sf-btn-submit:hover {
  background: #1e6b46;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(24, 78, 52, 0.3);
}

.sf-btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Success State ─────────────────────────────────────── */
.sf-success {
  text-align: center;
  padding: 24px 0 8px;
}

.sf-success-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #dcfce7;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.sf-success-icon svg {
  width: 30px;
  height: 30px;
  color: #15803d;
}

.sf-success-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.sf-success-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem;
  color: #475569;
  margin: 0 0 24px;
  line-height: 1.6;
}

.sf-btn-done {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #184e34;
  background: #e8f0ec;
  border: none;
  border-radius: 30px;
  padding: 12px 28px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sf-btn-done:hover {
  background: #d4e4db;
  color: #0d3120;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 640px) {
  .sf-modal-overlay {
    padding: 12px;
  }
  .sf-modal-dialog {
    max-height: 94vh;
    border-radius: 20px;
  }
  .sf-modal-header {
    padding: 18px 20px 14px;
  }
  .sf-modal-body {
    padding: 18px 20px 24px;
  }
  .sf-question {
    font-size: 1.1rem;
  }
  .sf-btn-next, .sf-btn-submit {
    padding: 13px 22px;
    font-size: 0.95rem;
  }
  .sf-dot {
    width: 28px;
    height: 28px;
  }
  .sf-dot-inner {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
}
