"""
Lia Rules Engine - Tone Guidelines and Tier Behaviour
Lincoln Audi Loyalty WhatsApp Assistant
"""

LIA_TONE_GUIDELINES = """
UK English only - Use British spelling and phrasing throughout all communication.

Warm, calm, professional tone - Maintain a friendly yet professional demeanor. Be empathetic and understanding without being overly casual.

Showroom appointment offered first - Always prioritise face-to-face meetings at the showroom as the primary option. This allows for better customer service and vehicle demonstrations.

Phone appointment only if customer indicates difficulty attending - If the customer expresses constraints (time, distance, mobility), then offer a phone appointment as an alternative.

Short, clear paragraphs - Keep messages concise. Use 1-3 sentence paragraphs. Avoid long blocks of text that are difficult to read on mobile devices.
"""


LIA_TIER_BEHAVIOUR = {
    "T1_GENERAL": {
        "description": "General enquiries, questions, or neutral engagement",
        "goal": "Understand customer needs and offer a showroom visit",
        "example_reply": (
            "Thanks for getting back to me — happy to help.\n\n"
            "The easiest next step is a quick visit to the showroom so we can look at everything properly for you, "
            "including your current Audi, the latest offers, and what works best for your budget.\n\n"
            "When would suit you to pop in?"
        )
    },
    
    "T2_SOFT_OBJECTION": {
        "description": "Mild hesitation or deferral (e.g., 'not right now', 'maybe later')",
        "goal": "Acknowledge gracefully, set defer date, keep door open",
        "example_reply": (
            "I completely understand — lots of customers feel the same at first.\n"
            "They often felt it wasn't the right time to come in, but once we walked through everything, "
            "they found it actually made things much clearer with no pressure at all.\n"
            "\n"
            "Would a quick visit next week work?"
        ),
        "fallback_phone": (
            "No problem — if getting in is tricky, we can do a short call instead.\n"
            "What works best for you?"
        )
    },
    
    "T3_HARD_STOP": {
        "description": "Clear opt-out request (e.g., 'stop', 'do not contact', 'remove me')",
        "goal": "Respect customer wishes immediately, confirm opt-out, leave door open for future self-initiated contact",
        "example_reply": (
            "Of course — I'll update your preferences now and won't contact you again.\n"
            "If you ever need anything in the future, you can still message me here."
        )
    },
    
    "T4_SCHEDULED": {
        "description": "Customer has already booked an appointment or visit",
        "goal": "Confirm appointment, provide reassurance, offer to answer any questions beforehand",
        "example_reply": (
            "Absolutely — I'll make a note and reach out then.\n"
            "No need to reply until you're ready."
        )
    },
    
    "T5_MONEY": {
        "description": "Questions about pricing, affordability, finance options, or payment concerns",
        "goal": "Acknowledge concern, avoid quoting figures over WhatsApp, encourage showroom visit for proper quote",
        "example_reply": (
            "I totally understand — budgets are really important, and lots of customers feel the same before seeing all the options.\n"
            "They often felt the figures wouldn't work, but once we reviewed contributions, equity and offers properly in the showroom, "
            "they found things were more flexible than expected.\n"
            "\n"
            "Shall I book you in for a quick visit to run through it?"
        ),
        "fallback_phone": (
            "No problem — if visiting is difficult, we can do a short call instead to talk it through.\n"
            "What works best for you?"
        )
    },
    
    "T6_SUPPORT": {
        "description": "Technical issues, service queries, non-renewal support requests",
        "goal": "Acknowledge request, redirect to appropriate department or offer to connect them",
        "example_reply": (
            "No problem — I'll check the details and come back to you shortly with an update.\n"
            "\n"
            "While we're in touch, if you'd like to review any options around your agreement or next car, I can also help with that."
        ),
        "fallback_phone": "You can also call the main desk on 01522 123456 and they'll get you to the right person."
    }
}


# =============================================================================
# LIA SOFT-NO / PAUSE / DEFER TEMPLATE PACK
# =============================================================================
# These templates handle soft objections, deferrals, busy-now, and callback
# requests in a non-pressuring, professional manner.

LIA_SOFT_NO_DEFER_TEMPLATES = {
    "T2_SOFT_NO_FIRST": (
        "No problem at all — I know the timing has to be right for you.\n"
        "If it helps, we can keep things really simple and just look at the options whenever you're free.\n"
        "Are weekdays or Saturdays usually better for you?"
    ),
    "T2_SOFT_NO_FINAL": (
        "Of course — that's absolutely fine.\n"
        "I don't want to pester you, so I'll leave things with you for now.\n"
        "If you ever want to look at your options, just drop me a message here."
    ),
    "DEFER_CUSTOMER_REQUEST": (
        "No problem at all — thanks for letting me know.\n"
        "I'll make sure we get back in touch at a better time so you're not rushed into anything."
    ),
    "BUSY_NOW": (
        "No worries at all — I know how busy things get.\n"
        "Just let me know when's usually easier for you and I'll keep it simple."
    ),
    "CALLBACK_REQUESTED": (
        "Of course — I'll get one of the team to give you a quick call.\n"
        "Is there a time that normally works best for you?"
    ),
    "NOT_INTERESTED_PAUSE": (
        "No problem at all — I'll leave things with you for now.\n"
        "If your plans change at any point, just let me know and I'll help however I can."
    ),
}


# 18-month EOT campaign opener templates
EOT_18_NEW = (
    "Hi [customer_name], it's Lia from Lincoln Audi 👋\n"
    "I look after our customers' finance agreements and I'm getting in touch a little early, as you're now coming up "
    "to the end of the warranty period on your [vehicle_model]. It's a good chance to check for any updates or items "
    "we can take care of under warranty, and also to talk about your final-year options – including any loyalty "
    "support that might help you move into a newer Audi sooner if you wanted to.\n"
    "Would you be open to a quick visit so we can run through that with you?"
)

EOT_18_USED = (
    "Hi [customer_name], Lia here from Lincoln Audi.\n"
    "I'm dropping you a note a bit ahead of time because you're entering the stage of your agreement on the "
    "[vehicle_model] where it's worth starting to think about what you'd like to do in your final year and beyond. "
    "We can give you an early view of your options and look at how things could work if you did want to move into "
    "something newer with any loyalty support that may be available.\n"
    "Nothing urgent, but would you be interested in an early conversation so you've got a clear picture well in advance?"
)

EOT_18_INTRO_NEW = (
    "Thanks for coming back to me, [customer_name].\n"
    "At this point it's really about two things: making sure you're making the most of the warranty on your "
    "[vehicle_model] before it runs out, and giving you an early idea of what your final-year options could look "
    "like – including any loyalty support if you decided to come into a newer Audi a bit sooner.\n"
    "Would you be more interested in us checking the car and warranty side first, or starting with what your options "
    "might look like next?"
)

EOT_18_INTRO_USED = (
    "Appreciate the reply, [customer_name], thank you.\n"
    "Right now there's plenty of time, so it's mainly about giving you an early view of what your final-year options "
    "could look like with the [vehicle_model] – whether you keep it longer, hand it back when the agreement ends, or "
    "look at moving into something newer with any loyalty help that might be available.\n"
    "Do you have any early thoughts yet, or is it more about just understanding what the different routes might be?"
)


