/* ============================================================
   Linking WhatsApp Lead Button — whatsapp-button.css
   Paleta Dakhia: Navy #0d2040 · Gold #f0a500 · WA Green #25D366
   ============================================================ */

:root {
    --lwlb-navy: #0d2040;
    --lwlb-navy-90: rgba(13, 32, 64, 0.92);
    --lwlb-navy-light: #1a3260;
    --lwlb-gold: #f0a500;
    --lwlb-gold-dark: #cc8c00;
    --lwlb-gold-light: #ffd04d;
    --lwlb-green: #25D366;
    --lwlb-green-dark: #1da851;
    --lwlb-green-glow: rgba(37, 211, 102, 0.45);
    --lwlb-white: #ffffff;
    --lwlb-gray-50: #f8fafc;
    --lwlb-gray-100: #f1f5f9;
    --lwlb-gray-200: #e2e8f0;
    --lwlb-gray-400: #94a3b8;
    --lwlb-gray-500: #64748b;
    --lwlb-error: #ef4444;
    --lwlb-error-bg: #fef2f2;
    --lwlb-success: #22c55e;
    --lwlb-success-bg: #f0fdf4;
    --lwlb-radius-sm: 8px;
    --lwlb-radius: 16px;
    --lwlb-radius-lg: 24px;
    --lwlb-shadow-btn: 0 8px 30px var(--lwlb-green-glow);
    --lwlb-shadow-modal: 0 25px 70px rgba(13, 32, 64, 0.45);
    --lwlb-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --lwlb-duration: 0.28s;
}

/* ============================================================
   Floating Button
   ============================================================ */

.lwlb-floating-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99999 !important;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--lwlb-green) 0%, var(--lwlb-green-dark) 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--lwlb-shadow-btn);
    transition: transform var(--lwlb-duration) var(--lwlb-ease),
        box-shadow var(--lwlb-duration) var(--lwlb-ease);
    outline: none;
    padding: 0;
}

.lwlb-floating-btn:hover,
.lwlb-floating-btn:focus-visible {
    transform: scale(1.12) translateY(-3px);
    box-shadow: 0 16px 40px var(--lwlb-green-glow);
}

.lwlb-floating-btn:hover .lwlb-btn-label {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Pulse ring animation */
.lwlb-pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--lwlb-green);
    animation: lwlb-pulse 2.4s ease-out infinite;
    opacity: 0;
    pointer-events: none;
}

@keyframes lwlb-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* WA icon */
.lwlb-wa-icon {
    width: 30px;
    height: 30px;
    color: var(--lwlb-white);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

/* Tooltip label */
.lwlb-btn-label {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: var(--lwlb-navy);
    color: var(--lwlb-white);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    padding: 7px 14px;
    border-radius: var(--lwlb-radius-sm);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--lwlb-duration) var(--lwlb-ease),
        transform var(--lwlb-duration) var(--lwlb-ease);
    box-shadow: 0 4px 16px rgba(13, 32, 64, 0.25);
}

.lwlb-btn-label::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right: none;
    border-left-color: var(--lwlb-navy);
}

/* ============================================================
   Overlay
   ============================================================ */

.lwlb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(13, 32, 64, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: lwlb-fade-in var(--lwlb-duration) var(--lwlb-ease);
}

.lwlb-overlay.is-active {
    display: block;
}

@keyframes lwlb-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ============================================================
   Modal
   ============================================================ */

.lwlb-modal {
    display: none;
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 10000;
    width: 400px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    background: var(--lwlb-white);
    border-radius: var(--lwlb-radius-lg);
    box-shadow: var(--lwlb-shadow-modal);
    scrollbar-width: thin;
    scrollbar-color: var(--lwlb-gray-200) transparent;
}

.lwlb-modal.is-active {
    display: block;
    animation: lwlb-slide-up var(--lwlb-duration) var(--lwlb-ease);
    z-index: 9999999;

}

@keyframes lwlb-slide-up {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.lwlb-modal-inner {
    padding: 0;
}

/* ---- Header ---- */

.lwlb-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 52px 20px 24px;
    background: linear-gradient(135deg, var(--lwlb-navy) 0%, var(--lwlb-navy-light) 100%);
    border-radius: var(--lwlb-radius-lg) var(--lwlb-radius-lg) 0 0;
    position: relative;
}

.lwlb-modal-header.has-logo {
    flex-direction: column;
    text-align: center;
    padding: 40px 30px 30px;
    gap: 16px;
}

.lwlb-header-icon-wrap {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 50%;
    background: var(--lwlb-green);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px var(--lwlb-green-glow);
}

.lwlb-header-icon-wrap svg {
    width: 26px;
    height: 26px;
    color: var(--lwlb-white);
}

.lwlb-logo-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
}

.lwlb-header-brand-logo {
    max-width: 200px;
    max-height: 55px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.1));
}

.lwlb-modal-header h2 {
    font-size: 19px;
    font-weight: 700;
    color: var(--lwlb-white);
    margin: 0 0 4px;
    line-height: 1.3;
}

.lwlb-modal-header.has-logo h2 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.lwlb-modal-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    line-height: 1.5;
}

