/* =========================================================
   UJJAWAL POPUP
   WALK IN → COLLECT NUMBER → WALK OUT
   ========================================================= */

.lead-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(10, 25, 17, 0.52);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.35s ease,
        visibility 0.35s ease;

    overflow: hidden;
}

.lead-popup-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}


/* =========================================================
   MAIN SCENE
   ========================================================= */

.lead-popup-scene {
    position: relative;

    width: min(1050px, 94vw);
    height: 600px;

    display: flex;
    align-items: center;
    justify-content: center;

    transform: translateX(-120vw);

    transition:
        transform 1.15s cubic-bezier(0.16, 0.84, 0.22, 1);
}

.lead-popup-overlay.is-visible .lead-popup-scene {
    transform: translateX(0);
}


/* =========================================================
   UJJAWAL WALKING CHARACTER
   ========================================================= */

.lead-walking-character {
    position: absolute;

    left: 70px;
    bottom: 40px;

    width: 270px;
    height: 470px;

    z-index: 20;

    display: flex;
    align-items: flex-end;
    justify-content: center;

    pointer-events: none;

    transform:
        translateX(-420px)
        scale(0.92);

    transition:
        transform 1.15s cubic-bezier(0.16, 0.84, 0.22, 1);
}

.lead-walking-character img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
    object-position: center bottom;

    user-select: none;
    -webkit-user-drag: none;

    filter:
        drop-shadow(
            0 18px 18px rgba(0, 0, 0, 0.18)
        );
}


/* character enters */
.lead-popup-overlay.is-visible
.lead-walking-character {
    transform:
        translateX(0)
        scale(1);

    animation:
        ujjawalWalkIn 1.15s ease-in-out,
        ujjawalIdle 1.8s ease-in-out 1.15s infinite;
}


/* =========================================================
   POPUP CARD
   ========================================================= */

.lead-popup-card {
    position: relative;

    width: min(560px, calc(100vw - 40px));

    min-height: 430px;

    margin-left: 250px;

    background:
        linear-gradient(
            145deg,
            #ffffff 0%,
            #fafffb 100%
        );

    border: 2px solid #16834b;

    border-radius: 32px;

    box-shadow:
        0 35px 90px rgba(0, 0, 0, 0.25),
        0 10px 30px rgba(22, 131, 75, 0.14);

    overflow: hidden;

    opacity: 0;

    transform:
        translateX(190px)
        scale(0.92)
        rotate(2deg);

    transition:
        opacity 0.65s ease 0.7s,
        transform 0.85s cubic-bezier(0.16, 0.84, 0.22, 1) 0.7s;
}

.lead-popup-overlay.is-visible .lead-popup-card {
    opacity: 1;

    transform:
        translateX(0)
        scale(1)
        rotate(0);
}


/* =========================================================
   CLOSE
   ========================================================= */