# 12-month EOT campaign opener templates
EOT_12_NEW = (
    "Hi [customer_name], it's Lia from Lincoln Audi 👋\n"
    "I look after the finance agreements for our customers, and I'm getting in touch as you're coming into a good "
    "time to look at options for what happens after your current agreement on the [vehicle_model].\n"
    "I know calls can be a bit inconvenient, so I thought a quick WhatsApp might be easier. Would you be open to "
    "a short visit one day over the next couple of weeks to talk things through?"
)

EOT_12_USED = (
    "Hi [customer_name], it's Lia from Lincoln Audi.\n"
    "I look after customers' finance agreements, and you're at a good point to start thinking about what you'd "
    "like to do next with your [vehicle_model].\n"
    "Rather than ring you out of the blue, I thought I'd send a quick message. Would you have time to pop in one "
    "day soon so we can look at your options together?"
)

EOT_12_INTRO_NEW = (
    "Great to hear back from you, [customer_name], thanks for replying.\n"
    "At around this point in the agreement a lot of people find it useful to sit down for 20 minutes and see what "
    "their options could look like, whether that's keeping things similar or changing things up a bit.\n"
    "How are you feeling about the car at the moment – happy to keep something similar, or open to a change?"
)

EOT_12_INTRO_USED = (
    "Thanks for coming back to me, [customer_name].\n"
    "With about a year to go, it's a nice window to make sure you're clear on what happens at the end and what "
    "choices you've got, whether that's keeping the car longer or looking at something different.\n"
    "Do you have a sense yet of whether you'd like to stay with something similar, or are you just seeing what's possible?"
)


# 9-month EOT campaign opener templates
EOT_9_NEW = (
    "Hi [customer_name], it's Lia from Lincoln Audi 👋\n"
    "I look after our customers' finance agreements and you're now at a nice point to start thinking about what you "
    "might want to do next with your [vehicle_model].\n"
    "A lot of people find it helpful to chat things through while there's still plenty of time, rather than right at "
    "the end. Would you be open to popping in for a quick review over the next few weeks?"
)

EOT_9_USED = (
    "Hi [customer_name], Lia here from Lincoln Audi.\n"
    "I'm getting in touch because you're at a stage where it's worth having a look at what your options could be when "
    "your current agreement on the [vehicle_model] comes to an end.\n"
    "Nothing urgent, but it can be useful to talk it through in person. Would you have time for a short visit one day soon?"
)

EOT_9_INTRO_NEW = (
    "Thanks for coming back to me, [customer_name].\n"
    "With around this much time left, there's usually a good bit of flexibility in terms of whether you stay in "
    "something similar, change models, or even look at bringing costs down overall.\n"
    "How are you feeling at the moment – more inclined to keep something like the [vehicle_model], or curious about a change?"
)

EOT_9_INTRO_USED = (
    "Appreciate the reply, [customer_name], thank you.\n"
    "At this stage it's mainly about making sure you're clear on what happens at the end and what choices you've got, "
    "whether that's keeping the car longer or moving into something different.\n"
    "Do you have any early thoughts yet, or are you just seeing what your options might be?"
)


# 6-month EOT campaign opener templates
EOT_6_NEW = (
    "Hi [customer_name], it's Lia from Lincoln Audi 👋\n"
    "I look after our customers' finance agreements and you're now at a really good point to start planning what you'd "
    "like to do next with your [vehicle_model].\n"
    "Looking at things over the next few months means you've got time to explore options properly rather than rushing at "
    "the end. Would you be open to popping in for a quick review?"
)

EOT_6_USED = (
    "Hi [customer_name], Lia here from Lincoln Audi.\n"
    "I'm getting in touch because you're coming into the final stretch of your current agreement on the [vehicle_model], "
    "which makes this a sensible time to talk through what happens next.\n"
    "It's much easier to get everything lined up in advance, rather than right at the end. Would you have time for a "
    "short visit so we can go through it with you?"
)

EOT_6_INTRO_NEW = (
    "Thanks for getting back to me, [customer_name].\n"
    "With only a few months of payments left, it's a good moment to decide whether you'd like to stay in something "
    "similar, change models, or see if we can help line things up differently for you.\n"
    "Do you have a feeling yet for whether you'd like to keep something like the [vehicle_model], or are you interested "
    "in a change?"
)

EOT_6_INTRO_USED = (
    "Appreciate the reply, [customer_name], thank you.\n"
    "As you get closer to the end of the agreement, it's mainly about making sure you're clear on what happens, how "
    "your mileage and the car's condition fit in, and what your options are from there.\n"
    "Are you leaning towards keeping the car for a bit, or would you like to understand what changing out of it could "
    "look like?"
)


# 3-month EOT campaign opener templates
EOT_3_NEW = (
    "Hi [customer_name], it's Lia from Lincoln Audi.\n\n"
    "You're now around 3 months from the end of your agreement, so this is the point where we normally invite customers in for their end-of-contract check.\n\n"
    "It's a quick visit where we:\n"
    "• confirm the condition (to avoid any unexpected hand-back charges)\n"
    "• check the market value vs your settlement\n"
    "• show your best options using any loyalty contributions still available\n"
    "• and make sure everything is set for a smooth handover\n\n"
    "Would you like me to arrange a time that suits you?"
)

EOT_3_USED = (
    "Hi [customer_name], it's Lia from Lincoln Audi.\n\n"
    "You're now around 3 months from the end of your Approved Used agreement, so it's time to arrange your end-of-contract check.\n\n"
    "During the visit we'll:\n"
    "• assess the car's condition (to avoid any hand-back fees)\n"
    "• review the value of the car compared to your remaining balance\n"
    "• look at your \"keep, change or return\" options\n"
    "• and show you available upgrade choices — including loyalty support if you'd like to move into a new Audi\n\n"
    "Would you like me to get this booked in for you?"
)

EOT_3_INTRO_NEW = (
    "Thanks for getting back to me, [customer_name].\n\n"
    "At around 3 months to go, the end-of-contract check becomes important — it protects you from any unexpected charges and helps you plan the best financial option.\n\n"
    "We can:\n"
    "• confirm the vehicle's condition\n"
    "• check the current market value against your balance\n"
    "• show whether upgrading, keeping, or handing back gives you the best result\n"
    "• and secure one of the remaining loyalty-supported offers if you decide to change\n\n"
    "When works best for you to pop in?"
)

EOT_3_INTRO_USED = (
    "Thanks for your reply, [customer_name].\n\n"
    "At 3 months to go, it's the ideal time to complete your end-of-contract check. This helps you avoid any unexpected charges and gives you a clear picture of the best path forward.\n\n"
    "We'll talk through:\n"
    "• the condition and any potential hand-back costs\n"
    "• whether keeping the car represents good value\n"
    "• upgrade options using any remaining loyalty support\n"
    "• and the simplest way to complete your agreement\n\n"
    "When would you like to come in?"
)


LIA_EOT_CAMPAIGN_OPENERS = {
    "EOT_18_NEW": EOT_18_NEW,
    "EOT_18_USED": EOT_18_USED,
    "EOT_12_NEW": EOT_12_NEW,
    "EOT_12_USED": EOT_12_USED,
    "EOT_9_NEW": EOT_9_NEW,
    "EOT_9_USED": EOT_9_USED,
    "EOT_6_NEW": EOT_6_NEW,
    "EOT_6_USED": EOT_6_USED,
    "EOT_3_NEW": EOT_3_NEW,
    "EOT_3_USED": EOT_3_USED,
}


