/* ==========================================================================
   WhatsPro - Design System & Styles for Frontend Elements
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. RESET E PREVENÇÃO DE DEFORMAÇÃO DE SVG & CONTAINERS
   -------------------------------------------------------------------------- */
#wlc-float svg,
#wlc-popup svg,
.wlc-inline-cta-card svg,
.wlc-landing svg {
    box-sizing: border-box !important;
    max-width: none !important;
    max-height: none !important;
    flex-shrink: 0 !important;
    aspect-ratio: 1 / 1 !important;
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
}

#wlc-float .wlc-float-btn svg {
    width: 2rem !important;
    height: 2rem !important;
    min-width: 2rem !important;
    min-height: 2rem !important;
}

#wlc-popup .wlc-popup-icon-circle svg {
    width: 2.5rem !important;
    height: 2.5rem !important;
    min-width: 2.5rem !important;
    min-height: 2.5rem !important;
}

#wlc-popup .wlc-popup-cta-btn svg {
    width: 1.5rem !important;
    height: 1.5rem !important;
    min-width: 1.5rem !important;
    min-height: 1.5rem !important;
}

#wlc-popup .wlc-popup-close-btn svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    min-width: 1.25rem !important;
    min-height: 1.25rem !important;
}

.wlc-inline-cta-icon svg {
    width: 1.75rem !important;
    height: 1.75rem !important;
    min-width: 1.75rem !important;
    min-height: 1.75rem !important;
}

.wlc-inline-cta-button svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    min-width: 1.25rem !important;
    min-height: 1.25rem !important;
}

/* --------------------------------------------------------------------------
   1. BOTÃO FLUTUANTE (Floating Widget) - Alta Especificidade (#wlc-float)
   -------------------------------------------------------------------------- */
#wlc-float,
.wlc-float-container {
    position: fixed !important;
    bottom: 4rem !important;
    right: 1.5rem !important;
    z-index: 2147483647 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

#wlc-float.wlc-position-left,
.wlc-float-container.wlc-position-left {
    right: auto !important;
    left: 1.5rem !important;
    flex-direction: row-reverse !important;
}

#wlc-float.wlc-position-left,
.wlc-float-container.wlc-position-left {
    right: auto !important;
    left: 1.5rem !important;
    flex-direction: row-reverse !important;
}

#wlc-float a,
.wlc-float-container a {
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
}

/* Specificity extra (ID do próprio pill) para vencer regras de tema
   agressivas (ex.: temas que aplicam background transparente em <a>
   com !important em IDs de wrapper). */
#wlc-float #wlc-float-pill {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

#wlc-float a.wlc-float-pill,
.wlc-float-container a.wlc-float-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    padding: 0.625rem 1.125rem !important;
    border-radius: 9999px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #e2e8f0 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateX(1rem) scale(0.95) !important;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s !important;
    max-width: calc(100vw - 7rem) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

#wlc-float a.wlc-float-pill.visible,
.wlc-float-container a.wlc-float-pill.visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) scale(1) !important;
}

#wlc-float a.wlc-float-pill:hover,
.wlc-float-container a.wlc-float-pill:hover {
    color: #0f766e !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 28px -5px rgba(0, 0, 0, 0.2) !important;
}

.wlc-float-dot {
    width: 0.5rem !important;
    height: 0.5rem !important;
    min-width: 0.5rem !important;
    min-height: 0.5rem !important;
    background-color: #22c55e !important;
    border-radius: 9999px !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2) !important;
    flex-shrink: 0 !important;
}

.wlc-float-text {
    color: #1e293b !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

#wlc-float .wlc-float-btn,
.wlc-float-btn {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 3.75rem !important;
    height: 3.75rem !important;
    min-width: 3.75rem !important;
    min-height: 3.75rem !important;
    border-radius: 9999px !important;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 25px -5px rgba(37, 211, 102, 0.4), 0 8px 10px -6px rgba(37, 211, 102, 0.2) !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease !important;
}

#wlc-float .wlc-float-btn:hover,
.wlc-float-btn:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 14px 30px -4px rgba(37, 211, 102, 0.55) !important;
}

/* --------------------------------------------------------------------------
   2. POPUP MODAL (Glassmorphism & High-Conversion)
   -------------------------------------------------------------------------- */
