/* ===========================================
   LeadNest — Frontend Styles
   =========================================== */

/* ── Floating Button ── */
#leadnest-wa-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#leadnest-wa-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

#leadnest-wa-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#leadnest-wa-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* Pulse animation ring */
.leadnest-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    opacity: 0.5;
    animation: leadnest-pulse 2s ease-out infinite;
    pointer-events: none;
}

@keyframes leadnest-pulse {
    0%   { transform: scale(1);   opacity: 0.5; }
    70%  { transform: scale(1.5); opacity: 0;   }
    100% { transform: scale(1.5); opacity: 0;   }
}

/* ── Popup ── */
#leadnest-popup {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 330px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    z-index: 99998;
    animation: leadnest-slideup 0.25s ease;
}

@keyframes leadnest-slideup {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0);    }
}

#leadnest-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    color: #fff;
}

#leadnest-popup-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

#leadnest-close-btn {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

#leadnest-close-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

#leadnest-popup-body {
    padding: 20px;
}

/* ── Form Fields ── */
.leadnest-field {
    margin-bottom: 14px;
}

.leadnest-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.leadnest-field .req {
    color: #e74c3c;
}

.leadnest-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    background: #fafafa;
}

.leadnest-field input:focus {
    border-color: #25D366;
    background: #fff;
}

.leadnest-field input.leadnest-error {
    border-color: #e74c3c;
}

/* ── Field Description / Helper Text (Pro) ── */
.leadnest-field-desc {
    margin: 4px 0 0;
    font-size: 11px;
    color: #888;
    line-height: 1.4;
}

/* ── Form Message ── */
#leadnest-form-msg {
    font-size: 13px;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    display: none;
}

#leadnest-form-msg.leadnest-msg-error {
    background: #fdecea;
    color: #c0392b;
    display: block;
}

#leadnest-form-msg.leadnest-msg-success {
    background: #eafaf1;
    color: #1e8449;
    display: block;
}

/* ── Submit Button ── */
#leadnest-submit-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s, transform 0.1s;
}

#leadnest-submit-btn:hover {
    opacity: 0.9;
}

#leadnest-submit-btn:active {
    transform: scale(0.98);
}

#leadnest-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Responsive ── */
@media (max-width: 400px) {
    #leadnest-popup {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 88px;
    }

    #leadnest-wa-btn {
        width: 52px;
        height: 52px;
        right: 16px;
        bottom: 16px;
    }
}