LIA_EOT_INTROS = {
    "EOT_18": EOT_18_INTRO_NEW,
    "EOT_18_NEW": EOT_18_INTRO_NEW,
    "EOT_18_INTRO_USED": EOT_18_INTRO_USED,
    "EOT_12_NEW": EOT_12_INTRO_NEW,
    "EOT_12_USED": EOT_12_INTRO_USED,
    "EOT_12": (
        "Thanks for getting back to me.\n\n"
        "You're about 12 months from the end of your agreement, which is a great time to start looking at your options without any pressure. "
        "We can check what your Audi is likely to be worth, what loyalty support is available, and whether it makes sense to change early or simply stay as you are.\n\n"
        "The easiest next step is a quick visit to the showroom so we can go through things properly for you.\n\n"
        "When would suit you to pop in?"
    ),
    "EOT_9_NEW": EOT_9_INTRO_NEW,
    "EOT_9_INTRO_USED": EOT_9_INTRO_USED,
    "EOT_9": (
        "Thanks for getting back to me.\n\n"
        "You're around 9 months from the end of your agreement now, which is usually when the best upgrade options start to open up. "
        "You've got loyalty contributions set aside on your account that can be used towards a new Audi if you decide to change early.\n\n"
        "A quick visit to the showroom means we can look at the numbers together and see whether upgrading early or keeping your current car gives you the best value.\n\n"
        "When could you drop in for a chat?"
    ),
    "EOT_6_NEW": EOT_6_INTRO_NEW,
    "EOT_6_INTRO_USED": EOT_6_INTRO_USED,
    "EOT_6": (
        "Thanks for getting back to me.\n\n"
        "You're about 6 months from the end of your agreement now, so this is the last realistic window to factory order a new Audi and have it arrive in time before your current agreement finishes. "
        "We can also make sure any loyalty contributions available to you are used properly rather than left on the table.\n\n"
        "If you can pop into the showroom, we'll run through your options and see what works best for you before time gets tight.\n\n"
        "What day works best for a visit?"
    ),
    "EOT_3_NEW": EOT_3_INTRO_NEW,
    "EOT_3_INTRO_USED": EOT_3_INTRO_USED,
    "EOT_3": (
        "Thanks for getting back to me.\n\n"
        "You're very close to the end of your agreement now, so this is the point where we should confirm your next steps — whether you're planning to hand the car back, keep it, or look at upgrading.\n\n"
        "We'll invite you in for an end-of-contract condition check at the showroom. That way we can:\n"
        "• Highlight any potential charges if you're thinking of handing the car back\n"
        "• Confirm the vehicle's value if you're planning to keep it, so you know you're not paying above market value\n"
        "• Or use any unspent loyalty bonuses to help you into one of our stock vehicles if you'd like to upgrade\n\n"
        "When can you come in for that appointment?"
    ),
}


LIA_NUDGE_TEMPLATES = {
    # Nudge 1 – Curiosity trigger
    "NUDGE_1_EOT": (
        "Hi [customer name], just checking in — I had a look at your profile and there might be something worth showing you.\n\n"
        "If you'd like, I can run you through it and see whether it's a good fit for you. Happy to help."
    ),

    # Nudge 2 – FOMO / timing hint
    "NUDGE_2_EOT": (
        "Hi [customer name], we've had a couple of changes this week that could be relevant to you — nothing you have to commit to, "
        "but it could be good timing in your favour.\n\n"
        "If you'd like me to check things properly for you, just let me know."
    ),

    # Nudge 3 – Advisor call bridge
    "NUDGE_3_EOT": (
        "Before I step back, one of our advisors can give you a quick call if that's easier — no pressure, just to talk you through "
        "what your options look like and whether it's worth doing anything now.\n\n"
        "Would you like me to ask them to give you a ring?"
    ),
}


# 12-MONTH STAGE-SPECIFIC NUDGE SEQUENCE
LIA_EOT_12_NUDGES = {
    "NUDGE_1_12_NEW": (
        "Hi [customer_name], just a quick note from Lia at Lincoln Audi.\n"
        "I messaged recently as you're at a good point in your agreement to start looking at what you might want to "
        "do next with your [vehicle_model].\n"
        "No rush at all, but would you be open to a quick visit in the next few weeks to see what your options could look like?"
    ),
    "NUDGE_2_12_NEW": (
        "Hi [customer_name], I know life's busy so I'll keep this brief.\n"
        "Around this point in the agreement, there's usually a good amount of flexibility in terms of what you can do "
        "next, and it's easier to explore that while there's still time rather than right at the end.\n"
        "Would a weekday or a Saturday generally work better for you if we did arrange a quick chat at the showroom?"
    ),
    "NUDGE_3_12_NEW": (
        "Hi [customer_name], I don't want to keep bothering you, so I'll just say this last one.\n"
        "If it would be easier, I can ask one of our advisors to give you a quick call instead of you having to come "
        "in first, just to talk through your options and whether it's worth a visit.\n"
        "Would you prefer to keep things on WhatsApp for now, or would a quick call suit you better?"
    ),
    "NUDGE_1_12_USED": (
        "Hi [customer_name], it's Lia at Lincoln Audi again.\n"
        "I just wanted to gently check in as this is a useful stage to talk through your end-of-agreement options on "
        "the [vehicle_model].\n"
        "If we could find you a convenient time to pop in, would you be interested in having that review?"
    ),
    "NUDGE_2_12_USED": (
        "Hi [customer_name], Lia from Lincoln Audi here.\n"
        "With where you are in the agreement, it can be a good moment to see how your [vehicle_model] and mileage are "
        "sitting and what that means for your choices later on.\n"
        "If we could line up a short appointment to talk it through, would weekdays or Saturdays usually be easier for you?"
    ),
    "NUDGE_3_12_USED": (
        "Hi [customer_name], Lia here at Lincoln Audi – I'll make this my last nudge.\n"
        "If you'd find it helpful, I can get one of the team to give you a short call to chat through what your "
        "end-of-agreement options look like with the [vehicle_model], and then you can decide if a visit makes sense.\n"
        "Would you rather keep it here on WhatsApp, or have someone give you a quick call?"
    ),
}


