/* Promotional Popup Styles
 * Modal popup for promotional campaigns on PMP English website
 * Requirements: 1.2, 1.7, 6.2, 6.4, 6.5, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6
 */

/* Body scroll lock when popup is open (Req 7.5) */
body.popup-open {
    overflow: hidden;
}

/* Modal Overlay (Req 1.2) */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Popup Container (Req 7.1, 7.2) */
.popup-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    z-index: 100000;
    animation: popupFadeIn 0.25s ease-out;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Close Button (Req 1.7, 7.4) */
.popup-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #506786;
    transition: background 0.2s ease, color 0.2s ease;
    z-index: 1;
}

.popup-close-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #102a43;
}

/* Popup Title */
.popup-title {
    margin: 0 0 16px;
    padding-right: 40px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #102a43;
    line-height: 1.4;
}

/* Popup Image (Req 6.2) */
.popup-image {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 16px;
}

/* Popup Content (HTML content area) */
.popup-content {
    margin-bottom: 16px;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #39526f;
}

.popup-content p {
    margin: 0 0 10px;
}

.popup-content p:last-child {
    margin-bottom: 0;
}

/* CTA Buttons Container */
.popup-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

/* CTA Button Base */
.popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    line-height: 1.4;
}

.popup-btn:hover {
    transform: translateY(-2px);
}

/* Primary CTA Button (Req 6.4) */
.popup-btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
    color: #ffffff;
    font-weight: 700;
    border: none;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.popup-btn-primary:hover {
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35);
    color: #ffffff;
}

/* Secondary CTA Button (Req 6.5) */
.popup-btn-secondary {
    background: #ffffff;
    color: #2563eb;
    font-weight: 700;
    border: 2px solid #2563eb;
}

.popup-btn-secondary:hover {
    background: #f0f7ff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
    color: #2563eb;
}

/* Mobile Responsive (Req 7.2, 7.3, 7.6) */
@media (max-width: 767px) {
    .popup-container {
        width: 90%;
        max-width: 90%;
        padding: 20px;
        border-radius: 14px;
    }

    .popup-title {
        font-size: 1.1rem;
    }

    .popup-content {
        font-size: 14px;
    }

    /* Buttons stack vertically on mobile (Req 7.3) */
    .popup-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .popup-btn {
        width: 100%;
        min-height: 44px;
        font-size: 14px;
    }

    /* Minimum font-size 14px on mobile (Req 7.6) */
    .popup-container {
        font-size: 14px;
    }
}


/* ============================================
 * Lead Form Widget Styles
 * Popup form for lead capture campaigns
 * Requirements: 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8
 * ============================================ */

/* Form container */
.popup-lead-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Form group (label + input + error) */
.popup-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Form label */
.popup-form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #102a43;
    line-height: 1.4;
}

/* Required field indicator (*) */
.popup-field-required {
    color: #dc2626;
    font-weight: 700;
}

/* Form inputs: text, email, tel, select, textarea */
.popup-form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #102a43;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.popup-form-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.popup-form-input::placeholder {
    color: #9ca3af;
}

/* Select dropdown specific */
.popup-form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23506786' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Textarea specific */
.popup-form-textarea {
    resize: vertical;
    min-height: 72px;
}

/* Field validation error message */
.popup-field-error {
    font-size: 0.8rem;
    color: #dc2626;
    line-height: 1.3;
    margin-top: 2px;
}

/* Form-level submission error */
.popup-form-error {
    font-size: 0.85rem;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 8px 12px;
    text-align: center;
}

/* Submit button "Gửi" — primary gradient style (Req 3.7) */
.popup-form-submit-btn {
    width: 100%;
    margin-top: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
}

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

/* Input with error state */
.popup-form-input.has-error {
    border-color: #dc2626;
}

.popup-form-input.has-error:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Thank you message */
.popup-thank-you {
    text-align: center;
    padding: 24px 16px;
}

.popup-thank-you p {
    font-size: 1rem;
    color: #059669;
    font-weight: 600;
    line-height: 1.6;
    margin: 0;
}

/* Mobile responsive for form */
@media (max-width: 767px) {
    .popup-lead-form {
        gap: 12px;
    }

    .popup-form-input {
        font-size: 14px;
        padding: 10px 12px;
    }

    .popup-form-submit-btn {
        min-height: 44px;
        font-size: 14px;
    }
}
