/* =========================================================
   WHATSAPP POPUP — PREMIUM V2
   Replace your existing whatsapp-popup.css with this file.
   PHP + JS do not need to change.
========================================================= */

:root {
    --wa-green: #25d366;
    --wa-green-2: #19c65b;
    --wa-deep: #0c9f47;
    --wa-ink: #101828;
    --wa-muted: #667085;
    --wa-border: #e7ebef;
    --wa-danger: #ef4444;
}


/* =========================================================
   FLOATING BUTTON
========================================================= */

.vv-whatsapp-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99990;

    width: 64px;
    height: 64px;
    padding: 0;

    border: 0;
    border-radius: 50%;

    background: linear-gradient(145deg, #31e579 0%, #19c65b 100%);
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    box-shadow:
        0 14px 32px rgba(37, 211, 102, .28),
        0 5px 14px rgba(0, 0, 0, .13);

    transition: transform .28s cubic-bezier(.2,.8,.2,1),
                box-shadow .28s ease;
}

.vv-whatsapp-button::before {
    content: "";
    position: absolute;
    inset: -7px;
    border: 1px solid rgba(37, 211, 102, .25);
    border-radius: 50%;
    animation: waPulse 2.5s ease-out infinite;
}

.vv-whatsapp-button:hover {
    transform: translateY(-5px) scale(1.06);
    box-shadow:
        0 20px 42px rgba(37, 211, 102, .34),
        0 7px 18px rgba(0, 0, 0, .15);
}

.vv-whatsapp-button svg {
    width: 35px;
    height: 35px;
    fill: #fff;
}

@keyframes waPulse {
    0% {
        opacity: .65;
        transform: scale(.96);
    }
    70% {
        opacity: 0;
        transform: scale(1.27);
    }
    100% {
        opacity: 0;
        transform: scale(1.27);
    }
}


/* =========================================================
   MODAL
========================================================= */

.vv-whatsapp-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 22px;
}

.vv-whatsapp-modal.is-open {
    display: flex;
}

.vv-whatsapp-overlay {
    position: absolute;
    inset: 0;

    background:
        radial-gradient(circle at 50% 20%, rgba(37,211,102,.11), transparent 28%),
        rgba(7, 14, 25, .72);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}


/* =========================================================
   PREMIUM CARD
========================================================= */

.vv-whatsapp-dialog {
    position: relative;
    z-index: 1;

    width: 100%;
    max-width: 510px;
    max-height: calc(100vh - 42px);

    overflow-y: auto;
    overflow-x: hidden;

    box-sizing: border-box;

    padding: 0 30px 30px;

    border: 1px solid rgba(255,255,255,.78);
    border-radius: 30px;

    background: #fff;

    box-shadow:
        0 40px 110px rgba(0,0,0,.30),
        0 12px 35px rgba(0,0,0,.12);

    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;

    animation: waCardIn .42s cubic-bezier(.16,1,.3,1);
}

.vv-whatsapp-dialog::before {
    content: "";

    display: block;

    height: 6px;

    margin: 0 -30px;

    background: linear-gradient(
        90deg,
        #13b653 0%,
        #25d366 45%,
        #78ed9d 100%
    );
}

.vv-whatsapp-dialog::after {
    content: "";

    position: absolute;
    width: 180px;
    height: 180px;

    right: -85px;
    top: 70px;

    border-radius: 50%;

    background: rgba(37,211,102,.055);

    pointer-events: none;
}

@keyframes waCardIn {
    from {
        opacity: 0;
        transform: translateY(28px) scale(.955);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.vv-whatsapp-dialog::-webkit-scrollbar {
    width: 6px;
}

.vv-whatsapp-dialog::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 20px;
}


/* =========================================================
   CLOSE
========================================================= */

.vv-whatsapp-close {
    position: absolute;
    top: 22px;
    right: 22px;
    z-index: 10;

    width: 38px;
    height: 38px;

    padding: 0;

    border: 1px solid rgba(255,255,255,.7);
    border-radius: 50%;

    background: rgba(255,255,255,.72);
    color: #667085;

    font-size: 21px;
    line-height: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    box-shadow: 0 5px 15px rgba(16,24,40,.07);

    transition:
        transform .25s ease,
        background .25s ease,
        color .25s ease;
}

.vv-whatsapp-close:hover {
    background: #fff;
    color: #101828;
    transform: rotate(90deg);
}


/* =========================================================
   HERO HEADER
========================================================= */

.vv-whatsapp-header {
    position: relative;

    display: flex;
    align-items: center;
    gap: 16px;

    margin: 0 -30px 27px;
    padding: 28px 30px 25px;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 88% 20%,
            rgba(37,211,102,.17),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            #f4fff7 0%,
            #fbfffc 48%,
            #fff 100%
        );

    border-bottom: 1px solid #edf2ef;
}