# 18-MONTH STAGE-SPECIFIC NUDGE SEQUENCE
LIA_EOT_18_NUDGES = {
    "NUDGE_1_18_NEW": (
        "Hi [customer_name], it's Lia at Lincoln Audi.\n"
        "I just wanted to gently follow up on my message about giving your [vehicle_model] an end-of-warranty check "
        "and talking through your final-year options. It's a good way to make sure you're using the warranty properly "
        "and to see what might be possible with any loyalty support if you did fancy a change.\n"
        "Would you be open to a quick, early visit to look at that together?"
    ),
    "NUDGE_2_18_NEW": (
        "Hi [customer_name], I know this is still early doors, so I'll keep this brief.\n"
        "Some customers like to have an early look at the car and warranty before it runs out, and at the same time "
        "get a feel for what their final-year options might be – including whether any loyalty support could help "
        "them into a newer Audi sooner if it made sense.\n"
        "If we were to arrange something, would a weekday or a Saturday usually be easier for you?"
    ),
    "NUDGE_3_18_NEW": (
        "Hi [customer_name], I don't want to overdo it this early on, so I'll make this my last little nudge.\n"
        "If it's easier, I can ask one of our advisors to give you a quick call at some point, just to check you're "
        "making the most of the warranty on your [vehicle_model] and give you an early sense of your options and any "
        "loyalty support in your final year.\n"
        "Would you prefer to keep things on WhatsApp for now, or would a short call at some stage suit you better?"
    ),
    "NUDGE_1_18_USED": (
        "Hi [customer_name], Lia here from Lincoln Audi.\n"
        "I dropped you a note recently because this is a nice early point to get a feel for what your options might "
        "look like with the [vehicle_model] over your final year – whether you keep it, hand it back, or consider "
        "something newer with any loyalty support that may be available.\n"
        "Would you be interested in a short conversation at some stage, just to understand the different routes that "
        "could be open to you?"
    ),
    "NUDGE_2_18_USED": (
        "Hi [customer_name], Lia from Lincoln Audi here again.\n"
        "With plenty of time still left, this is really about giving you a clearer picture of how your [vehicle_model] "
        "and agreement might shape your choices in the final year – whether that's keeping things as they are or "
        "looking at a change with any loyalty help that could be available.\n"
        "If we set up a short, early review at the showroom, would a weekday or a Saturday normally work best for you?"
    ),
    "NUDGE_3_18_USED": (
        "Hi [customer_name], Lia at Lincoln Audi – this will be my last follow-up on this for now.\n"
        "If you'd find it helpful, I can get someone from the team to give you a quick call simply to outline what "
        "your final-year options on the [vehicle_model] might look like, and how any loyalty support could fit in "
        "when you're ready to decide.\n"
        "Would you rather leave things as they are for now, keep it on WhatsApp, or have a short call at some stage?"
    ),
}


# 9-MONTH STAGE-SPECIFIC NUDGE SEQUENCE
LIA_EOT_9_NUDGES = {
    "NUDGE_1_9_NEW": (
        "Hi [customer_name], it's Lia at Lincoln Audi.\n"
        "I just wanted to gently follow up on my message about starting to look at what happens after your current "
        "agreement on the [vehicle_model].\n"
        "If we could find a convenient time for you to pop in, would you be interested in a quick chat about your options?"
    ),
    "NUDGE_2_9_NEW": (
        "Hi [customer_name], I know life gets busy so I'll keep this brief.\n"
        "Quite a few customers at your stage find that looking at things now, rather than right at the end, gives them "
        "more options and less rush when it's time to decide.\n"
        "If we were to arrange something, do weekdays or Saturdays usually work better for you?"
    ),
    "NUDGE_3_9_NEW": (
        "Hi [customer_name], I don't want to keep chasing you, so I'll just say this one last time.\n"
        "If coming in isn't easy right now, I can ask one of our advisors to give you a quick call first, just to talk "
        "through what your options might look like and whether a visit is worth it.\n"
        "Would you rather we keep things here on WhatsApp for now, or would a short call work better?"
    ),
    "NUDGE_1_9_USED": (
        "Hi [customer_name], Lia here from Lincoln Audi.\n"
        "I dropped you a note recently because this is a useful point to see how your [vehicle_model] and mileage are "
        "sitting and what that might mean for your choices later on.\n"
        "Would you be open to coming in for a short appointment so we can talk it through properly?"
    ),
    "NUDGE_2_9_USED": (
        "Hi [customer_name], Lia from Lincoln Audi here again.\n"
        "Where you are in the agreement is a nice window to understand how your [vehicle_model] is sitting and what "
        "that opens up nearer the end.\n"
        "If we could line up a quick review here at the showroom, would you generally prefer a weekday or a Saturday?"
    ),
    "NUDGE_3_9_USED": (
        "Hi [customer_name], Lia at Lincoln Audi – this will be my last little nudge.\n"
        "If it helps, I can get someone from the team to give you a quick call to run through your end-of-agreement "
        "options on the [vehicle_model], and then you can decide if you'd like to come in.\n"
        "Would you prefer to stay on WhatsApp, or have a short call instead?"
    ),
}


# 6-MONTH STAGE-SPECIFIC NUDGE SEQUENCE
LIA_EOT_6_NUDGES = {
    "NUDGE_1_6_NEW": (
        "Hi [customer_name], it's Lia at Lincoln Audi.\n"
        "I'm just following up on my earlier message, as you're now at a stage where it's worth getting a proper look at "
        "what your next steps could be with the [vehicle_model].\n"
        "If we could find you a convenient time to pop in, would you be interested in a quick review over the next few weeks?"
    ),
    "NUDGE_2_6_NEW": (
        "Hi [customer_name], I know things get busy so I'll keep this brief.\n"
        "Looking at your options now rather than right at the end usually gives you more choice and avoids any last-minute "
        "decisions when the agreement finishes.\n"
        "If we were to arrange something, do weekdays or Saturdays usually work better for you?"
    ),
    "NUDGE_3_6_NEW": (
        "Hi [customer_name], I don't want to keep bothering you, so I'll make this my last little nudge.\n"
        "If getting in to see us is tricky at the moment, I can ask one of our advisors to give you a quick call first, "
        "just to run through your options and whether a visit would be worthwhile.\n"
        "Would you rather we keep things here on WhatsApp for now, or would a short call work better?"
    ),
    "NUDGE_1_6_USED": (
        "Hi [customer_name], Lia here from Lincoln Audi.\n"
        "I wanted to gently check in because, with only a few months left on the agreement for your [vehicle_model], it's "
        "a good opportunity to see how everything is sitting and what that means for the end.\n"
        "Would you be open to a short appointment so we can talk it through properly?"
    ),
    "NUDGE_2_6_USED": (
        "Hi [customer_name], Lia from Lincoln Audi here again.\n"
        "Where you are in the agreement is a sensible time to understand how your [vehicle_model], mileage and end-of-term "
        "position all fit together, so there are no surprises later.\n"
        "If we set up a quick review at the showroom, would a weekday or a Saturday normally be easier for you?"
    ),
    "NUDGE_3_6_USED": (
        "Hi [customer_name], Lia at Lincoln Audi – this will be my last check-in.\n"
        "If it helps, I can get someone from the team to give you a short call to talk through what the end of the "
        "agreement on your [vehicle_model] looks like, and then you can decide if you'd like to come in.\n"
        "Would you prefer to stay on WhatsApp, or have a quick call instead?"
    ),
}


