/*
 * QuotePro v2.1 – Front-end Styles
 * Fixes: (1) Red header → dark navy for legibility
 *        (2) Error states more visible
 *        (3) Scope selector styles
 */

/* ── CSS Variables ─────────────────────────────────────────────────────── */
:root {
  --qpro-accent:        #e84b3a;
  --qpro-accent-dark:   #c53727;
  --qpro-accent-light:  rgba(232,75,58,.08);
  --qpro-navy:          #1a2a3a;        /* header background – dark navy, max contrast */
  --qpro-navy-light:    #243447;
  --qpro-white:         #ffffff;
  --qpro-text:          #2c3e50;
  --qpro-text-muted:    #6b7a8d;
  --qpro-border:        #e2e8f0;
  --qpro-bg:            #f7f9fc;
  --qpro-success:       #27ae60;
  --qpro-success-bg:    rgba(39,174,96,.08);
  --qpro-error-color:   #c0392b;
  --qpro-error-bg:      #fef2f2;
  --qpro-warning:       #f39c12;
  --qpro-radius:        14px;
  --qpro-radius-sm:     8px;
  --qpro-shadow:        0 20px 60px rgba(0,0,0,.22);
  --qpro-shadow-sm:     0 4px 16px rgba(0,0,0,.1);
  --qpro-transition:    .22s ease;
}

/* ── Floating Action Button ──────────────────────────────────────────────── */
.qpro-fab-wrap {
  position: fixed;
  bottom: 90px;
  right: 18px;
  z-index: 9999990;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

/* Social proof badge */
.qpro-fab-badge {
  background: rgba(26,42,58,.88);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 20px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: .2px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.qpro-badge-pulse {
  width: 8px;
  height: 8px;
  background: #27ae60;
  border-radius: 50%;
  animation: qproBadgePulse 1.6s infinite;
  flex-shrink: 0;
}
@keyframes qproBadgePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(1.35); }
}

/* The button itself */
.qpro-fab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--qpro-accent);
  color: #fff;
  border: none;
  border-radius: 32px;
  padding: 13px 22px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .3px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(232,75,58,.5);
  transition: transform var(--qpro-transition), box-shadow var(--qpro-transition), background var(--qpro-transition);
  outline: none;
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.qpro-fab:hover,
.qpro-fab:focus {
  background: var(--qpro-accent-dark);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(232,75,58,.6);
}
.qpro-fab:active { transform: translateY(0); }
.qpro-fab-icon   { font-size: 16px; }

/* Pulse ring */
.qpro-fab-pulse {
  position: absolute;
  inset: -5px;
  border-radius: 32px;
  border: 3px solid var(--qpro-accent);
  opacity: 0;
  pointer-events: none;
  animation: qproPulse 2.8s infinite;
}
@keyframes qproPulse {
  0%   { transform: scale(1);    opacity: .7; }
  75%  { transform: scale(1.22); opacity: 0; }
  100% { transform: scale(1.22); opacity: 0; }
}

/* ── Modal Overlay ───────────────────────────────────────────────────────── */
.qpro-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,20,30,.6);
  z-index: 9999995;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 18px 115px;
  backdrop-filter: blur(4px);
  animation: qproFadeIn .18s ease;
}
.qpro-modal-overlay[hidden] { display: none !important; }

@keyframes qproFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Modal card */
.qpro-modal {
  background: var(--qpro-white);
  border-radius: var(--qpro-radius);
  box-shadow: var(--qpro-shadow);
  width: 440px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: qproSlideUp .22s ease;
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
}
.qpro-modal::-webkit-scrollbar       { width: 4px; }
.qpro-modal::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

