/* * CSS for Popup Account Plugin 
 * Version: 2.0 (Hybrid: Supports both Popup & Embedded Forms)
 * Design: Modern Gradient (Reference Image 03)
 */

/* ========================================= */
/* 1. POPUP OVERLAY & ANIMATION              */
/* ========================================= */

.pap-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Nền tối mờ */
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pap-popup-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Nút tắt popup (X) */
.pap-close-popup {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    color: #999;
    cursor: pointer;
    z-index: 1000;
    background: none;
    border: none;
    line-height: 1;
    padding: 0;
}

.pap-close-popup:hover {
    color: #333;
}

/* Hiệu ứng Zoom-in khi mở popup */
.pap-popup-overlay .pap-container {
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.pap-popup-overlay.is-visible .pap-container {
    transform: scale(1);
}

/* ========================================= */
/* 2. BASE LAYOUT & WRAPPER                  */
/* ========================================= */

.pap-wrapper {
    /* Khai báo biến màu */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    --google-border: #dadce0;
    --facebook-bg: #1877f2;
    --text-main: #333;
    --text-light: #666;
    
    font-family: 'Segoe UI', sans-serif;
    width: 100%;
    display: flex;
    justify-content: center;
    
    /* Margin mặc định cho form nhúng (Embedded) */
    margin: 30px 0; 
}

/* Reset margin khi wrapper nằm trong popup */
.pap-popup-overlay .pap-wrapper {
    margin: 0;
}

.pap-wrapper * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.pap-wrapper a {
    text-decoration: none !important;
    box-shadow: none !important;
}

/* Container chính chứa 2 cột */
.pap-container {
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 14px 28px rgba(0,0,0,0.2), 0 10px 10px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    width: 1000px;
    max-width: 100%;
    min-height: 600px;
    display: flex;
}

/* ========================================= */
/* 3. LEFT SIDE: BANNER                      */
/* ========================================= */

.pap-banner-side {
    flex: 1;
    background: var(--primary-gradient);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
    transition: background 0.5s ease;
}

.pap-banner-side h1 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    color: #fff;
    line-height: 1.2;
    font-weight: 700;
}

.pap-banner-side p {
    font-size: 1rem;
    line-height: 1.5;
    opacity: 0.9;
    color: #fff;
}

/* ========================================= */
/* 4. RIGHT SIDE: FORM AREA                  */
/* ========================================= */

.pap-form-side {
    flex: 1.2;
    padding: 40px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    background: #fff;
}

.pap-form-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pap-form-side h2 {
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 5px;
    text-align: center;
    font-weight: 700;
}

.pap-sub-title {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 25px;
    font-size: 0.9rem;
}

/* ========================================= */
/* 5. INPUT FIELDS                           */
/* ========================================= */

.pap-input-group {
    margin-bottom: 15px;
    width: 100%;
}

/* Sử dụng !important để ghi đè style của Theme/WooCommerce */
.pap-wrapper input.input-text,
.pap-wrapper input[type="text"],
.pap-wrapper input[type="email"],
.pap-wrapper input[type="password"],
.pap-wrapper input[type="tel"] {
    width: 100% !important;
    padding: 12px 15px !important;
    background-color: #f1f3f6 !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    font-size: 0.95rem !important;
    transition: all 0.3s;
    height: auto !important;
    color: #333 !important;
    box-shadow: none !important;
    margin: 0 !important;
    line-height: normal !important;
}

.pap-wrapper input:focus {
    background-color: #fff !important;
    border-color: #764ba2 !important;
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.1) !important;
    outline: none;
}

/* ========================================= */
/* 6. MAIN ACTION BUTTONS                    */
/* ========================================= */

.pap-submit-btn,
.woocommerce .pap-submit-btn.button {
    display: block !important;
    width: 100% !important;
    padding: 12px !important;
    background: var(--primary-gradient) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    margin-top: 10px !important;
    text-align: center !important;
    transition: opacity 0.2s;
    height: auto !important;
    line-height: 1.5 !important;
    float: none !important;
}

