/* ============================================================
   HOWZIT PORTAL — Quote Flow Styles
   ============================================================
   Shared "Get 1-3 Quotes" modal used by both the blue "Get Quote"
   button (lead-form.js) and the "Submit All Inquiries" button
   (inquiry-system.js).

   Flow:
     Step A: Choose how many quotes you want (1-3)
     Step B: Forwarding notice + list of available businesses
             (or admin-fallback notice when none are available)
     Step C: Confirm & send -> dispatch_quotes API

   Theme matches lead-form.css (orange primary, navy secondary).
   ============================================================ */

/* ---------- Overlay & Modal ---------- */
/* Sized to match the "My Inquiries" sidebar pop-up (.inquiry-sidebar):
   a right-side panel, 380px wide, full viewport height. */
.quote-flow-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 2147483601;
  display: block;
  overflow: hidden;
  padding: 0;
  animation: qf-fade-in .25s ease;
}
@keyframes qf-fade-in { from { opacity: 0 } to { opacity: 1 } }

/* VERBATIM COPY of .inquiry-sidebar from style.css (user request: make the
   "Get Free Quotes" pop-up use exactly the same CSS as the "My Inquiries"
   pop-up so both are guaranteed identical on every device). */
.quote-flow-modal {
  position: fixed; top: 0; right: 0; width: 380px; height: 100%;
  background: #fff; z-index: 2147483602; box-shadow: -4px 0 20px rgba(0,0,0,0.2);
  transform: translateX(100%); transition: transform 0.3s ease;
  display: flex; flex-direction: column;
}
.quote-flow-modal.open { transform: translateX(0); }
/* Fallback slide-in for when the JS does not toggle the .open class. */
.quote-flow-modal:not(.open) { animation: qf-slide-in .3s ease forwards; }
@keyframes qf-slide-in {
  from { transform: translateX(100%) }
  to { transform: translateX(0) }
}