.lwlb-modal-header.has-logo .lwlb-modal-subtitle {
    font-size: 14px;
    max-width: 280px;
    margin: 0 auto;
}

/* ---- Close button ---- */

.lwlb-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--lwlb-gold);
    border: 2px solid var(--lwlb-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--lwlb-duration) var(--lwlb-ease);
    padding: 0;
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.lwlb-close-btn:hover,
.lwlb-close-btn:focus-visible {
    transform: scale(1.1) rotate(90deg);
    background: var(--lwlb-gold-light);
    box-shadow: 0 6px 18px rgba(240, 165, 0, 0.4);
}

.lwlb-close-btn svg {
    width: 14px;
    height: 14px;
    color: var(--lwlb-navy);
    stroke-width: 3.5;
}

/* ---- Form ---- */

.lwlb-form {
    padding: 22px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---- Field ---- */

.lwlb-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lwlb-field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--lwlb-navy);
    cursor: pointer;
}

.lwlb-field label svg {
    width: 14px;
    height: 14px;
    color: var(--lwlb-gold-dark);
    flex-shrink: 0;
}

.lwlb-req {
    color: var(--lwlb-error);
    font-weight: 700;
}

.lwlb-field input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--lwlb-gray-200);
    border-radius: var(--lwlb-radius-sm);
    font-size: 14px;
    color: var(--lwlb-navy);
    background: var(--lwlb-gray-50);
    transition: border-color var(--lwlb-duration) var(--lwlb-ease),
        box-shadow var(--lwlb-duration) var(--lwlb-ease),
        background var(--lwlb-duration) var(--lwlb-ease);
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

.lwlb-field input::placeholder {
    color: var(--lwlb-gray-400);
}

.lwlb-field input:focus {
    border-color: var(--lwlb-navy);
    background: var(--lwlb-white);
    box-shadow: 0 0 0 3px rgba(13, 32, 64, 0.1);
}

.lwlb-field.has-error input {
    border-color: var(--lwlb-error);
    background: var(--lwlb-error-bg);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.lwlb-field-error {
    font-size: 12px;
    color: var(--lwlb-error);
    font-weight: 500;
    min-height: 16px;
    display: block;
}

/* ---- Success box ---- */

.lwlb-success-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--lwlb-success-bg);
    border: 1.5px solid var(--lwlb-success);
    border-radius: var(--lwlb-radius-sm);
    color: #15803d;
    font-size: 14px;
    font-weight: 500;
    animation: lwlb-fade-in 0.3s var(--lwlb-ease);
}

.lwlb-success-box svg {
    width: 20px;
    height: 20px;
    color: var(--lwlb-success);
    flex-shrink: 0;
}

/* ---- Submit button ---- */

.lwlb-submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--lwlb-navy) 0%, var(--lwlb-navy-light) 100%);
    color: var(--lwlb-white);
    border: none;
    border-radius: var(--lwlb-radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform var(--lwlb-duration) var(--lwlb-ease),
        box-shadow var(--lwlb-duration) var(--lwlb-ease),
        background var(--lwlb-duration) var(--lwlb-ease);
    box-shadow: 0 4px 16px rgba(13, 32, 64, 0.3);
    outline: none;
    font-family: inherit;
    border-top: 2px solid var(--lwlb-gold);
    position: relative;
    overflow: hidden;
}

.lwlb-submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--lwlb-gold) 0%, var(--lwlb-gold-dark) 100%);
    opacity: 0;
    transition: opacity var(--lwlb-duration) var(--lwlb-ease);
}

.lwlb-submit-btn:hover::before,
.lwlb-submit-btn:focus-visible::before {
    opacity: 1;
}

.lwlb-submit-btn:hover,
.lwlb-submit-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(240, 165, 0, 0.4);
    color: var(--lwlb-navy);
}

.lwlb-submit-btn:active {
    transform: translateY(0);
}

.lwlb-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.lwlb-submit-text,
.lwlb-submit-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    justify-content: center;
}

.lwlb-submit-text svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Spinner */
.lwlb-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: var(--lwlb-white);
    border-radius: 50%;
    animation: lwlb-spin 0.7s linear infinite;
}

@keyframes lwlb-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---- Privacy note ---- */

.lwlb-privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 11.5px;
    color: var(--lwlb-gray-500);
    margin: 0;
    text-align: center;
}

.lwlb-privacy-note svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* ============================================================
   Mobile
   ============================================================ */

@media (max-width: 480px) {
    .lwlb-floating-btn {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }

    .lwlb-btn-label {
        display: none;
    }

    .lwlb-modal {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        border-radius: var(--lwlb-radius-lg) var(--lwlb-radius-lg) 0 0;
    }

    .lwlb-modal.is-active {
        animation: lwlb-slide-up-mobile var(--lwlb-duration) var(--lwlb-ease);
    }

    @keyframes lwlb-slide-up-mobile {
        from {
            opacity: 0;
            transform: translateY(100%);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .lwlb-form {
        padding: 20px 18px 32px;
    }

    .lwlb-modal-header {
        padding: 20px 48px 18px 18px;
    }
}