.pap-submit-btn:hover,
.woocommerce .pap-submit-btn.button:hover {
    opacity: 0.9;
    color: #fff !important;
    background: var(--primary-gradient) !important;
}

/* ========================================= */
/* 7. SOCIAL BUTTONS & DIVIDER               */
/* ========================================= */

.pap-divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: var(--text-light);
    font-size: 0.85rem;
    width: 100%;
}

.pap-divider::before,
.pap-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.pap-divider span {
    padding: 0 10px;
    white-space: nowrap;
}

.pap-social-btn {
    width: 100% !important;
    padding: 10px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 10px !important;
    cursor: pointer;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    border: 1px solid transparent;
    height: auto !important;
    line-height: 1.5 !important;
    transition: background 0.2s;
}

.pap-social-btn:active {
    transform: scale(0.98);
}

.pap-social-btn svg {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

/* Google Style */
.pap-btn-google {
    background-color: #fff !important;
    border-color: var(--google-border) !important;
    color: var(--text-main) !important;
}
.pap-btn-google:hover {
    background-color: #f8f9fa !important;
}

/* Facebook Style */
.pap-btn-facebook {
    background-color: var(--facebook-bg) !important;
    border-color: var(--facebook-bg) !important;
    color: #fff !important;
}
.pap-btn-facebook:hover {
    background-color: #166fe5 !important;
}
.pap-btn-facebook svg path {
    fill: #fff;
}

/* ========================================= */
/* 8. FOOTER & UTILITIES                     */
/* ========================================= */

.pap-form-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

.pap-highlight {
    color: #764ba2;
    cursor: pointer;
    font-weight: 600;
}

.pap-hidden {
    display: none !important;
}

/* Fix hiển thị lỗi WooCommerce trong form */
.woocommerce-error,
.woocommerce-message,
.pap-register-error {
    list-style: none !important;
    padding: 10px 15px !important;
    margin-bottom: 15px !important;
    border-radius: 5px;
    font-size: 0.9rem !important;
    width: 100%;
}

.woocommerce-error,
.pap-register-error {
    background: #fff0f0 !important;
    border-left: 4px solid #d63638 !important;
    color: #d63638 !important;
}

.woocommerce-message {
    background: #f0f9eb !important;
    border-left: 4px solid #46b450 !important;
    color: #333 !important;
}

/* ========================================= */
/* 9. TRIGGER BUTTONS (SHORTCODE)            */
/* ========================================= */

.pap-trigger-wrapper {
    display: inline-flex;
    gap: 15px;
    align-items: center;
}

.pap-trigger-btn {
    padding: 10px 25px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    display: inline-block;
    transition: opacity 0.2s;
}

.pap-trigger-login-btn {
    background: #000;
    color: #fff;
    border: 1px solid #000;
}
.pap-trigger-login-btn:hover {
    background: #333;
    color: #fff;
}

.pap-trigger-register-btn {
    background: #fff;
    color: #000;
    border: 1px solid #000;
}
.pap-trigger-register-btn:hover {
    background: #f0f0f0;
    color: #000;
}

/* ========================================= */
/* 10. MOBILE RESPONSIVE                     */
/* ========================================= */

@media (max-width: 768px) {
    .pap-container {
        flex-direction: column;
        width: 95%;
        height: auto;
        min-height: auto;
        /* Cho phép cuộn nếu màn hình quá ngắn */
        max-height: 90vh;
        overflow-y: auto;
    }

    .pap-banner-side {
        padding: 20px;
        min-height: 120px;
    }

    .pap-banner-side h1 {
        font-size: 1.5rem;
    }

    .pap-banner-side p {
        display: none; /* Ẩn mô tả cho gọn */
    }

    .pap-form-side {
        padding: 30px 20px;
    }

    /* Đưa nút đóng lên góc banner khi ở mobile */
    .pap-close-popup {
        color: #fff;
        top: 15px;
        right: 15px;
    }
}