{
  "$schema": "https://schemas.wp.org/trunk/block.json",
  "apiVersion": 3,
  "name": "bpsc/lead-quiz-section",
  "version": "1.0.0",
  "title": "Lead Quiz Section",
  "category": "bPlugins",
  "description": "An interactive multi-step quiz section that qualifies leads and recommends products — five layout styles.",
  "keywords": [
    "quiz",
    "lead quiz",
    "recommendation quiz",
    "product finder",
    "interactive",
    "section"
  ],
  "textdomain": "section-collection",
  "attributes": {
    "themeStyle": {
      "type": "object",
      "default": {
        "theme": "style-1"
      }
    },
    "content": {
      "type": "object",
      "default": {
        "badgeText": "Quick Quiz",
        "title": "Find the Right Plan for You",
        "subtitle": "Answer 3 quick questions and we'll match you with the perfect solution.",
        "startButtonLabel": "Take the Quiz",
        "questions": [
          {
            "id": "q1",
            "question": "What best describes your team size?",
            "inputType": "button",
            "choices": [
              {
                "id": "q1a",
                "label": "Just me",
                "value": "solo"
              },
              {
                "id": "q1b",
                "label": "2–10 people",
                "value": "small"
              },
              {
                "id": "q1c",
                "label": "11–50 people",
                "value": "mid"
              },
              {
                "id": "q1d",
                "label": "50+ people",
                "value": "enterprise"
              }
            ]
          },
          {
            "id": "q2",
            "question": "What is your primary goal?",
            "inputType": "button",
            "choices": [
              {
                "id": "q2a",
                "label": "Save time",
                "value": "time"
              },
              {
                "id": "q2b",
                "label": "Grow revenue",
                "value": "revenue"
              },
              {
                "id": "q2c",
                "label": "Reduce costs",
                "value": "costs"
              },
              {
                "id": "q2d",
                "label": "Improve quality",
                "value": "quality"
              }
            ]
          },
          {
            "id": "q3",
            "question": "How soon are you looking to start?",
            "inputType": "button",
            "choices": [
              {
                "id": "q3a",
                "label": "Right now",
                "value": "now"
              },
              {
                "id": "q3b",
                "label": "Within a month",
                "value": "month"
              },
              {
                "id": "q3c",
                "label": "Just exploring",
                "value": "exploring"
              }
            ]
          }
        ],
        "results": [
          {
            "id": "r1",
            "label": "Starter",
            "heading": "You're a great fit for the Starter plan",
            "description": "Perfect for solo users and small projects. Everything you need to hit the ground running.",
            "icon": "rocket",
            "ctaLabel": "Get Started Free",
            "ctaUrl": "#",
            "ctaNewTab": false,
            "conditions": [
              {
                "questionId": "q1",
                "value": "solo"
              }
            ]
          },
          {
            "id": "r2",
            "label": "Pro",
            "heading": "The Pro plan is built for teams like yours",
            "description": "Collaboration tools, advanced analytics, and priority support for growing teams.",
            "icon": "star",
            "ctaLabel": "See Pro Features",
            "ctaUrl": "#",
            "ctaNewTab": false,
            "conditions": [
              {
                "questionId": "q1",
                "value": "small"
              }
            ]
          },
          {
            "id": "r3",
            "label": "Business",
            "heading": "Go further with the Business plan",
            "description": "Dedicated success manager, SSO, custom integrations, and SLA-backed uptime.",
            "icon": "briefcase",
            "ctaLabel": "Talk to Sales",
            "ctaUrl": "#",
            "ctaNewTab": false,
            "conditions": [
              {
                "questionId": "q1",
                "value": "mid"
              }
            ]
          },
          {
            "id": "r-default",
            "label": "Enterprise",
            "heading": "Let's build something custom",
            "description": "Enterprise contracts, volume pricing, and white-glove onboarding for large organisations.",
            "icon": "building",
            "ctaLabel": "Contact Us",
            "ctaUrl": "#",
            "ctaNewTab": false,
            "conditions": []
          }
        ],
        "showEmailCapture": false,
        "emailCapturePlaceholder": "Enter your email to see results",
        "emailCaptureButtonLabel": "Show My Results",
        "retakeLabel": "Retake Quiz",
        "showProgressBar": true,
        "progressStyle": "bar"
      }
    },
    "elements": {
      "type": "object",
      "default": {
        "isBadge": true,
        "isTitle": true,
        "isSubtitle": true,
        "isProgressBar": true,
        "isRetakeButton": true,
        "isEmailCapture": false,
        "isResultIcon": true
      }
    },
    "wrapper": {
      "type": "object",
      "default": {
        "bg": {
          "type": "solid",
          "color": "#f8fafc",
          "gradient": "linear-gradient(135deg, #f0f9ff 0%, #faf5ff 100%)",
          "overlayColor": "rgba(0,0,0,0)",
          "image": {
            "url": ""
          },
          "position": "center center",
          "repeat": "no-repeat",
          "size": "cover"
        },
        "padding": {
          "desktop": {
            "top": "80px",
            "right": "24px",
            "bottom": "80px",
            "left": "24px"
          },
          "tablet": {
            "top": "60px",
            "right": "20px",
            "bottom": "60px",
            "left": "20px"
          },
          "mobile": {
            "top": "48px",
            "right": "16px",
            "bottom": "48px",
            "left": "16px"
          }
        }
      }
    },
    "layout": {
      "type": "object",
      "default": {
        "contentAlign": "center",
        "maxWidth": "720px",
        "quizPanelMaxWidth": "640px"
      }
    },
    "accentColor": {
      "type": "object",
      "default": {
        "color": "#6366f1"
      }
    },
    "titleStyle": {
      "type": "object",
      "default": {
        "color": "#111827",
        "typo": {
          "fontCategory": "sans-serif",
          "fontFamily": "Default",
          "fontWeight": 700,
          "isUploadFont": true,
          "fontSize": {
            "desktop": 40,
            "tablet": 32,
            "mobile": 26
          },
          "lineHeight": "1.2",
          "letterSpace": "0px"
        }
      }
    },
    "subtitleStyle": {
      "type": "object",
      "default": {
        "color": "#6b7280",
        "typo": {
          "fontCategory": "sans-serif",
          "fontFamily": "Default",
          "fontWeight": 400,
          "isUploadFont": true,
          "fontSize": {
            "desktop": 18,
            "tablet": 16,
            "mobile": 15
          },
          "lineHeight": "1.65",
          "letterSpace": "0px"
        }
      }
    },
    "badgeStyle": {
      "type": "object",
      "default": {
        "colors": {
          "color": "#2563eb",
          "bg": "#eff6ff"
        },
        "borderRadius": {
          "top": "20px",
          "right": "20px",
          "bottom": "20px",
          "left": "20px"
        },
        "typo": {
          "fontCategory": "sans-serif",
          "fontFamily": "Default",
          "fontWeight": 600,
          "isUploadFont": true,
          "fontSize": {
            "desktop": 13,
            "tablet": 13,
            "mobile": 13
          }
        }
      }
    },
    "quizPanelStyle": {
      "type": "object",
      "default": {
        "bg": "#ffffff",
        "borderRadius": {
          "top": "16px",
          "right": "16px",
          "bottom": "16px",
          "left": "16px"
        },
        "shadow": "0 8px 24px -4px rgba(0,0,0,0.10)",
        "padding": {
          "desktop": {
            "top": "40px",
            "right": "40px",
            "bottom": "40px",
            "left": "40px"
          },
          "tablet": {
            "top": "28px",
            "right": "28px",
            "bottom": "28px",
            "left": "28px"
          },
          "mobile": {
            "top": "20px",
            "right": "16px",
            "bottom": "20px",
            "left": "16px"
          }
        }
      }
    },
    "questionStyle": {
      "type": "object",
      "default": {
        "color": "#111827",
        "typo": {
          "fontCategory": "sans-serif",
          "fontFamily": "Default",
          "fontWeight": 600,
          "isUploadFont": true,
          "fontSize": {
            "desktop": 22,
            "tablet": 20,
            "mobile": 18
          },
          "lineHeight": "1.35",
          "letterSpace": "0px"
        }
      }
    },
    "choiceStyle": {
      "type": "object",
      "default": {
        "bg": "#f9fafb",
        "bgHover": "#eff6ff",
        "bgActive": "#dbeafe",
        "borderColor": "#e5e7eb",
        "borderColorActive": "#3b82f6",
        "textColor": "#374151",
        "textColorActive": "#1d4ed8",
        "borderRadius": {
          "top": "10px",
          "right": "10px",
          "bottom": "10px",
          "left": "10px"
        },
        "typo": {
          "fontCategory": "sans-serif",
          "fontFamily": "Default",
          "fontWeight": 500,
          "isUploadFont": true,
          "fontSize": {
            "desktop": 15,
            "tablet": 14,
            "mobile": 14
          }
        }
      }
    },
    "progressBarStyle": {
      "type": "object",
      "default": {
        "trackColor": "#e5e7eb",
        "fillColor": "#6366f1",
        "height": "6px",
        "borderRadius": "4px"
      }
    },
    "resultCardStyle": {
      "type": "object",
      "default": {
        "bg": "#f0f9ff",
        "borderColor": "#bfdbfe",
        "borderRadius": {
          "top": "16px",
          "right": "16px",
          "bottom": "16px",
          "left": "16px"
        },
        "headingColor": "#111827",
        "descColor": "#374151",
        "iconColor": "#6366f1",
        "iconBg": "#dbeafe"
      }
    },
    "ctaBtnStyle": {
      "type": "object",
      "default": {
        "bgColor": {
          "normal": {
            "color": "#ffffff",
            "bg": "#6366f1"
          },
          "hover": {
            "color": "#ffffff",
            "bg": "#4f46e5"
          }
        },
        "borderRadius": {
          "top": "8px",
          "right": "8px",
          "bottom": "8px",
          "left": "8px"
        },
        "padding": {
          "desktop": {
            "top": "14px",
            "right": "32px",
            "bottom": "14px",
            "left": "32px"
          },
          "tablet": {
            "top": "12px",
            "right": "24px",
            "bottom": "12px",
            "left": "24px"
          },
          "mobile": {
            "top": "11px",
            "right": "20px",
            "bottom": "11px",
            "left": "20px"
          }
        },
        "typo": {
          "fontCategory": "sans-serif",
          "fontFamily": "Default",
          "fontWeight": 600,
          "isUploadFont": true,
          "fontSize": {
            "desktop": 15,
            "tablet": 14,
            "mobile": 14
          }
        }
      }
    },
    "retakeBtnStyle": {
      "type": "object",
      "default": {
        "bgColor": {
          "normal": {
            "color": "#6b7280"
          },
          "hover": {
            "color": "#374151"
          }
        },
        "typo": {
          "fontCategory": "sans-serif",
          "fontFamily": "Default",
          "fontWeight": 500,
          "isUploadFont": true,
          "fontSize": {
            "desktop": 14,
            "tablet": 14,
            "mobile": 14
          }
        }
      }
    },
    "align": {
      "type": "string",
      "default": "full"
    }
  },
  "supports": {
    "align": [
      "wide",
      "full"
    ],
    "html": false
  },
  "example": {
    "attributes": {}
  },
  "editorScript": "file:../index.js",
  "style": "file:./view.css",
  "render": "file:./render.php",
  "viewScript": "file:./view.js"
}