# 3-MONTH STAGE-SPECIFIC NUDGE SEQUENCE
LIA_EOT_3_NUDGES = {
    "NUDGE_1_3_NEW": (
        "Hi [customer_name], just a quick reminder — you're now close to the end of your agreement, so we'll need to complete "
        "your end-of-contract check soon.\n\n"
        "This is also the point where your strongest loyalty support becomes available if you decide to upgrade.\n\n"
        "If you want me to hold the best-value options for you, just let me know what day you could pop in."
    ),
    "NUDGE_2_3_NEW": (
        "Hi [customer_name], as you're only a few months away from the end of your term, this is now the last window to secure "
        "an upgrade before stock availability and loyalty support change for the next quarter.\n\n"
        "Customers at this stage often save the most by acting now rather than at hand-back.\n\n"
        "Would you like me to check what the best-value new options look like for you before anything disappears?"
    ),
    "NUDGE_3_3_NEW": (
        "Hi [customer_name], you're now at the point where we normally schedule the end-of-contract review — it helps avoid any "
        "condition charges, confirms your settlement, and lets us apply any unused loyalty support before expiry.\n\n"
        "If you'd prefer, I can arrange for one of our advisors to give you a quick call and run through everything before you "
        "visit.\n\n"
        "Should I get someone to ring you?"
    ),
    "NUDGE_1_3_USED": (
        "Hi [customer_name], just a quick reminder — as you're close to the end of your agreement, we should complete your "
        "end-of-contract check soon.\n\n"
        "This helps confirm the vehicle's value, avoid any potential charges, and makes sure you're fully covered.\n\n"
        "If you'd like, I can check early swap options too — some customers find the upgrade more achievable at this point."
    ),
    "NUDGE_2_3_USED": (
        "Hi [customer_name], you're now in the final few months, so it's really important we review your options properly.\n\n"
        "Doing nothing until the very end can mean missing out on loyalty support or paying more than necessary if you choose "
        "to keep the car.\n\n"
        "Would you like me to run a quick comparison between keeping, handing back, or moving into a newer model?"
    ),
    "NUDGE_3_3_USED": (
        "Hi [customer_name], we're now at the stage where we normally arrange the end-of-contract check — this protects you "
        "from unexpected charges and gives a clear view of your car's true value.\n\n"
        "If you'd prefer, I can get one of our advisors to give you a quick call and run you through the options before you "
        "come in.\n\n"
        "Would that help?"
    ),
}


# Consolidated nudge lookup by stage
LIA_EOT_NUDGE_BY_STAGE = {
    "18": LIA_EOT_18_NUDGES,
    "12": LIA_EOT_12_NUDGES,
    "9": LIA_EOT_9_NUDGES,
    "6": LIA_EOT_6_NUDGES,
    "3": LIA_EOT_3_NUDGES,
}


def select_eot_intro(payments_remaining: int | None) -> str | None:
    """
    Choose the correct end-of-term intro based on payments remaining.
    Returns one of the LIA_EOT_INTROS values or None if not applicable.
    """
    if payments_remaining is None:
        return None

    try:
        pr = int(payments_remaining)
    except (TypeError, ValueError):
        return None

    if pr >= 10:
        return LIA_EOT_INTROS["EOT_12"]
    elif pr >= 7:
        return LIA_EOT_INTROS["EOT_9"]
    elif pr >= 4:
        return LIA_EOT_INTROS["EOT_6"]
    else:
        return LIA_EOT_INTROS["EOT_3"]


def classify_inbound_tier(body_lower: str) -> str:
    """
    Classify an inbound message body (already lower-cased) into a LIA tier:
    - T3_HARD_STOP
    - T4_SCHEDULED
    - T5_MONEY
    - T2_SOFT_OBJECTION
    - T6_SUPPORT
    - T1_GENERAL (default)
    The order of checks matters: strongest intent should be caught first.
    """
    # Tier 3: hard stops / do-not-contact
    hard_stop_keywords = [
        "stop",
        "do not contact",
        "dont contact",
        "remove my details",
        "remove my data",
        "leave it",
        "not interested",
        "go away",
        "unsubscribe",
        "take me off",
    ]
    for k in hard_stop_keywords:
        if k in body_lower:
            return "T3_HARD_STOP"

    # Tier 4: time-based follow-up
    scheduled_keywords = [
        "next week",
        "next month",
        "in a few weeks",
        "in a couple of weeks",
        "in a couple of months",
        "later this year",
        "towards the end of the year",
        "try me again",
        "reach out nearer the time",
        "contact me in",
    ]
    for k in scheduled_keywords:
        if k in body_lower:
            return "T4_SCHEDULED"

    # Tier 5: money / price / payment objections
    money_keywords = [
        "too expensive",
        "too dear",
        "too much",
        "too high",
        "cant afford",
        "can't afford",
        "afford it",
        "payment is too",
        "monthly is too",
        "need it cheaper",
        "need cheaper",
        "price is too",
    ]
    for k in money_keywords:
        if k in body_lower:
            return "T5_MONEY"

    # Tier 2: soft objections / hesitations
    soft_objection_keywords = [
        "not right now",
        "not right just now",
        "bit busy",
        "i'm busy",
        "im busy",
        "maybe later",
        "maybe in a few weeks",
        "maybe in a few months",
        "not urgent",
        "not a priority",
        "leave it for now",
        "ill leave it for now",
        "i'll leave it for now",
        "need to think",
        "need to have a think",
        "thinking about it",
        "not sure",
        "unsure",
    ]
    for k in soft_objection_keywords:
        if k in body_lower:
            return "T2_SOFT_OBJECTION"

    # Tier 6: support / service / repair / mot style queries
    support_keywords = [
        "service",
        "mot",
        "repair",
        "courtesy car",
        "courtesy",
        "update on my car",
        "update on the car",
        "in the workshop",
        "warning light",
        "light on the dash",
        "breakdown",
    ]
    for k in support_keywords:
        if k in body_lower:
            return "T6_SUPPORT"

    # Default: general conversation
    return "T1_GENERAL"


# =============================================================================
# BESPOKE CAMPAIGN TEMPLATES
# =============================================================================
# These are manager-initiated campaigns where customers have been PRE-SELECTED
# because their agreement/vehicle position has been reviewed and they are
# genuinely in a strong position to change.
#
# Placeholders:
# - [customer_name]  = Customer first name (fallback: "there")
# - [vehicle_model]  = Current vehicle model
# - [target_model]   = Manager-selected target upgrade model (e.g. "A3", "Q3")
# - [ev_label]       = EV/PHEV label (e.g. "e-tron", "plug-in hybrid")
# =============================================================================

# -----------------------------------------------------------------------------
# 1) UPGRADE TO NEWER MODEL – SIMILAR PAYMENTS
# -----------------------------------------------------------------------------
UPGRADE_SIMILAR_OPEN = (
    "Hi [customer_name], it's Lia from Lincoln Audi.\n"
    "We've reviewed your agreement on the [vehicle_model] and you're in a strong position to look at changing "
    "into a [target_model]. Right now we have offers and loyalty support available that are designed to keep "
    "things feeling comfortable on the monthly side while moving you into the newer car.\n"
    "It's a really good time to look at this, but we do need to confirm a few details with you and see your car "
    "in person. Would you be open to popping in for a quick review?"
)

UPGRADE_SIMILAR_INTRO = (
    "Thanks for coming back to me, [customer_name].\n"
    "Because we've already checked your agreement and the position of your [vehicle_model], we know you're one "
    "of the customers who could be in a good place to move into a [target_model] without things jumping around "
    "too much each month. The exact figures will depend on mileage, condition and the exact car you choose, "
    "which is why we need to see you and the car here.\n"
    "Would you prefer us to focus on a like-for-like [target_model], or are you open to seeing a couple of "
    "slightly different options as well?"
)