@keyframes qproSlideUp {
  from { transform: translateY(28px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Modal Header (dark navy – maximum readability) ───────────────────── */
.qpro-modal-header {
  background: #1a2a3a !important;     /* hardcoded dark navy – overrides any theme */
  color: #ffffff !important;
  padding: 20px 22px;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  border-radius: var(--qpro-radius) var(--qpro-radius) 0 0;
  position: sticky;
  top: 0;
  z-index: 2;
}
/* Red left accent stripe */
.qpro-modal-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--qpro-accent);
  border-radius: var(--qpro-radius) 0 0 0;
}
.qpro-modal-header-icon {
  font-size: 22px;
  color: var(--qpro-accent);    /* red icon on dark bg – fully visible */
  padding-top: 2px;
  flex-shrink: 0;
}
.qpro-modal-title {
  margin: 0 0 3px;
  font-size: 17px;
  font-weight: 800;
  color: #ffffff !important;     /* pure white on dark – WCAG AA+ */
  line-height: 1.3;
}
.qpro-modal-subtitle {
  margin: 0;
  font-size: 12px;
  color: rgba(255,255,255,.85) !important;
  line-height: 1.4;
}
.qpro-modal-close {
  margin-left: auto;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--qpro-transition);
  font-size: 13px;
}
.qpro-modal-close:hover { background: rgba(255,255,255,.25); }

/* ── Progress Steps ──────────────────────────────────────────────────────── */
.qpro-steps {
  display: flex;
  align-items: center;
  padding: 14px 22px;
  background: var(--qpro-bg);
  border-bottom: 1px solid var(--qpro-border);
}
.qpro-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #b0bec5;
  transition: color var(--qpro-transition);
  flex: 0 0 auto;
}
.qpro-step span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #d0d7de;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  transition: background var(--qpro-transition);
}
.qpro-step.active      { color: var(--qpro-navy); }
.qpro-step.active span { background: var(--qpro-accent); }
.qpro-step.done span   { background: var(--qpro-success); }
.qpro-step-line {
  flex: 1;
  height: 2px;
  background: #d0d7de;
  margin: 0 6px;
}

/* ── Modal Body ──────────────────────────────────────────────────────────── */
.qpro-modal-body { padding: 22px; }

/* ── Scope Selector (NEW) ────────────────────────────────────────────────── */
.qpro-scope-group {
  margin-bottom: 18px;
}
.qpro-scope-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--qpro-text);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.qpro-scope-title i { color: var(--qpro-accent); }

.qpro-scope-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qpro-scope-card {
  cursor: pointer;
  display: block;
}
.qpro-scope-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.qpro-scope-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--qpro-border);
  border-radius: var(--qpro-radius-sm);
  background: #fdfdfd;
  transition: all var(--qpro-transition);
}
.qpro-scope-inner:hover { border-color: #c8d0da; background: #fff; }
.qpro-scope-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--qpro-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--qpro-text-muted);
  flex-shrink: 0;
  transition: all var(--qpro-transition);
}
.qpro-scope-info { flex: 1; }
.qpro-scope-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--qpro-text);
  display: block;
}
.qpro-scope-desc {
  font-size: 11px;
  color: var(--qpro-text-muted);
  margin-top: 1px;
  display: block;
}
.qpro-scope-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--qpro-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--qpro-transition);
  color: transparent;
  font-size: 10px;
}
/* Selected state */
.qpro-scope-card input:checked + .qpro-scope-inner {
  border-color: var(--qpro-accent);
  background: var(--qpro-accent-light);
}
.qpro-scope-card input:checked + .qpro-scope-inner .qpro-scope-icon {
  background: var(--qpro-accent);
  color: #fff;
}
.qpro-scope-card input:checked + .qpro-scope-inner .qpro-scope-label {
  color: var(--qpro-accent);
}
.qpro-scope-card input:checked + .qpro-scope-inner .qpro-scope-check {
  background: var(--qpro-accent);
  border-color: var(--qpro-accent);
  color: #fff;
}

/* Scope count badge */
.qpro-scope-count {
  display: inline-flex;
  align-items: center;
  background: var(--qpro-bg);
  color: var(--qpro-text-muted);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 6px;
  border: 1px solid var(--qpro-border);
}

