/* WhatsApp Popup Lead - Frontend styles */

/* ==========================
   PHONE MASK + COUNTRY SELECTOR
   Estilos com alta especificidade pra sobreviver a CSS do tema
   ========================== */
.wpl-modal .wpl-phone-wrap,
.wpl-phone-wrap {
    position: relative !important;
    display: flex !important;
    align-items: stretch !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    overflow: visible !important;
    transition: border-color .15s, box-shadow .15s !important;
    background: #fff !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.wpl-phone-wrap:focus-within {
    border-color: var(--wpl-primary, #25D366) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wpl-primary, #25D366) 18%, transparent) !important;
}
.wpl-modal .wpl-phone-wrap input[type="tel"],
.wpl-phone-wrap input[type="tel"] {
    border: none !important;
    border-radius: 0 !important;
    padding: 11px 14px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    width: auto !important;
}
.wpl-phone-wrap input[type="tel"]:focus {
    box-shadow: none !important;
    outline: none !important;
}
.wpl-modal .wpl-phone-flag,
.wpl-phone-flag {
    background: #f8fafc !important;
    border: none !important;
    border-right: 1px solid #e2e8f0 !important;
    padding: 0 14px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    color: #1a1a1a !important;
    font-family: inherit !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background .15s !important;
    flex: 0 0 auto !important;
    min-width: 72px !important;
    height: auto !important;
    line-height: 1.2 !important;
    letter-spacing: .02em !important;
}
.wpl-phone-flag:hover { background: #f1f5f9 !important; }
.wpl-phone-flag:focus { outline: none !important; }
.wpl-phone-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    z-index: 100;
    margin-top: 4px;
    min-width: 200px;
    overflow: hidden;
}
.wpl-phone-opt {
    display: block !important;
    width: 100% !important;
    text-align: left !important;
    background: transparent !important;
    border: none !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    color: #1a1a1a !important;
    font-family: inherit !important;
}
.wpl-phone-opt:hover { background: #f1f5f9 !important; }

.wpl-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    font-weight: 600;
    font-family: inherit;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease, background .15s ease, color .15s ease;
}
.wpl-trigger:hover { transform: translateY(-1px); }
.wpl-trigger:active { transform: translateY(0); }
.wpl-trigger-icon { width: 1.1em; height: 1.1em; flex-shrink: 0; }

/* Tamanhos */
.wpl-s-sm { padding: 10px 18px; font-size: 14px; }
.wpl-s-md { padding: 14px 28px; font-size: 16px; }
.wpl-s-lg { padding: 18px 36px; font-size: 18px; }

/* Formato */
.wpl-r-rounded { border-radius: 8px; }
.wpl-r-pill    { border-radius: 999px; }
.wpl-r-square  { border-radius: 2px; }

/* Largura total */
.wpl-full { width: 100%; }

/* Variante: filled (padrão) */
.wpl-v-filled {
    background: var(--wpl-primary, #25D366);
    color: #fff;
    border-color: var(--wpl-primary, #25D366);
}
.wpl-v-filled:hover { filter: brightness(1.05); box-shadow: 0 6px 16px rgba(0,0,0,.15); }

/* Variante: outline */
.wpl-v-outline {
    background: transparent;
    color: var(--wpl-primary, #25D366);
    border-color: var(--wpl-primary, #25D366);
}
.wpl-v-outline:hover {
    background: var(--wpl-primary, #25D366);
    color: #fff;
}

/* Variante: soft (fundo tingido) */
.wpl-v-soft {
    background: color-mix(in srgb, var(--wpl-primary, #25D366) 14%, transparent);
    color: var(--wpl-primary, #25D366);
    border-color: transparent;
}
.wpl-v-soft:hover {
    background: color-mix(in srgb, var(--wpl-primary, #25D366) 24%, transparent);
}

/* Variante: ghost (somente texto, sem fundo) */
.wpl-v-ghost {
    background: transparent;
    color: var(--wpl-primary, #25D366);
    border-color: transparent;
    padding-left: 12px;
    padding-right: 12px;
}
.wpl-v-ghost:hover {
    background: color-mix(in srgb, var(--wpl-primary, #25D366) 10%, transparent);
}

/* ==========================
   FAB (botão flutuante)
   ========================== */
.wpl-fab {
    position: fixed;
    z-index: 99998;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--wpl-primary, #25D366);
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 15px;
    line-height: 1;
    padding: 14px;
    border-radius: 999px;
    box-shadow: 0 6px 24px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.08);
    transition: transform .2s ease, box-shadow .2s ease, filter .15s ease;
    opacity: 0;
    transform: scale(.6) translateY(20px);
    pointer-events: none;
}
.wpl-fab.is-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
    animation: wpl-fab-in .4s cubic-bezier(.16, 1, .3, 1);
}
.wpl-fab:hover { filter: brightness(1.05); transform: scale(1.04); box-shadow: 0 10px 30px rgba(0,0,0,.22), 0 2px 6px rgba(0,0,0,.1); }
.wpl-fab:active { transform: scale(.98); }

.wpl-fab-bottom-right { bottom: var(--wpl-fab-offset-y, 24px); right: var(--wpl-fab-offset-x, 24px); }
.wpl-fab-bottom-left  { bottom: var(--wpl-fab-offset-y, 24px); left:  var(--wpl-fab-offset-x, 24px); }

.wpl-fab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}
.wpl-fab-icon svg { width: 100%; height: 100%; }

.wpl-fab-label { padding-right: 8px; white-space: nowrap; }
.wpl-fab:not(.wpl-fab-with-label) .wpl-fab-label { display: none; }
.wpl-fab:not(.wpl-fab-with-label) { padding: 14px; }

/* Pulse animation */
.wpl-fab-pulse::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--wpl-primary, #25D366);
    z-index: -1;
    animation: wpl-pulse 2s ease-out infinite;
    opacity: .6;
}

@keyframes wpl-pulse {
    0%   { transform: scale(1);    opacity: .6; }
    70%  { transform: scale(1.4);  opacity: 0;  }
    100% { transform: scale(1.4);  opacity: 0;  }
}
@keyframes wpl-fab-in {
    from { opacity: 0; transform: scale(.6) translateY(30px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Animações de entrada do FAB */
.wpl-fab.is-visible.wpl-fab-anim-fade { animation: wpl-fab-fade .4s ease; }
.wpl-fab.is-visible.wpl-fab-anim-bounce { animation: wpl-fab-bounce .7s cubic-bezier(.68,-.55,.27,1.55); }
.wpl-fab.is-visible.wpl-fab-anim-slide { animation: wpl-fab-slide .5s ease; }
.wpl-fab.is-visible.wpl-fab-anim-shake { animation: wpl-fab-shake .6s ease; }
.wpl-fab.is-visible.wpl-fab-anim-none { animation: none; }

@keyframes wpl-fab-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes wpl-fab-bounce {
    0%   { opacity: 0; transform: scale(.3); }
    50%  { opacity: 1; transform: scale(1.1); }
    70%  { transform: scale(.95); }
    100% { transform: scale(1); }
}
@keyframes wpl-fab-slide {
    from { opacity: 0; transform: translateY(50px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes wpl-fab-shake {
    0%, 100% { transform: translateX(0); opacity: 1; }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

/* Notification bubble */
.wpl-fab-bubble {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ef4444;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,.2);
    animation: wpl-bubble-pulse 1.5s ease-in-out infinite;
}
@keyframes wpl-bubble-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}

/* Visibilidade por dispositivo */
@media (max-width: 768px) {
    .wpl-fab-hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
    .wpl-fab-hide-desktop { display: none !important; }
}

/* Modal */
.wpl-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.wpl-modal.is-open { display: flex; }
.wpl-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .6);
    backdrop-filter: blur(2px);
    animation: wpl-fade .2s ease;
}
.wpl-modal-content {
    position: relative;
    background: var(--wpl-bg, #fff);
    color: var(--wpl-text, #1a1a1a);
    width: 100%;
    max-width: 440px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0,0,0,.25);
    padding: 32px 28px 28px;
    animation: wpl-pop .25s cubic-bezier(.16, 1, .3, 1);
    box-sizing: border-box;
}
.wpl-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: inherit;
    opacity: .5;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: opacity .15s, background .15s;
}
.wpl-modal-close:hover { opacity: 1; background: rgba(0,0,0,.05); }

.wpl-modal-header { text-align: center; margin-bottom: 22px; }
.wpl-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--wpl-primary, #25D366);
    color: #fff;
    margin-bottom: 12px;
}
.wpl-modal-title {
    font-size: 22px;
    line-height: 1.3;
    margin: 0 0 6px;
    font-weight: 700;
    color: inherit;
}
.wpl-modal-subtitle {
    font-size: 14px;
    line-height: 1.5;
    opacity: .7;
    margin: 0;
    color: inherit;
}

/* Form */
.wpl-form-popup { display: flex; flex-direction: column; gap: 14px; }
.wpl-field { display: flex; flex-direction: column; gap: 6px; }
.wpl-label {
    font-size: 13px;
    font-weight: 600;
    color: inherit;
    opacity: .85;
}
.wpl-required { color: #ef4444; margin-left: 2px; }

.wpl-form-popup input[type="text"],
.wpl-form-popup input[type="email"],
.wpl-form-popup input[type="tel"],
.wpl-form-popup input[type="number"],
.wpl-form-popup textarea,
.wpl-form-popup select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: #1a1a1a;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}
.wpl-form-popup input:focus,
.wpl-form-popup textarea:focus,
.wpl-form-popup select:focus {
    outline: none;
    border-color: var(--wpl-primary, #25D366);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wpl-primary, #25D366) 18%, transparent);
}

.wpl-consent { font-size: 12px; opacity: .8; }
.wpl-consent label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.wpl-consent input { margin-top: 3px; }

.wpl-message {
    font-size: 13px;
    min-height: 0;
    transition: min-height .15s;
}
.wpl-message.is-error { color: #ef4444; min-height: 18px; }
.wpl-message.is-success { color: #16a34a; min-height: 18px; }

.wpl-submit {
    background: var(--wpl-primary, #25D366);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 6px;
    transition: filter .15s, transform .15s;
    font-family: inherit;
}
.wpl-submit:hover:not(:disabled) { filter: brightness(1.05); }
.wpl-submit:disabled { opacity: .7; cursor: wait; }

/* Honeypot escondido */
.wpl-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

@keyframes wpl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wpl-pop {
    from { opacity: 0; transform: translateY(20px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
    .wpl-modal-content { padding: 26px 20px 22px; border-radius: 14px; }
    .wpl-modal-title { font-size: 19px; }
}