LIA_UPGRADE_SIMILAR_NUDGES = {
    "NUDGE_1_UPG_SIMILAR": (
        "Hi [customer_name], it's Lia at Lincoln Audi.\n"
        "I just wanted to follow up as we have specifically checked your agreement and your [vehicle_model], "
        "and you're in a good position to look at moving into a [target_model] with our current loyalty support. "
        "It's not a generic offer – we've picked you out because your numbers stack up well for a change.\n"
        "Would you like us to book a short visit so we can run through everything with you and see your car?"
    ),
    "NUDGE_2_UPG_SIMILAR": (
        "Hi [customer_name], Lia from Lincoln Audi here again.\n"
        "These upgrade opportunities work best when we look at them while the current support on [target_model] "
        "is in place and before you get too close to the end of the agreement. You're in a strong position at "
        "the moment, and we'd like to make the most of that with you.\n"
        "If we set something up, do weekdays or Saturdays usually work better for you?"
    ),
    "NUDGE_3_UPG_SIMILAR": (
        "Hi [customer_name], I don't want to keep bothering you, so I'll make this my last little nudge.\n"
        "We've already checked your agreement and your [vehicle_model], and you are in a good place to look at "
        "a [target_model] right now – we just need to confirm a few details and see the car to be sure it all "
        "lines up. If it's easier, I can ask one of our managers to give you a short call first to talk it through.\n"
        "Would you prefer to keep things on WhatsApp, pop in for a quick visit, or have a quick call?"
    ),
}

# -----------------------------------------------------------------------------
# 2) STOCK SUPPORT ENHANCEMENT
# -----------------------------------------------------------------------------
STOCK_SUPPORT_OPEN = (
    "Hi [customer_name], it's Lia from Lincoln Audi.\n"
    "We've looked at your agreement on the [vehicle_model] and at the moment we've got additional support "
    "available on [target_model] models in stock. That combination puts you in a very strong position to look "
    "at changing now with exclusive loyalty contributions attached.\n"
    "It's a particularly good window to review things, but we do need to confirm a few details with you and see "
    "your car. Would you be open to coming in for a quick appointment?"
)

STOCK_SUPPORT_INTRO = (
    "Thanks for replying, [customer_name].\n"
    "We've not sent this out to everyone – we've picked you because your [vehicle_model], mileage and agreement "
    "line up well with the current support we've got on [target_model]. To see exactly what that could do for "
    "you, we'll need to go through your details properly and take a look at your car here.\n"
    "Are you mainly curious to see what the change into a [target_model] could look like, or do you already "
    "have a rough idea of what you'd like next?"
)

LIA_STOCK_SUPPORT_NUDGES = {
    "NUDGE_1_STOCK_SUPPORT": (
        "Hi [customer_name], it's Lia at Lincoln Audi.\n"
        "Just giving you a gentle nudge, as the extra support we've got on [target_model] right now, combined "
        "with the position of your [vehicle_model], makes this a genuinely strong moment to look at changing. "
        "We've already checked that you're in a good place to have that conversation.\n"
        "Would you like us to book you in so we can go through it properly and see your car?"
    ),
    "NUDGE_2_STOCK_SUPPORT": (
        "Hi [customer_name], Lia from Lincoln Audi here again.\n"
        "Offers like this on [target_model] don't tend to stick around for long, and they work best when we "
        "talk while that support and your agreement position are both in a good place – which they are at "
        "the moment.\n"
        "If we set up a short appointment to look at your [vehicle_model] and the [target_model] options, do "
        "weekdays or Saturdays usually suit you better?"
    ),
    "NUDGE_3_STOCK_SUPPORT": (
        "Hi [customer_name], I don't want to overdo it, so I'll make this my last little nudge.\n"
        "We've checked your agreement and your [vehicle_model], and you are in a strong position to take "
        "advantage of the current support on [target_model] – we just need to confirm the details with you "
        "and see the car in person. If you prefer, I can ask one of our managers to give you a quick call "
        "first to talk it through.\n"
        "Would you rather keep things on WhatsApp, arrange a short visit, or have a quick call?"
    ),
}

# -----------------------------------------------------------------------------
# 3) SAME DEPOSIT, SIMILAR PAYMENT
# -----------------------------------------------------------------------------
SAME_DEP_SIMILAR_OPEN = (
    "Hi [customer_name], it's Lia from Lincoln Audi.\n"
    "We've gone through your agreement and the position of your [vehicle_model], and right now you're in a "
    "very good place to look at changing into a [target_model] while keeping the structure of your agreement "
    "feeling similar in terms of deposit and monthly comfort. That's based on current loyalty contributions "
    "and support we have available.\n"
    "It's a strong opportunity for you, but we do need to confirm a few details and see your car to make sure "
    "everything lines up. Would you be open to popping in for a quick review?"
)

SAME_DEP_SIMILAR_INTRO = (
    "Thanks for coming back to me, [customer_name].\n"
    "Because we've already checked your numbers, we know you're one of the customers who could potentially move "
    "into a [target_model] and keep things feeling familiar in terms of deposit and monthly outgoings. The exact "
    "figures will depend on your mileage, the condition of the [vehicle_model] and the precise [target_model] "
    "you choose, which is why we need to sit down with you.\n"
    "Are you looking to keep things as close as possible to how they are now, or would you consider small "
    "changes if the car was a better fit?"
)

LIA_SAME_DEP_SIMILAR_NUDGES = {
    "NUDGE_1_SAME_DEP_SIMILAR": (
        "Hi [customer_name], it's Lia at Lincoln Audi.\n"
        "Just following up, as we have already checked your agreement and you're in a good position to look at "
        "moving from the [vehicle_model] into a [target_model] while keeping the deposit and monthly side feeling "
        "similar, using the support that's live at the moment.\n"
        "Would you like us to arrange a short visit so we can go through it properly with you and see your car?"
    ),
    "NUDGE_2_SAME_DEP_SIMILAR": (
        "Hi [customer_name], Lia from Lincoln Audi here again.\n"
        "These \"same deposit, similar payment\" type opportunities work best when we pick them up while your "
        "agreement and the support on [target_model] are aligned – which they are right now. That's why we've "
        "chosen you specifically rather than sending this out to everyone.\n"
        "If we set something up, do weekdays or Saturdays usually work better for you?"
    ),
    "NUDGE_3_SAME_DEP_SIMILAR": (
        "Hi [customer_name], I don't want to keep pestering you, so I'll make this my last little nudge.\n"
        "We've checked your agreement and your [vehicle_model], and you're in a strong position to look at a "
        "[target_model] on a structure designed to feel similar to what you're used to – subject to confirming "
        "the details and seeing your car. If it helps, I can ask one of our managers to give you a short call "
        "first to talk it through.\n"
        "Would you prefer to keep things on WhatsApp, pop in for a quick visit, or have a quick call?"
    ),
}

# -----------------------------------------------------------------------------
# 4) NEWER TCO – REDUCE TOTAL COST OF OWNERSHIP VIA A NEWER CAR
# -----------------------------------------------------------------------------
TCO_NEWER_OPEN = (
    "Hi [customer_name], it's Lia from Lincoln Audi.\n"
    "We've gone through your agreement on the [vehicle_model] and you're in a very good position to look at "
    "changing into a newer [target_model]. With the warranty, service options and MOT savings that come with "
    "a newer car – plus any efficiency gains – it could reduce what the car costs you overall to own and run, "
    "not just in one payment.\n"
    "We've done the homework on your side; we now just need to confirm a few details with you and see your car. "
    "Would you be open to popping in for a quick review?"
)