/* Listing multi-select panel (shown for "selected" scope) */
.qpro-listing-select-wrap { margin-top: 12px; }

/* ── Form Elements ───────────────────────────────────────────────────────── */
.qpro-form-step { animation: qproFadeIn .18s ease; }
.qpro-hidden    { display: none !important; }

.qpro-field-group { margin-bottom: 16px; }
.qpro-field-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.qpro-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--qpro-text);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.qpro-label i     { margin-right: 5px; color: var(--qpro-accent); }
.qpro-required    { color: var(--qpro-error-color); margin-left: 2px; font-weight: 900; }
.qpro-optional    { color: #aab; font-weight: 400; text-transform: none; font-size: 11px; }

.qpro-input,
.qpro-textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--qpro-border);
  border-radius: var(--qpro-radius-sm);
  font-size: 14px;
  color: var(--qpro-text);
  background: #fff;
  transition: border-color var(--qpro-transition), box-shadow var(--qpro-transition);
  box-sizing: border-box;
  font-family: inherit;
}
.qpro-input:focus,
.qpro-textarea:focus {
  outline: none;
  border-color: var(--qpro-accent);
  box-shadow: 0 0 0 3px rgba(232,75,58,.12);
}
.qpro-input.qpro-invalid,
.qpro-textarea.qpro-invalid {
  border-color: var(--qpro-error-color);
  background: var(--qpro-error-bg);
}
.qpro-textarea { resize: vertical; min-height: 80px; }

/* Select2 overrides */
.qpro-modal .select2-container { width: 100% !important; }
.qpro-modal .select2-selection--multiple {
  border: 1.5px solid var(--qpro-border) !important;
  border-radius: var(--qpro-radius-sm) !important;
  min-height: 44px !important;
  padding: 4px 8px !important;
}
.qpro-modal .select2-selection__choice {
  background: var(--qpro-navy) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 5px !important;
  padding: 3px 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}
.qpro-modal .select2-selection__choice__remove { color: rgba(255,255,255,.7) !important; }

/* Error messages – very visible */
.qpro-error {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--qpro-error-color);
  margin-top: 5px;
  min-height: 16px;
  background: var(--qpro-error-bg);
  border-radius: 5px;
  padding: 4px 8px;
  border-left: 3px solid var(--qpro-error-color);
}
.qpro-error:empty { background: transparent; padding: 0; border: none; min-height: 0; }

/* Hint */
.qpro-field-hint    { font-size: 11px; color: var(--qpro-text-muted); margin-top: 5px; display: block; }
.qpro-refresh-listings { color: var(--qpro-accent); text-decoration: none; font-weight: 600; }
.qpro-refresh-listings:hover { text-decoration: underline; }

/* Char counter */
.qpro-char-count { font-size: 11px; color: #aab; text-align: right; display: block; margin-top: 2px; }

/* ── Radio Cards (preference) ────────────────────────────────────────────── */
.qpro-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qpro-radio-card { cursor: pointer; display: block; }
.qpro-radio-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.qpro-radio-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid var(--qpro-border);
  border-radius: var(--qpro-radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--qpro-text);
  transition: all var(--qpro-transition);
  background: #fdfdfd;
}
.qpro-radio-inner i {
  color: var(--qpro-accent);
  font-size: 15px;
  width: 18px;
  text-align: center;
}
.qpro-radio-card input:checked + .qpro-radio-inner {
  border-color: var(--qpro-accent);
  background: var(--qpro-accent-light);
  color: var(--qpro-navy);
}
.qpro-radio-inner:hover { border-color: #c0cad6; }

/* ── Trust Badges ────────────────────────────────────────────────────────── */
.qpro-trust {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 14px 0;
  flex-wrap: wrap;
  padding: 10px;
  background: var(--qpro-bg);
  border-radius: var(--qpro-radius-sm);
  border: 1px solid var(--qpro-border);
}
.qpro-trust span {
  font-size: 11px;
  color: var(--qpro-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}
.qpro-trust i { color: var(--qpro-success); }

/* ── Navigation Buttons ──────────────────────────────────────────────────── */
.qpro-step-nav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--qpro-border);
}