#wlc-popup,
.wlc-popup-overlay {
    visibility: hidden;
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483647 !important;
    background: rgba(2, 6, 23, 0.72) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1.25rem !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

#wlc-popup.active,
.wlc-popup-overlay.active {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto;
    display: flex !important;
}

.wlc-popup-card {
    position: relative !important;
    border-radius: 1.75rem !important;
    padding: 2.25rem 2rem 1.5rem !important;
    max-width: 27rem !important;
    width: 100% !important;
    max-height: calc(100vh - 2.5rem) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    text-align: center !important;
    background:
        radial-gradient(120% 90% at 50% -15%, rgba(37, 211, 102, 0.14) 0%, rgba(37, 211, 102, 0.04) 45%, transparent 70%),
        linear-gradient(180deg, #ffffff 0%, #f6fdf9 100%) !important;
    border: 1px solid rgba(37, 211, 102, 0.22) !important;
    box-shadow:
        0 30px 60px -15px rgba(0, 0, 0, 0.35),
        0 0 45px -5px rgba(37, 211, 102, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    transform: scale(0.88) translateY(1.25rem) !important;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

#wlc-popup.active .wlc-popup-card,
.wlc-popup-overlay.active .wlc-popup-card {
    transform: scale(1) translateY(0) !important;
}

/* Brilho decorativo no topo do card */
.wlc-popup-card::before {
    content: '' !important;
    position: absolute !important;
    top: -1px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 55% !important;
    height: 3px !important;
    border-radius: 9999px !important;
    background: linear-gradient(90deg, transparent, #25D366, #128C7E, transparent) !important;
    box-shadow: 0 0 12px rgba(37, 211, 102, 0.55) !important;
}

.wlc-popup-close-btn {
    position: absolute !important;
    top: 0.75rem !important;
    right: 0.75rem !important;
    width: 2.75rem !important;
    height: 2.75rem !important;
    min-width: 2.75rem !important;
    min-height: 2.75rem !important;
    border-radius: 9999px !important;
    background: #eef2f7 !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #64748b !important;
    cursor: pointer !important;
    transition: background 0.2s, color 0.2s, transform 0.2s !important;
    z-index: 2 !important;
}

.wlc-popup-close-btn:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    transform: rotate(90deg) scale(1.05) !important;
}

.wlc-popup-header {
    margin-bottom: 1.1rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.wlc-popup-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
    color: #15803d !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    padding: 0.4rem 1rem !important;
    border-radius: 9999px !important;
    margin-bottom: 1.1rem !important;
    box-shadow: 0 4px 10px -2px rgba(34, 197, 94, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(22, 163, 74, 0.15) !important;
}

.wlc-popup-badge::before {
    content: '' !important;
    width: 0.45rem !important;
    height: 0.45rem !important;
    border-radius: 9999px !important;
    background: #22c55e !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25) !important;
    animation: wlcBadgePulse 2s ease-in-out infinite !important;
}

@keyframes wlcBadgePulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25); }
    50% { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.1); }
}

.wlc-popup-icon-wrap {
    position: relative !important;
}

.wlc-popup-icon-circle {
    position: relative !important;
    width: 5rem !important;
    height: 5rem !important;
    border-radius: 9999px !important;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 14px 28px -6px rgba(18, 140, 126, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

.wlc-popup-icon-circle svg {
    color: #ffffff !important;
    fill: currentColor !important;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2)) !important;
}

.wlc-popup-icon-ring {
    position: absolute !important;
    inset: -0.5rem !important;
    border-radius: 9999px !important;
    border: 2px solid rgba(37, 211, 102, 0.35) !important;
    animation: wlcRing 2.4s cubic-bezier(0.215, 0.61, 0.355, 1) infinite !important;
    pointer-events: none !important;
}

@keyframes wlcRing {
    0% { transform: scale(0.9); opacity: 1; }
    70%, 100% { transform: scale(1.3); opacity: 0; }
}

.wlc-popup-headline {
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    background: linear-gradient(120deg, #0f172a 35%, #15803d 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: #0f172a !important;
    line-height: 1.28 !important;
    margin: 0 0 0.625rem !important;
}

.wlc-popup-subline {
    font-size: 0.9375rem !important;
    color: #64748b !important;
    line-height: 1.55 !important;
    margin: 0 0 1.4rem !important;
}

.wlc-popup-cta-btn {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.625rem !important;
    width: 100% !important;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1.05rem !important;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 0.875rem !important;
    padding: 0.9375rem 1.25rem !important;
    box-shadow: 0 12px 24px -6px rgba(37, 211, 102, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
    margin-bottom: 0.9rem !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    overflow: hidden !important;
}

/* Brilho animado que varre o botão */
.wlc-popup-cta-btn::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -60% !important;
    width: 45% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent) !important;
    transform: skewX(-20deg) !important;
    animation: wlcShine 3.2s ease-in-out infinite !important;
}

@keyframes wlcShine {
    0%, 55% { left: -60%; }
    100% { left: 130%; }
}

.wlc-popup-cta-btn:hover {
    transform: translateY(-2px) scale(1.01) !important;
    box-shadow: 0 16px 32px -6px rgba(37, 211, 102, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

.wlc-popup-cta-arrow {
    width: 1.15rem !important;
    height: 1.15rem !important;
    min-width: 1.15rem !important;
    min-height: 1.15rem !important;
    fill: currentColor !important;
    transition: transform 0.2s ease !important;
}

#wlc-popup .wlc-popup-cta-btn .wlc-popup-cta-arrow {
    width: 1.15rem !important;
    height: 1.15rem !important;
    min-width: 1.15rem !important;
    min-height: 1.15rem !important;
}

.wlc-popup-cta-btn:hover .wlc-popup-cta-arrow {
    transform: translateX(3px) !important;
}

.wlc-popup-proof {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.625rem !important;
    margin-bottom: 0.75rem !important;
}

.wlc-popup-avatars {
    display: flex !important;
    align-items: center !important;
}

.wlc-avatar {
    width: 1.8rem !important;
    height: 1.8rem !important;
    min-width: 1.8rem !important;
    min-height: 1.8rem !important;
    border-radius: 9999px !important;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    color: #ffffff !important;
    font-size: 0.7rem !important;
    font-weight: 800 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid #ffffff !important;
    margin-left: -0.5rem !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18) !important;
}

.wlc-avatar:first-child {
    margin-left: 0 !important;
}

.wlc-avatar:nth-child(2) {
    background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%) !important;
}