TCO_NEWER_INTRO = (
    "Thanks for coming back to me, [customer_name].\n"
    "When we talk about reducing total cost of ownership, we're looking at the whole picture – warranty cover, "
    "servicing, MOTs and efficiency, as well as how the agreement is set up. Moving into a newer [target_model] "
    "could mean fewer unexpected bills and several years without an MOT, which is why we've picked you out to "
    "have this conversation.\n"
    "Are there any particular costs that are bothering you at the moment – servicing, repairs, MOTs, or something else?"
)

LIA_TCO_NEWER_NUDGES = {
    "NUDGE_1_TCO_NEWER": (
        "Hi [customer_name], it's Lia at Lincoln Audi.\n"
        "Just following up, as we've specifically checked your [vehicle_model] and agreement and you're in a "
        "strong position to look at a newer [target_model] with the aim of tidying up your overall running costs "
        "and giving you more cover and peace of mind.\n"
        "Would you like us to book a short visit so we can go through that with you and see your car?"
    ),
    "NUDGE_2_TCO_NEWER": (
        "Hi [customer_name], Lia from Lincoln Audi here again.\n"
        "Looking at this while your agreement is in a good place means we can shape your next car and cover "
        "around what suits you – including things like warranty length, service plans and MOT timing – rather "
        "than waiting until you're right at the end. That's why we've chosen you rather than sending this to everyone.\n"
        "If we set something up, do weekdays or Saturdays usually work better for you?"
    ),
    "NUDGE_3_TCO_NEWER": (
        "Hi [customer_name], I don't want to keep bothering you, so I'll make this my last little nudge.\n"
        "We've already reviewed your agreement and your [vehicle_model], and we believe a newer [target_model] "
        "could work well for you from a total cost of ownership point of view – subject to confirming the details "
        "and seeing your car. If it's easier, I can ask one of our managers to give you a short call first.\n"
        "Would you prefer to keep things on WhatsApp, pop in for a quick visit, or have a quick call?"
    ),
}

# -----------------------------------------------------------------------------
# 5) ZEV UPGRADE – EV / PHEV SWAP
# -----------------------------------------------------------------------------
ZEV_UPGRADE_OPEN = (
    "Hi [customer_name], it's Lia from Lincoln Audi.\n"
    "We've reviewed your agreement on the [vehicle_model] and you're in a strong position to look at changing "
    "into a [target_model] [ev_label]. With the support we've got available at the moment, it's a really good "
    "time to consider moving into an electrified Audi and enjoying the smoother drive, latest tech and potential "
    "running cost benefits.\n"
    "We just need to confirm a few details with you and see your car in person. Would you be open to popping in "
    "for a quick review?"
)

ZEV_UPGRADE_INTRO = (
    "Thanks for coming back to me, [customer_name].\n"
    "Because we've already checked your agreement and the position of your [vehicle_model], we know you're one "
    "of the customers in a good place to look at a move into a [target_model] [ev_label]. The next step is just "
    "to understand how you use the car – things like your daily mileage and whether you can charge at home or "
    "work – so we can make sure the switch would genuinely suit you.\n"
    "Roughly how many miles do you tend to do in a typical week, and do you have access to charging at home or nearby?"
)

LIA_ZEV_UPGRADE_NUDGES = {
    "NUDGE_1_ZEV_UPGRADE": (
        "Hi [customer_name], it's Lia at Lincoln Audi.\n"
        "Just giving you a gentle nudge, as we've picked you specifically because your agreement and [vehicle_model] "
        "line up well for a move into a [target_model] [ev_label] with the support that's available at the moment. "
        "It's a good opportunity to see whether an electrified Audi would work for you.\n"
        "Would you like us to book a short visit so we can go through it properly and see your car?"
    ),
    "NUDGE_2_ZEV_UPGRADE": (
        "Hi [customer_name], Lia from Lincoln Audi here again.\n"
        "These opportunities to move into a [target_model] [ev_label] work best when we pick them up while the "
        "current support is live and your agreement is in a good place – which is exactly where you are now. "
        "It's a good moment to explore it, even if you decide to stay as you are.\n"
        "If we set something up, do weekdays or Saturdays usually work better for you?"
    ),
    "NUDGE_3_ZEV_UPGRADE": (
        "Hi [customer_name], I don't want to keep pestering you, so I'll make this my last little nudge.\n"
        "We've checked your agreement and your [vehicle_model], and you are in a strong position to look at a "
        "[target_model] [ev_label] right now – we just need to confirm the details and see your car in person. "
        "If it's easier, I can ask one of our managers to give you a short call first to talk it through.\n"
        "Would you prefer to keep things on WhatsApp, pop in for a quick visit, or have a quick call?"
    ),
}

# -----------------------------------------------------------------------------
# 6) ZEV TCO – TOTAL COST OF OWNERSHIP VIA EV / PHEV
# -----------------------------------------------------------------------------
ZEV_TCO_OPEN = (
    "Hi [customer_name], it's Lia from Lincoln Audi.\n"
    "We've reviewed your agreement on the [vehicle_model] and the way you're positioned means now is a very "
    "good time to look at moving into a [target_model] [ev_label]. With the way these cars are set up, there "
    "can be meaningful savings in areas like fuel, tax and day-to-day running, on top of the warranty and MOT "
    "benefits you get from a newer car.\n"
    "We've done the homework on your side; we now just need to confirm a few details with you and see your car "
    "in person. Would you be open to coming in for a quick review?"
)

ZEV_TCO_INTRO = (
    "Thanks for coming back to me, [customer_name].\n"
    "With a [target_model] [ev_label], the total cost of ownership picture changes – you're looking at lower "
    "or different fuel costs, potential tax benefits, fewer moving parts to service, and the warranty and MOT "
    "advantages that come with a newer Audi. Because we've already checked your agreement, we know you're in a "
    "strong position to explore this properly.\n"
    "How are you mainly using your [vehicle_model] at the moment – mostly short trips, longer runs, or a mix of both?"
)

LIA_ZEV_TCO_NUDGES = {
    "NUDGE_1_ZEV_TCO": (
        "Hi [customer_name], it's Lia at Lincoln Audi.\n"
        "Just giving you a gentle nudge, as you're one of the customers we've picked out where a move into a "
        "[target_model] [ev_label] could make sense from a total cost of ownership point of view, not just from "
        "a \"new car\" point of view.\n"
        "Would you like us to book a short visit so we can look at that with you and see your car?"
    ),
    "NUDGE_2_ZEV_TCO": (
        "Hi [customer_name], Lia from Lincoln Audi here again.\n"
        "These ZEV opportunities work best when we talk while your agreement is in a good place and the right "
        "cars are available – which is exactly where you are at the moment. It lets us see whether an electrified "
        "[target_model] would genuinely fit how you drive and what you spend on the car overall.\n"
        "If we set something up, do weekdays or Saturdays usually work better for you?"
    ),
    "NUDGE_3_ZEV_TCO": (
        "Hi [customer_name], I don't want to keep pestering you, so I'll make this my last little nudge.\n"
        "We've already checked your agreement and [vehicle_model], and you're in a strong position to explore a "
        "[target_model] [ev_label] with the aim of improving your overall running costs – we just need to confirm "
        "the details with you and see the car. If you prefer, I can ask one of our managers to give you a short "
        "call first to talk it through.\n"
        "Would you prefer to keep things on WhatsApp, pop in for a quick visit, or have a quick call?"
    ),
}