/* ---------- Header ---------- */
.quote-flow-header {
  background: linear-gradient(135deg, #0a0f2c, #16213e);
  color: #fff;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.quote-flow-header-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.quote-flow-header-title i { color: #ff8c40 }
.quote-flow-close {
  background: rgba(255, 255, 255, .1);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: .2s;
  flex-shrink: 0;
}
.quote-flow-close:hover { background: rgba(255, 255, 255, .25) }

/* ---------- Stepper ---------- */
.quote-flow-stepper {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  background: #f8f9fc;
  border-bottom: 1px solid #e9ecf3;
  gap: 6px;
  flex-wrap: nowrap;
}
.qf-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #a0a8b8;
  transition: .25s;
  flex: 1;
  min-width: 0;
}
.qf-step span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qf-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e9ecf3;
  color: #a0a8b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  transition: .25s;
}
.qf-step.active .qf-step-circle {
  background: linear-gradient(135deg, #ff6b00, #ff8c00);
  color: #fff;
}
.qf-step.active { color: #ff6b00 }
.qf-step.completed .qf-step-circle {
  background: #28a745;
  color: #fff;
}
.qf-step.completed { color: #28a745 }
.qf-step-line {
  flex: 0 0 20px;
  height: 2px;
  background: #e9ecf3;
  margin: 0 2px;
}
.qf-step-line.completed { background: #28a745 }

/* ---------- Body ---------- */
.quote-flow-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}
.qf-step-content { display: none }
.qf-step-content.active { display: block; animation: qf-fade-in .3s ease }

.qf-intro {
  font-size: 14px;
  color: #6a7388;
  line-height: 1.5;
  margin: 0 0 18px;
}
.qf-intro strong { color: #2a3553 }

/* ---------- Step A: Quote-count selector ---------- */
.qf-count-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}
@media (max-width: 420px) { .qf-count-grid { grid-template-columns: 1fr } }
.qf-count-card {
  border: 2px solid #e2e6ee;
  border-radius: 14px;
  padding: 20px 12px;
  cursor: pointer;
  transition: .2s;
  text-align: center;
  background: #fff;
  position: relative;
}
.qf-count-card:hover {
  border-color: #ffaa66;
  transform: translateY(-2px);
}
.qf-count-card.selected {
  border-color: #ff6b00;
  background: #fff5ed;
  box-shadow: 0 6px 18px rgba(255, 107, 0, .18);
}
.qf-count-num {
  font-size: 34px;
  font-weight: 900;
  color: #2a3553;
  line-height: 1;
  display: block;
}
.qf-count-card.selected .qf-count-num { color: #ff6b00 }
.qf-count-label {
  font-size: 13px;
  font-weight: 700;
  color: #5a6478;
  margin-top: 6px;
  display: block;
}
.qf-count-desc {
  font-size: 11px;
  color: #8a92a3;
  margin-top: 4px;
  display: block;
  line-height: 1.3;
}
.qf-count-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ff6b00, #ff8c00);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .5px;
  text-transform: uppercase;
  white-space: nowrap;
  display: none;
}
.qf-count-card.recommended .qf-count-badge { display: block }

/* ---------- Step B: Forwarding notice & business list ---------- */
.qf-notice {
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.qf-notice i { font-size: 18px; margin-top: 2px; flex-shrink: 0 }
.qf-notice-info {
  background: #f0f7ff;
  border: 1px solid #cce4ff;
  color: #1a5bb8;
}
.qf-notice-info i { color: #0066cc }
.qf-notice-warn {
  background: #fff8f0;
  border: 1px solid #ffe0b3;
  color: #b36a00;
}
.qf-notice-warn i { color: #ff8c00 }
.qf-notice strong { display: block; margin-bottom: 2px; color: inherit }

.qf-biz-list-title {
  font-size: 13px;
  font-weight: 700;
  color: #2a3553;
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.qf-biz-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}
.qf-biz-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid #e9ecf3;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  transition: .2s;
}
.qf-biz-item:hover { border-color: #ffaa66; background: #fffaf5 }
.qf-biz-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0a0f2c, #16213e);
  color: #ff8c40;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
}
.qf-biz-info { flex: 1; min-width: 0 }
.qf-biz-name {
  font-size: 14px;
  font-weight: 700;
  color: #2a3553;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qf-biz-name .qf-verified {
  color: #28a745;
  font-size: 12px;
  flex-shrink: 0;
}
.qf-biz-meta {
  font-size: 12px;
  color: #8a92a3;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.qf-biz-meta .qf-rating { color: #f5a623; font-weight: 600 }
.qf-biz-plan {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  flex-shrink: 0;
}
.qf-biz-plan.premium { background: #fff3e0; color: #e65100 }
.qf-biz-plan.pro { background: #e3f2fd; color: #1565c0 }

/* Loading state for business list */
.qf-biz-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px;
  color: #ff6b00;
  font-weight: 600;
  font-size: 14px;
}

/* ---------- Step C: Confirm summary ---------- */
.qf-summary {
  background: #f8f9fc;
  border: 1px solid #e9ecf3;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
}
.qf-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
}
.qf-summary-row + .qf-summary-row { border-top: 1px solid #eef1f6 }
.qf-summary-label { color: #8a92a3; font-weight: 600; flex-shrink: 0 }
.qf-summary-value { color: #2a3553; font-weight: 700; text-align: right; word-break: break-word }

/* ---------- Footer (navigation) ---------- */
.quote-flow-footer {
  padding: 16px 24px;
  background: #f8f9fc;
  border-top: 1px solid #e9ecf3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.qf-btn {
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: .25s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.qf-btn-back {
  background: #e9ecf3;
  color: #5a6478;
}
.qf-btn-back:hover { background: #dde2eb }
.qf-btn-next, .qf-btn-confirm {
  background: linear-gradient(135deg, #ff6b00, #ff8c00);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 107, 0, .25);
}
.qf-btn-next:hover, .qf-btn-confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 107, 0, .4);
}
.qf-btn-confirm {
  background: linear-gradient(135deg, #28a745, #2ecc71);
  box-shadow: 0 4px 16px rgba(40, 167, 69, .25);
}
.qf-btn-confirm:hover { box-shadow: 0 8px 24px rgba(40, 167, 69, .4) }
.qf-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important;
}
.qf-footer-spacer { flex: 1 }

/* ---------- Success / Error screens ---------- */
.qf-success, .qf-error-screen {
  text-align: center;
  padding: 36px 24px;
}
.qf-success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #28a745, #2ecc71);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 20px;
  animation: qf-pop .4s ease;
}
@keyframes qf-pop {
  from { transform: scale(0); opacity: 0 }
  to { transform: scale(1); opacity: 1 }
}
.qf-success-title {
  font-size: 24px;
  font-weight: 900;
  color: #2a3553;
  margin: 0 0 8px;
}
.qf-success-subtitle {
  font-size: 15px;
  color: #6a7388;
  margin: 0 0 20px;
  line-height: 1.5;
}
.qf-success-ref {
  background: #f0f7ff;
  border: 1px solid #cce4ff;
  border-radius: 10px;
  padding: 14px;
  margin: 0 auto 20px;
  max-width: 320px;
}
.qf-success-ref-label {
  font-size: 12px;
  color: #8a92a3;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.qf-success-ref-value {
  font-size: 22px;
  font-weight: 900;
  color: #0066cc;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
}
.qf-sent-to {
  background: #f0fff4;
  border: 1px solid #c6efce;
  border-radius: 10px;
  padding: 14px;
  margin: 0 auto 20px;
  max-width: 380px;
  text-align: left;
}
.qf-sent-to-title {
  font-size: 13px;
  font-weight: 700;
  color: #28a745;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.qf-sent-to-item {
  font-size: 13px;
  color: #2a3553;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.qf-sent-to-item i { color: #28a745; font-size: 12px }
.qf-success-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.qf-error-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fee;
  color: #e74c3c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 20px;
}
.qf-error-title {
  font-size: 22px;
  font-weight: 800;
  color: #2a3553;
  margin: 0 0 8px;
}
.qf-error-msg-text {
  font-size: 15px;
  color: #6a7388;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* ---------- Loading spinner ---------- */
.qf-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: #ff6b00;
  font-weight: 600;
}
.qf-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #ffe0cc;
  border-top-color: #ff6b00;
  border-radius: 50%;
  animation: qf-spin .8s linear infinite;
  flex-shrink: 0;
}
@keyframes qf-spin { to { transform: rotate(360deg) } }

/* ---------- Responsive stepper (fix: last steps hidden on the right) ---------- */
/* VERBATIM COPY of the .inquiry-sidebar media queries from style.css so the
   "Get Free Quotes" pop-up behaves exactly like the "My Inquiries" pop-up. */
@media (max-width: 640px) {
  .quote-flow-modal { width: 100%; }
  .quote-flow-stepper {
    padding: 12px 12px;
    gap: 4px;
  }
  .qf-step {
    gap: 5px;
    font-size: 11px;
    flex: 1 1 0;
    justify-content: center;
  }
  .qf-step-circle {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  .qf-step-line {
    flex: 0 0 10px;
  }
  .quote-flow-body {
    padding: 18px 14px;
  }
  .quote-flow-footer {
    padding: 14px;
  }
}

/* On very small screens, show only the active step's label in full and
   shrink the rest so nothing is cut off on the right. */
@media (max-width: 400px) {
  .qf-step span {
    max-width: 56px;
  }
  .qf-step.active span {
    max-width: none;
  }
}

/* VERBATIM COPY of the .inquiry-sidebar 414px rule from style.css. */
@media (max-width: 414px) {
  .quote-flow-modal { width: 100% !important; max-width: 100vw; }
}