.lead-popup-close {
    position: absolute;

    top: 18px;
    right: 18px;

    width: 40px;
    height: 40px;

    border: 0;
    border-radius: 50%;

    background: #f0f4f1;

    color: #647169;

    font-size: 27px;
    line-height: 1;

    cursor: pointer;

    z-index: 5;

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.lead-popup-close:hover {
    background: #e3ebe6;
    transform: rotate(90deg);
}


/* =========================================================
   CONTENT
   ========================================================= */

.lead-popup-content {
    padding: 48px 48px 35px;
}

.lead-popup-greeting {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 6px;

    color: #16834b;

    font-family: "Allura", cursive;

    font-size: 31px;
    font-weight: 600;
}

.lead-popup-eyebrow {
    margin-bottom: 10px;

    color: #16834b;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 0.17em;
}

.lead-popup-content h2 {
    margin: 0 0 14px;

    color: #17251d;

    font-size: clamp(30px, 4vw, 43px);

    line-height: 1.05;

    letter-spacing: -0.045em;
}

.lead-popup-description {
    max-width: 460px;

    margin: 0 0 26px;

    color: #718078;

    font-size: 15px;

    line-height: 1.65;
}


/* =========================================================
   PHONE
   ========================================================= */

.lead-phone-field {
    position: relative;

    display: flex;
    align-items: center;

    width: 100%;
    height: 66px;

    border: 2px solid #d7e4dc;

    border-radius: 18px;

    background: #ffffff;

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.lead-phone-field:focus-within {
    border-color: #16834b;

    box-shadow:
        0 0 0 4px rgba(22, 131, 75, 0.10);
}

.lead-phone-field.is-complete {
    border-color: #16834b;

    box-shadow:
        0 0 0 4px rgba(22, 131, 75, 0.08);
}

.lead-country-code {
    display: flex;
    align-items: center;

    height: 36px;

    padding: 0 16px;

    border-right: 1px solid #dce6e0;

    color: #17251d;

    font-size: 16px;
    font-weight: 800;
}

.lead-phone-field input {
    flex: 1;

    width: 100%;
    height: 100%;

    border: 0;
    outline: 0;

    padding: 0 55px 0 15px;

    background: transparent;

    color: #17251d;

    font-size: 18px;
    font-weight: 600;

    letter-spacing: 0.04em;
}

.lead-phone-field input::placeholder {
    color: #a5aea8;

    font-weight: 400;

    letter-spacing: 0;
}

.lead-phone-check {
    position: absolute;

    right: 16px;

    width: 31px;
    height: 31px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #16834b;

    color: white;

    font-size: 17px;
    font-weight: 900;

    opacity: 0;

    transform: scale(0.4);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.lead-phone-field.is-complete
.lead-phone-check {
    opacity: 1;

    transform: scale(1);
}


/* =========================================================
   ERROR
   ========================================================= */

.lead-phone-error {
    min-height: 20px;

    margin-top: 8px;

    color: #c62828;

    font-size: 12px;
    font-weight: 600;
}


/* =========================================================
   SUCCESS
   ========================================================= */

.lead-success-message {
    display: none;

    align-items: center;
    gap: 12px;

    margin-top: 18px;

    padding: 15px;

    border-radius: 15px;

    background: #eaf8ef;

    color: #185d38;

    font-size: 13px;

    line-height: 1.4;
}

.lead-success-message.is-visible {
    display: flex;

    animation:
        successPop 0.4s ease;
}

.lead-success-icon {
    width: 34px;
    height: 34px;

    flex: 0 0 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #16834b;

    color: #ffffff;

    font-size: 18px;
    font-weight: 900;
}

.lead-success-message strong {
    display: block;

    margin-bottom: 2px;
}


/* =========================================================
   PRIVATE NOTE
   ========================================================= */

.lead-popup-private {
    margin-top: 18px;

    color: #9aa49e;

    font-size: 11px;
}


/* =========================================================
   EXIT
   UJJAWAL + POPUP MOVE TO RIGHT TOGETHER
   ========================================================= */

.lead-popup-overlay.is-departing
.lead-popup-scene {
    transform:
        translateX(120vw);

    transition:
        transform 1.15s cubic-bezier(0.65, 0, 0.85, 0.2);
}

.lead-popup-overlay.is-departing
.lead-walking-character {
    animation:
        ujjawalWalkOut 1.15s ease-in-out forwards;
}

.lead-popup-overlay.is-departing
.lead-popup-card {
    opacity: 1;

    transform:
        translateX(0)
        scale(1)
        rotate(-2deg);
}


/* =========================================================
   WALK IN
   ========================================================= */

@keyframes ujjawalWalkIn {

    0% {
        transform:
            translateX(-420px)
            translateY(4px)
            rotate(-2deg)
            scale(0.92);
    }

    25% {
        transform:
            translateX(-300px)
            translateY(-3px)
            rotate(1deg)
            scale(0.95);
    }

    50% {
        transform:
            translateX(-170px)
            translateY(3px)
            rotate(-1deg)
            scale(0.98);
    }

    75% {
        transform:
            translateX(-70px)
            translateY(-2px)
            rotate(1deg)
            scale(1);
    }

    100% {
        transform:
            translateX(0)
            translateY(0)
            rotate(0)
            scale(1);
    }
}


/* =========================================================
   IDLE
   ========================================================= */

@keyframes ujjawalIdle {

    0%,
    100% {
        transform:
            translateY(0)
            rotate(0);
    }

    50% {
        transform:
            translateY(-4px)
            rotate(-0.6deg);
    }
}


/* =========================================================
   WALK OUT
   ========================================================= */

@keyframes ujjawalWalkOut {

    0% {
        transform:
            translateX(0)
            translateY(0)
            rotate(0);
    }

    25% {
        transform:
            translateX(30px)
            translateY(-5px)
            rotate(1deg);
    }

    50% {
        transform:
            translateX(80px)
            translateY(4px)
            rotate(-1deg);
    }

    75% {
        transform:
            translateX(140px)
            translateY(-4px)
            rotate(1deg);
    }

    100% {
        transform:
            translateX(220px)
            translateY(0)
            rotate(0);
    }
}


/* =========================================================
   SUCCESS
   ========================================================= */

@keyframes successPop {

    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .lead-popup-scene {
        width: 100vw;
        height: 100vh;
    }

    .lead-walking-character {
        width: 145px;
        height: 250px;

        left: 0;
        bottom: 8%;

        z-index: 30;
    }

    .lead-popup-card {
        width: calc(100vw - 24px);

        min-height: auto;

        margin-left: 0;

        border-radius: 26px;
    }

    .lead-popup-content {
        padding: 38px 22px 25px;
    }

    .lead-popup-greeting {
        font-size: 27px;
    }

    .lead-popup-content h2 {
        font-size: 30px;
    }

    .lead-popup-description {
        font-size: 14px;
    }

    .lead-phone-field {
        height: 60px;
    }

    .lead-country-code {
        padding: 0 13px;
        font-size: 14px;
    }

    .lead-phone-field input {
        font-size: 16px;
    }

    .lead-popup-overlay.is-departing
    .lead-popup-scene {
        transform:
            translateX(120vw);
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .lead-popup-overlay,
    .lead-popup-scene,
    .lead-popup-card,
    .lead-walking-character {
        transition: none !important;
        animation: none !important;
    }
}