# -----------------------------------------------------------------------------
# 7) TEST DRIVE A NEW MODEL
# -----------------------------------------------------------------------------
TEST_DRIVE_OPEN = (
    "Hi [customer_name], it's Lia from Lincoln Audi.\n"
    "I'm in touch because, with where you are in your agreement on the [vehicle_model], it could be a good time "
    "to experience how the latest Audi models feel in terms of comfort, technology and efficiency, even if "
    "you're not ready to make any decisions yet.\n"
    "Would you be interested in popping in for a short test drive so you can compare it properly to what you're "
    "driving now?"
)

TEST_DRIVE_INTRO = (
    "Thanks for coming back to me, [customer_name].\n"
    "A quick test drive is often the easiest way to see whether it's worth thinking about a change – you get a "
    "feel for the newer car, and then we can talk through what your options would look like if you ever did want "
    "to move across.\n"
    "Is there a particular model or type of Audi you've had your eye on, or are you just curious to see what's "
    "new compared with your [vehicle_model]?"
)

LIA_TEST_DRIVE_NUDGES = {
    "NUDGE_1_TEST_DRIVE": (
        "Hi [customer_name], it's Lia at Lincoln Audi.\n"
        "I just wanted to gently follow up, as a short test drive can give you a much clearer idea of whether a "
        "newer Audi would genuinely feel like a step forward from your [vehicle_model], without any pressure to "
        "decide there and then.\n"
        "Would you be open to booking in a quick drive to see what you think?"
    ),
    "NUDGE_2_TEST_DRIVE": (
        "Hi [customer_name], Lia from Lincoln Audi here again.\n"
        "If you're even slightly curious, doing this while you've still got time left on the agreement means you "
        "can try something new and then park it again until you're closer to the end, knowing what your options "
        "could be.\n"
        "If we arranged a test drive, would weekdays or Saturdays usually suit you better?"
    ),
    "NUDGE_3_TEST_DRIVE": (
        "Hi [customer_name], I don't want to keep pestering you, so I'll make this my last little nudge.\n"
        "If you'd rather talk first, I can ask one of our advisors to give you a short call to understand what "
        "you're looking for and suggest the best model for you to try, before you book anything.\n"
        "Would you prefer to keep things here on WhatsApp, book a test drive, or have a short call first?"
    ),
}

# -----------------------------------------------------------------------------
# 8) WE WANT YOUR CAR
# -----------------------------------------------------------------------------
WE_WANT_CAR_OPEN = (
    "Hi [customer_name], it's Lia from Lincoln Audi.\n"
    "I'm getting in touch because your [vehicle_model] is exactly the type of car our used team are actively "
    "looking for at the moment, and that can put you in a stronger position when it comes to your next steps.\n"
    "Would you be open to a quick visit so we can take a proper look at your car and talk through what that "
    "could mean for you?"
)

WE_WANT_CAR_INTRO = (
    "Thanks for replying, [customer_name].\n"
    "When your car is in demand, it can sometimes give you a bit more flexibility – whether that's helping with "
    "your next Audi or simply giving you clearer options if you're considering a change. We'd need to see the "
    "[vehicle_model] in person to give you a proper view.\n"
    "Are you mainly curious what it might be worth to us, or more interested in what it could do towards your "
    "next car?"
)

LIA_WE_WANT_CAR_NUDGES = {
    "NUDGE_1_WE_WANT_CAR": (
        "Hi [customer_name], it's Lia at Lincoln Audi.\n"
        "I just wanted to gently follow up, as the [vehicle_model] is the sort of car our used team are keen to "
        "have on site at the moment, which could work in your favour if you're thinking about a change.\n"
        "Would you be interested in bringing it in for a quick look so we can talk through what that might open "
        "up for you?"
    ),
    "NUDGE_2_WE_WANT_CAR": (
        "Hi [customer_name], Lia from Lincoln Audi here again.\n"
        "These opportunities can change as our stock and demand change, so looking at things while we're actively "
        "looking for cars like yours can sometimes give you more options than waiting until later on.\n"
        "If we set up a quick appointment, do weekdays or Saturdays usually work better for you?"
    ),
    "NUDGE_3_WE_WANT_CAR": (
        "Hi [customer_name], I don't want to keep bothering you, so I'll make this my last little nudge.\n"
        "If you'd rather talk first, I can ask one of our advisors to give you a short call to chat about your "
        "[vehicle_model] and what we might be able to do with it, before you decide whether to bring it in.\n"
        "Would you prefer to keep things on WhatsApp, pop in for a quick visit, or have a short call?"
    ),
}


# =============================================================================
# BESPOKE CAMPAIGN LOOKUP DICTIONARIES
# =============================================================================

LIA_BESPOKE_OPENERS = {
    "UPGRADE_SIMILAR": UPGRADE_SIMILAR_OPEN,
    "STOCK_SUPPORT": STOCK_SUPPORT_OPEN,
    "SAME_DEP_SIMILAR": SAME_DEP_SIMILAR_OPEN,
    "TCO_NEWER": TCO_NEWER_OPEN,
    "ZEV_UPGRADE": ZEV_UPGRADE_OPEN,
    "ZEV_TCO": ZEV_TCO_OPEN,
    "TEST_DRIVE": TEST_DRIVE_OPEN,
    "WE_WANT_CAR": WE_WANT_CAR_OPEN,
}

LIA_BESPOKE_INTROS = {
    "UPGRADE_SIMILAR": UPGRADE_SIMILAR_INTRO,
    "STOCK_SUPPORT": STOCK_SUPPORT_INTRO,
    "SAME_DEP_SIMILAR": SAME_DEP_SIMILAR_INTRO,
    "TCO_NEWER": TCO_NEWER_INTRO,
    "ZEV_UPGRADE": ZEV_UPGRADE_INTRO,
    "ZEV_TCO": ZEV_TCO_INTRO,
    "TEST_DRIVE": TEST_DRIVE_INTRO,
    "WE_WANT_CAR": WE_WANT_CAR_INTRO,
}

LIA_BESPOKE_NUDGES = {
    "UPGRADE_SIMILAR": LIA_UPGRADE_SIMILAR_NUDGES,
    "STOCK_SUPPORT": LIA_STOCK_SUPPORT_NUDGES,
    "SAME_DEP_SIMILAR": LIA_SAME_DEP_SIMILAR_NUDGES,
    "TCO_NEWER": LIA_TCO_NEWER_NUDGES,
    "ZEV_UPGRADE": LIA_ZEV_UPGRADE_NUDGES,
    "ZEV_TCO": LIA_ZEV_TCO_NUDGES,
    "TEST_DRIVE": LIA_TEST_DRIVE_NUDGES,
    "WE_WANT_CAR": LIA_WE_WANT_CAR_NUDGES,
}