.vv-whatsapp-header::before {
    content: "";

    position: absolute;

    width: 150px;
    height: 150px;

    right: -65px;
    top: -78px;

    border-radius: 50%;

    background: rgba(37,211,102,.08);
}

.vv-whatsapp-header::after {
    content: "👋";

    position: absolute;

    right: 62px;
    bottom: 11px;

    font-size: 21px;

    transform-origin: 70% 80%;

    animation: waWave 2.4s ease-in-out infinite;
}

@keyframes waWave {
    0%, 100% {
        transform: rotate(-7deg) translateY(0);
    }
    20% {
        transform: rotate(13deg) translateY(-2px);
    }
    40% {
        transform: rotate(-11deg) translateY(-3px);
    }
    60% {
        transform: rotate(9deg) translateY(-2px);
    }
    80% {
        transform: rotate(-4deg);
    }
}


/* =========================================================
   HEADER ICON
========================================================= */

.vv-whatsapp-icon {
    position: relative;
    z-index: 1;

    width: 60px;
    height: 60px;
    flex: 0 0 60px;

    border-radius: 19px;

    background: linear-gradient(
        145deg,
        #31e579,
        #17bb56
    );

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow:
        0 11px 24px rgba(37,211,102,.25),
        inset 0 1px 0 rgba(255,255,255,.35);

    animation: waIconFloat 3.5s ease-in-out infinite;
}

.vv-whatsapp-icon::before {
    content: "";

    position: absolute;
    inset: 5px;

    border: 1px solid rgba(255,255,255,.25);
    border-radius: 15px;
}

.vv-whatsapp-icon::after {
    content: "";

    position: absolute;

    width: 9px;
    height: 9px;

    right: -2px;
    top: -2px;

    border-radius: 50%;

    background: #fff;

    box-shadow:
        0 0 0 4px rgba(37,211,102,.15);
}

.vv-whatsapp-icon svg {
    position: relative;
    z-index: 2;

    width: 32px;
    height: 32px;

    fill: #fff;
}

@keyframes waIconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}


/* =========================================================
   HEADER TEXT
========================================================= */

.vv-whatsapp-header > div:last-child {
    position: relative;
    z-index: 2;
}

.vv-whatsapp-header h2 {
    margin: 0 0 5px;

    color: #101828;

    font-size: 25px;
    line-height: 1.15;
    font-weight: 800;

    letter-spacing: -.55px;
}

.vv-whatsapp-header p {
    margin: 0;

    color: #667085;

    font-size: 14px;
    line-height: 1.45;
}


/* =========================================================
   FORM LABELS
========================================================= */

.vv-form-group {
    margin-bottom: 18px;
}

.vv-form-group label {
    display: block;

    margin-bottom: 8px;

    color: #172033;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.vv-form-group label span {
    color: #ef4444;
}


/* =========================================================
   INPUTS
========================================================= */

.vv-form-group input,
.vv-form-group textarea {
    width: 100%;

    box-sizing: border-box;

    border: 1px solid #e1e6ec;
    border-radius: 15px;

    padding: 14px 16px;

    background:
        linear-gradient(
            180deg,
            #fcfdfe 0%,
            #f8fafc 100%
        );

    color: #101828;

    font-family: inherit;
    font-size: 15px;
    line-height: 1.45;

    outline: none;

    box-shadow:
        inset 0 1px 2px rgba(16,24,40,.025);

    transition:
        border-color .22s ease,
        box-shadow .22s ease,
        background .22s ease,
        transform .22s ease;
}

.vv-form-group input {
    height: 52px;
}

.vv-form-group textarea {
    min-height: 112px;
    resize: vertical;
}

.vv-form-group input::placeholder,
.vv-form-group textarea::placeholder {
    color: #98a2b3;
}

