/* ===========================================
   HF WhatsApp Chat Popup - Premium Design
   =========================================== */

.hf-cp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: hfCpFadeIn 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@keyframes hfCpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes hfCpSlideUp {
    from { transform: translateY(30px) scale(0.96); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.hf-cp-modal {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
    animation: hfCpSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

/* Custom scrollbar */
.hf-cp-modal::-webkit-scrollbar { width: 6px; }
.hf-cp-modal::-webkit-scrollbar-track { background: transparent; }
.hf-cp-modal::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

.hf-cp-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    color: #1a1a1a;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    padding: 0;
}

.hf-cp-close:hover {
    background: #f3f4f6;
    transform: rotate(90deg);
}

/* Header with gradient */
.hf-cp-header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    padding: 32px 32px 28px;
    text-align: center;
    color: #fff;
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}

.hf-cp-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.hf-cp-header::after {
    content: '';
    position: absolute;
    bottom: -60%;
    left: -10%;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.hf-cp-wa-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    color: #fff;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.hf-cp-wa-icon svg {
    width: 30px;
    height: 30px;
}

.hf-cp-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.hf-cp-tagline {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

/* Form */
.hf-cp-form {
    padding: 24px 28px 24px;
}

.hf-cp-field {
    margin-bottom: 14px;
    position: relative;
}

.hf-cp-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.hf-cp-req {
    color: #ef4444;
    margin-left: 2px;
}

.hf-cp-optional {
    color: #9ca3af;
    font-weight: 400;
    font-size: 12px;
}

.hf-cp-row {
    display: flex;
    gap: 12px;
}

.hf-cp-col {
    flex: 1;
    min-width: 0;
}

.hf-cp-input-wrap {
    position: relative;
}

.hf-cp-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    z-index: 1;
    display: flex;
}

.hf-cp-field input[type="text"],
.hf-cp-field input[type="tel"],
.hf-cp-field input[type="email"],
.hf-cp-field select,
.hf-cp-field textarea {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.2s;
    background: #fff;
    color: #1f2937;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.hf-cp-field textarea {
    padding: 12px 14px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.hf-cp-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 7.5L0.5 1.5L1.91 0.09L6 4.17L10.09 0.09L11.5 1.5L6 7.5Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.hf-cp-field input::placeholder,
.hf-cp-field textarea::placeholder {
    color: #9ca3af;
}

.hf-cp-field input:hover,
.hf-cp-field select:hover,
.hf-cp-field textarea:hover {
    border-color: #d1d5db;
}

.hf-cp-field input:focus,
.hf-cp-field select:focus,
.hf-cp-field textarea:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.12);
}

/* Phone field with intl-tel-input */
.hf-cp-phone-field .iti {
    width: 100%;
    display: block;
}

.hf-cp-phone-field .iti__flag-container {
    background: transparent;
}

.hf-cp-phone-field .iti__selected-flag {
    padding: 0 10px 0 14px;
    background: #f9fafb !important;
    border-radius: 10px 0 0 10px;
    border-right: 1px solid #e5e7eb;
}

.hf-cp-phone-field .iti--allow-dropdown:hover .iti__flag-container .iti__selected-flag,
.hf-cp-phone-field .iti--allow-dropdown input.iti__tel-input + .iti__flag-container:hover .iti__selected-flag {
    background: #f3f4f6 !important;
}

.hf-cp-phone-field .iti__arrow {
    border-top-color: #6b7280;
}

.hf-cp-phone-field .iti--allow-dropdown input.iti__tel-input {
    padding-left: 70px !important;
}

.hf-cp-phone-field .iti__country-list {
    max-height: 220px;
    z-index: 1000000;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* Honeypot */
.hf-cp-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.hf-cp-submit-wrap {
    margin-top: 18px;
}

.hf-cp-submit {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.6px;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
    position: relative;
    overflow: hidden;
}

.hf-cp-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #128C7E 0%, #075E54 100%);
    opacity: 0;
    transition: opacity 0.25s;
}

.hf-cp-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.5);
}

.hf-cp-submit:hover:not(:disabled)::before {
    opacity: 1;
}

.hf-cp-submit:active:not(:disabled) {
    transform: translateY(0);
}

.hf-cp-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.hf-cp-wa-btn-icon,
.hf-cp-btn-text,
.hf-cp-spinner {
    position: relative;
    z-index: 1;
}

.hf-cp-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hfCpSpin 0.7s linear infinite;
}

@keyframes hfCpSpin {
    to { transform: rotate(360deg); }
}

.hf-cp-trust {
    text-align: center;
    margin: 14px 0 0;
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.hf-cp-trust svg {
    color: #25D366;
}

.hf-cp-response {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    display: none;
    line-height: 1.5;
    text-align: center;
    font-weight: 500;
}

.hf-cp-response.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
    display: block;
}

.hf-cp-response.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    display: block;
}

/* Shortcode trigger button */
.hf-cp-trigger {
    display: inline-flex;
    align-items: center;
    padding: 12px 26px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
}

.hf-cp-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.5);
    color: #fff;
}

/* Mobile */
@media (max-width: 600px) {
    .hf-cp-overlay {
        padding: 10px;
    }
    .hf-cp-modal {
        max-height: 95vh;
        border-radius: 16px;
    }
    .hf-cp-header {
        padding: 26px 22px 22px;
        border-radius: 16px 16px 0 0;
    }
    .hf-cp-wa-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 12px;
    }
    .hf-cp-wa-icon svg {
        width: 26px;
        height: 26px;
    }
    .hf-cp-header h2 {
        font-size: 20px;
    }
    .hf-cp-tagline {
        font-size: 13px;
    }
    .hf-cp-form {
        padding: 20px 22px;
    }
    .hf-cp-row {
        flex-direction: column;
        gap: 0;
    }
    .hf-cp-field input,
    .hf-cp-field select,
    .hf-cp-field textarea {
        font-size: 14px;
    }
    .hf-cp-submit {
        padding: 13px 20px;
    }
}