.wlc-avatar:nth-child(3) {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.wlc-avatar-more {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
}

.wlc-popup-proof-text {
    font-size: 0.8rem !important;
    color: #475569 !important;
    font-weight: 600 !important;
}

.wlc-popup-cancel-btn {
    display: block !important;
    width: 100% !important;
    color: #94a3b8 !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    text-align: center !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0.625rem !important;
    min-height: 2.75rem !important;
    transition: color 0.2s !important;
}

.wlc-popup-cancel-btn:hover {
    color: #334155 !important;
    text-decoration: underline !important;
}


/* --------------------------------------------------------------------------
   3. CTA INLINE NO CONTEÚDO (In-Content Banner)
   -------------------------------------------------------------------------- */
.wlc-inline-cta-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%) !important;
    border: 1px solid #bbf7d0 !important;
    border-left: 5px solid #25D366 !important;
    border-radius: 1rem !important;
    padding: 1.5rem !important;
    margin: 2rem 0 !important;
    box-shadow: 0 10px 25px -5px rgba(34, 197, 94, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.02) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
}

.wlc-inline-cta-content {
    display: flex !important;
    align-items: flex-start !important;
    gap: 1rem !important;
}

.wlc-inline-cta-icon {
    width: 3rem !important;
    height: 3rem !important;
    border-radius: 0.75rem !important;
    background: #25D366 !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3) !important;
}

.wlc-inline-cta-text {
    flex: 1 !important;
}

.wlc-inline-cta-title {
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    color: #0f172a !important;
    margin: 0 0 0.35rem !important;
    line-height: 1.3 !important;
}

.wlc-inline-cta-desc {
    font-size: 0.9375rem !important;
    color: #475569 !important;
    margin: 0 !important;
    line-height: 1.5 !important;
}

.wlc-inline-cta-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    background: #25D366 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 0.625rem !important;
    text-decoration: none !important;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s !important;
    align-self: flex-start !important;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25) !important;
}

.wlc-inline-cta-button:hover {
    background: #1da851 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35) !important;
}

@media (min-width: 640px) {
    .wlc-inline-cta-card {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    .wlc-inline-cta-button {
        align-self: center !important;
        white-space: nowrap !important;
    }
}

/* --------------------------------------------------------------------------
   4. MOBILE & ACESSIBILIDADE
   -------------------------------------------------------------------------- */

/* Legenda do botão flutuante é automaticamente oculta em telas pequenas */
@media (max-width: 639px) {

    #wlc-float .wlc-float-pill,
    .wlc-float-container a.wlc-float-pill {
        display: none !important;
    }

    /* Botão flutuante um pouco menor e bem posicionado no mobile */
    #wlc-float .wlc-float-btn,
    .wlc-float-btn {
        width: 3.5rem !important;
        height: 3.5rem !important;
        min-width: 3.5rem !important;
        min-height: 3.5rem !important;
    }

    /* Popup: menos preenchimento e margens seguras na tela pequena */
    .wlc-popup-card {
        padding: 1.5rem 1.25rem 1.25rem !important;
        max-width: 100% !important;
    }

    #wlc-popup,
    .wlc-popup-overlay {
        padding: 0.75rem !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

/* Respeita usuários que preferem menos movimento (vestibular/acessibilidade) */
@media (prefers-reduced-motion: reduce) {

    .wlc-float-pill,
    .wlc-popup-card,
    .wlc-popup-overlay,
    .wlc-float-btn,
    .wlc-inline-cta-card,
    .wlc-inline-cta-button {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }

    .wlc-popup-badge::before,
    .wlc-popup-icon-ring,
    .wlc-popup-cta-btn::after {
        animation: none !important;
        opacity: 0 !important;
    }
}

/* Foco visível para navegação por teclado (WCAG 2.4.7) */
#wlc-popup .wlc-popup-cta-btn:focus-visible,
#wlc-popup .wlc-popup-close-btn:focus-visible,
#wlc-popup .wlc-popup-cancel-btn:focus-visible,
#wlc-float .wlc-float-btn:focus-visible,
#wlc-float .wlc-float-pill:focus-visible,
.wlc-inline-cta-button:focus-visible {
    outline: 3px solid #0ea5e9 !important;
    outline-offset: 2px !important;
}

/* Travamento do scroll da página enquanto o modal está aberto */
html.wlc-modal-open,
html.wlc-modal-open body {
    overflow: hidden !important;
}