.qpro-btn-next,
.qpro-btn-submit {
  background: var(--qpro-accent);
  color: #fff;
  border: none;
  border-radius: var(--qpro-radius-sm);
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background var(--qpro-transition), transform var(--qpro-transition), box-shadow var(--qpro-transition);
  letter-spacing: .2px;
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.qpro-btn-next:hover,
.qpro-btn-submit:hover {
  background: var(--qpro-accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(232,75,58,.4);
}
.qpro-btn-next:disabled,
.qpro-btn-submit:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.qpro-btn-ghost {
  background: transparent;
  color: var(--qpro-text-muted);
  border: 1.5px solid var(--qpro-border);
  border-radius: var(--qpro-radius-sm);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--qpro-transition);
}
.qpro-btn-ghost:hover { border-color: #a0b0c0; color: var(--qpro-text); background: var(--qpro-bg); }

/* ── Scope summary (shown in step 2/3 header) ────────────────────────────── */
.qpro-scope-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--qpro-navy);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--qpro-radius-sm);
  margin-bottom: 16px;
}
.qpro-scope-summary i { color: var(--qpro-accent); }
.qpro-scope-summary span { opacity: .8; }

/* ── Success State ───────────────────────────────────────────────────────── */
.qpro-success {
  text-align: center;
  padding: 36px 24px;
  animation: qproFadeIn .35s ease;
}
.qpro-success-icon {
  font-size: 58px;
  color: var(--qpro-success);
  margin-bottom: 14px;
  animation: qproPopIn .4s .1s both;
}
@keyframes qproPopIn {
  0%   { transform: scale(.35); opacity: 0; }
  80%  { transform: scale(1.12); }
  100% { transform: scale(1);   opacity: 1; }
}
.qpro-success h3 { margin: 0 0 8px; font-size: 21px; font-weight: 800; color: var(--qpro-text); }
.qpro-success p  { color: var(--qpro-text-muted); margin: 0 0 22px; font-size: 14px; }

/* ── Global alert message (inline) ──────────────────────────────────────── */
.qpro-form-alert {
  padding: 12px 16px;
  border-radius: var(--qpro-radius-sm);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-left: 4px solid;
}
.qpro-form-alert.error {
  background: #c0392b !important;  /* solid red – always visible */
  color: #ffffff !important;       /* white text on red – max contrast */
  border-color: #922b21 !important;
  border-left-width: 5px;
}
.qpro-form-alert.success {
  background: var(--qpro-success-bg);
  color: #155724;
  border-color: var(--qpro-success);
}

/* ── Inline shortcode embed ──────────────────────────────────────────────── */
.qpro-inline-wrap {
  border: 1px solid var(--qpro-border);
  border-radius: var(--qpro-radius);
  padding: 24px;
  background: var(--qpro-white);
  box-shadow: var(--qpro-shadow-sm);
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .qpro-fab-wrap    { bottom: 68px; right: 10px; }
  .qpro-fab         { padding: 14px; border-radius: 50%; gap: 0; }
  .qpro-fab-text    { display: none; }
  .qpro-fab-icon    { font-size: 18px; }

  .qpro-modal-overlay { padding: 0; align-items: flex-end; }
  .qpro-modal { width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; }
  .qpro-modal-header::before { border-radius: 18px 0 0 0; }

  .qpro-field-row   { grid-template-columns: 1fr; }
  .qpro-scope-cards { gap: 6px; }
  .qpro-step-nav    { flex-direction: column-reverse; }
  .qpro-btn-next,
  .qpro-btn-submit  { width: 100%; justify-content: center; }
  .qpro-btn-ghost   { width: 100%; justify-content: center; }
}
