/* Franco Galvânica - WhatsApp Lead Popup */
.fwl-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.fwl-modal {
    background: #ffffff;
    border-radius: 16px;
    padding: 36px 32px 28px;
    width: 100%;
    max-width: 480px;
    position: relative;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
    max-height: 92vh;
    overflow-y: auto;
    font-family: Montserrat, sans-serif;
}

/* Close */
.fwl-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    padding: 0;
}
.fwl-close:hover { background: #e0e0e0; color: #222; }

/* Header */
.fwl-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
    padding-right: 36px;
}

.fwl-icon {
    width: 50px;
    height: 50px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}
.fwl-icon svg { width: 26px; height: 26px; }

.fwl-header-text h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 3px 0 5px;
    line-height: 1.3;
    font-family: Montserrat, sans-serif;
}
.fwl-header-text p {
    font-size: 0.85rem;
    color: #777;
    margin: 0;
}

/* Fields */
.fwl-field {
    margin-bottom: 10px;
}

#fwl-overlay .fwl-field input[type="text"],
#fwl-overlay .fwl-field input[type="email"],
#fwl-overlay .fwl-field input[type="tel"],
#fwl-overlay .fwl-field textarea,
#fwl-overlay .fwl-field select {
    width: 100% !important;
    border: 1.5px solid #ddd !important;
    border-radius: 8px !important;
    padding: 12px 14px !important;
    font-size: 0.9rem !important;
    color: #1a1a1a !important;
    background: #fafafa !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
    box-sizing: border-box !important;
    font-family: Montserrat, inherit !important;
    margin: 0 !important;
    line-height: normal !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    display: block !important;
}

#fwl-overlay .fwl-field input::placeholder,
#fwl-overlay .fwl-field textarea::placeholder {
    color: #aaa !important;
}

#fwl-overlay .fwl-field input:focus,
#fwl-overlay .fwl-field textarea:focus,
#fwl-overlay .fwl-field select:focus {
    border-color: #32373c !important;
    box-shadow: 0 0 0 3px rgba(50,55,60,0.1) !important;
    background: #fff !important;
}

#fwl-overlay .fwl-field textarea {
    resize: vertical !important;
    min-height: 88px !important;
}

/* Phone wrapper with DDI */
.fwl-phone-wrapper {
    display: flex !important;
    gap: 8px !important;
    align-items: stretch !important;
}

/* Esconde o <select> nativo do tema (Salient/select2) — usamos o dropdown custom */
#fwl-overlay .fwl-ddi-native,
#fwl-overlay .fwl-phone-wrapper .select2-container {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    border: 0 !important;
}

/* Dropdown customizado de país (bandeira + nome + DDI) */
.fwl-cc {
    position: relative;
    flex: 0 0 auto;
    max-width: 168px;
}
#fwl-overlay .fwl-cc-trigger {
    display: flex !important;
    align-items: center;
    gap: 6px;
    width: 100%;
    height: 100%;
    border: 1.5px solid #ddd !important;
    border-radius: 8px !important;
    padding: 12px 12px !important;
    background: #fafafa !important;
    color: #1a1a1a !important;
    font-family: Montserrat, inherit !important;
    font-size: 0.9rem !important;
    line-height: 1.1 !important;
    cursor: pointer !important;
    white-space: nowrap;
    box-sizing: border-box !important;
    box-shadow: none !important;
    text-align: left;
}
#fwl-overlay .fwl-cc-trigger:hover { border-color: #bbb !important; }
.fwl-cc.open .fwl-cc-trigger {
    border-color: #32373c !important;
    box-shadow: 0 0 0 3px rgba(50, 55, 60, 0.1) !important;
    background: #fff !important;
}
.fwl-cc-flag { font-size: 1.1rem; line-height: 1; flex: 0 0 auto; }
.fwl-cc-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fwl-cc-ddi { flex: 0 0 auto; color: #555; font-weight: 600; }
.fwl-cc-arrow {
    flex: 0 0 auto;
    width: 10px;
    height: 7px;
    color: #888;
    transition: transform 0.15s;
}
.fwl-cc.open .fwl-cc-arrow { transform: rotate(180deg); }

.fwl-cc-list {
    position: absolute;
    z-index: 10;
    top: calc(100% + 4px);
    left: 0;
    min-width: 248px;
    max-width: 78vw;
    max-height: 244px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 6px;
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
    display: none;
}
.fwl-cc.open .fwl-cc-list { display: block; }
.fwl-cc-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 7px;
    cursor: pointer;
    font-family: Montserrat, inherit;
    font-size: 0.9rem;
    color: #1a1a1a;
}
.fwl-cc-list li:hover,
.fwl-cc-list li.sel { background: #f0f7f2; }
.fwl-cc-list .fwl-cc-li-flag { font-size: 1.15rem; line-height: 1; }
.fwl-cc-list .fwl-cc-li-nome { flex: 1 1 auto; }
.fwl-cc-list .fwl-cc-li-ddi { flex: 0 0 auto; color: #888; font-weight: 600; }

#fwl-overlay .fwl-phone-wrapper input[type="tel"] {
    flex: 1 1 auto !important;
    width: 0 !important;
    min-width: 0 !important;
}

/* Error */
.fwl-error {
    display: block;
    font-size: 0.75rem;
    color: #e53e3e;
    margin-top: 4px;
    min-height: 0;
}

/* Submit */
#fwl-overlay #fwl-submit,
#fwl-overlay .fwl-submit {
    display: block !important;
    width: 100% !important;
    background: #25d366 !important;
    background-color: #25d366 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 9999px !important;
    padding: 15px 24px !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    cursor: pointer !important;
    transition: background 0.15s, transform 0.1s !important;
    margin-top: 8px !important;
    font-family: Montserrat, inherit !important;
    text-align: center !important;
    box-shadow: none !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
}
#fwl-overlay #fwl-submit:hover,
#fwl-overlay .fwl-submit:hover  { background: #1ebe59 !important; background-color: #1ebe59 !important; }
#fwl-overlay #fwl-submit:active,
#fwl-overlay .fwl-submit:active { transform: scale(0.98) !important; }
#fwl-overlay #fwl-submit:disabled,
#fwl-overlay .fwl-submit:disabled { background: #a0d8b3 !important; cursor: not-allowed !important; }

/* LGPD */
.fwl-lgpd {
    text-align: center;
    font-size: 0.7rem;
    color: #bbb;
    margin: 10px 0 0;
}

/* Success */
.fwl-success {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0fff4;
    border: 1.5px solid #25d366;
    border-radius: 8px;
    padding: 12px 16px;
    color: #276749;
    font-weight: 600;
    margin-top: 10px;
    font-size: 0.88rem;
}
.fwl-success svg { width: 20px; height: 20px; flex-shrink: 0; fill: #25d366; }

/* Responsive */
@media (max-width: 480px) {
    .fwl-modal { padding: 24px 20px 20px; }
    /* Mantém DDI ao LADO do número (não empilha) para o campo não colapsar */
    .fwl-phone-wrapper { flex-direction: row; }
    .fwl-cc { max-width: 50%; }
    .fwl-cc-list { min-width: 220px; }
}