.vv-form-group input:hover,
.vv-form-group textarea:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.vv-form-group input:focus,
.vv-form-group textarea:focus {
    border-color: #25d366;

    background: #fff;

    box-shadow:
        0 0 0 4px rgba(37,211,102,.095),
        0 8px 20px rgba(16,24,40,.055);

    transform: translateY(-1px);
}


/* =========================================================
   ERRORS
========================================================= */

.vv-form-group.has-error input,
.vv-form-group.has-error textarea {
    border-color: #ef4444;

    box-shadow:
        0 0 0 4px rgba(239,68,68,.065);
}

.vv-error {
    display: block;

    min-height: 0;

    margin-top: 6px;

    color: #ef4444;

    font-size: 12px;
    line-height: 1.35;
}


/* =========================================================
   SUBMIT
========================================================= */

.vv-whatsapp-submit {
    position: relative;
    overflow: hidden;

    width: 100%;

    min-height: 53px;

    margin-top: 3px;

    padding: 14px 20px;

    border: 0;
    border-radius: 15px;

    background:
        linear-gradient(
            135deg,
            #31e579 0%,
            #20cd61 48%,
            #13b653 100%
        );

    color: #fff;

    font-family: inherit;
    font-size: 15px;
    font-weight: 750;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    cursor: pointer;

    box-shadow:
        0 11px 25px rgba(37,211,102,.25),
        inset 0 1px 0 rgba(255,255,255,.28);

    transition:
        transform .22s ease,
        box-shadow .22s ease;
}

.vv-whatsapp-submit::before {
    content: "";

    position: absolute;

    top: 0;
    left: -90px;

    width: 60px;
    height: 100%;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,.38),
        transparent
    );

    transform: skewX(-18deg);
}

.vv-whatsapp-submit:hover {
    transform: translateY(-2px);

    box-shadow:
        0 15px 32px rgba(37,211,102,.30),
        inset 0 1px 0 rgba(255,255,255,.3);
}

.vv-whatsapp-submit:hover::before {
    animation: waButtonShine .65s ease;
}

@keyframes waButtonShine {
    from {
        left: -90px;
    }
    to {
        left: calc(100% + 90px);
    }
}

.vv-whatsapp-submit:active {
    transform: scale(.99);
}

.vv-whatsapp-submit svg {
    width: 19px;
    height: 19px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}


/* =========================================================
   FOOTNOTE
========================================================= */

.vv-whatsapp-note {
    margin: 12px 0 0;

    color: #98a2b3;

    font-size: 11px;
    line-height: 1.5;

    text-align: center;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    .vv-whatsapp-button {
        right: 17px;
        bottom: 17px;

        width: 57px;
        height: 57px;
    }

    .vv-whatsapp-button svg {
        width: 31px;
        height: 31px;
    }

    .vv-whatsapp-modal {
        padding: 9px;
    }

    .vv-whatsapp-dialog {
        max-height: calc(100vh - 18px);

        padding: 0 20px 22px;

        border-radius: 24px;
    }

    .vv-whatsapp-dialog::before {
        margin-left: -20px;
        margin-right: -20px;
    }

    .vv-whatsapp-header {
        margin-left: -20px;
        margin-right: -20px;

        padding: 22px 20px 20px;

        gap: 12px;
    }

    .vv-whatsapp-header::after {
        right: 47px;
        bottom: 8px;

        font-size: 18px;
    }

    .vv-whatsapp-header h2 {
        font-size: 21px;
    }

    .vv-whatsapp-header p {
        font-size: 13px;
    }

    .vv-whatsapp-icon {
        width: 51px;
        height: 51px;
        flex-basis: 51px;

        border-radius: 16px;
    }

    .vv-whatsapp-icon svg {
        width: 27px;
        height: 27px;
    }

    .vv-whatsapp-close {
        top: 16px;
        right: 15px;

        width: 34px;
        height: 34px;
    }

    .vv-form-group {
        margin-bottom: 14px;
    }

    .vv-form-group input {
        height: 49px;
    }

    .vv-form-group textarea {
        min-height: 100px;
    }
}


/* =========================================================
   ACCESSIBILITY
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .vv-whatsapp-button,
    .vv-whatsapp-button::before,
    .vv-whatsapp-dialog,
    .vv-whatsapp-icon,
    .vv-whatsapp-header::after,
    .vv-whatsapp-submit::before {
        animation: none !important;
        transition: none !important;
    }
}
