/* ==========================================================================
   WPSP PRO - LUXURY FORM STYLES (OPTIMIZED FOR RESPONSIVE)
   ========================================================================== */

/* --- 1. Biến CSS  --- */
:root {
    --wpsp-bg-color: #ffffff;
    --wpsp-text-main: #111111;
    --wpsp-text-muted: #777777;
    --wpsp-border-color: #e5e5e5;
    --wpsp-accent-color: #c5a880;
    --wpsp-btn-bg: #111111;
    --wpsp-btn-text: #ffffff;
    --wpsp-overlay-bg: rgba(0, 0, 0, 0.75);
}

body.dark-mode .wpsp-modal,
body.dark-theme .wpsp-modal,
[data-theme="dark"] .wpsp-modal {
    --wpsp-bg-color: #1a1a1a;
    --wpsp-text-main: #ffffff;
    --wpsp-text-muted: #aaaaaa;
    --wpsp-border-color: #333333;
    --wpsp-btn-bg: #ffffff;
    --wpsp-btn-text: #1a1a1a;
}

/* --- 2. Overlay & Hiệu ứng xuất hiện --- */
.wpsp-overlay { 
    position: fixed; 
    top: 0; left: 0; width: 100%; height: 100%; 
    background: var(--wpsp-overlay-bg); 
    backdrop-filter: blur(8px); 
    z-index: 99999; 
    display: flex; align-items: center; justify-content: center; 
    padding: 20px; /* Thêm padding để popup không chạm mép màn hình */
    box-sizing: border-box;
}

@keyframes wpspFadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.wpsp-modal { 
    background: var(--wpsp-bg-color); 
    color: var(--wpsp-text-main);
    width: 100%; 
    max-width: 900px; 
    max-height: 90vh; /* Giới hạn chiều cao để không bị tràn màn hình */
    overflow-y: auto; /* Cho phép cuộn dọc nếu nội dung dài */
    position: relative; 
    padding: clamp(40px, 6vw, 60px); 
    box-sizing: border-box; 
    border-radius: 4px; /* Bo góc nhẹ cho sang */
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    animation: wpspFadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Tùy chỉnh thanh cuộn cho Popup (Webkit) */
.wpsp-modal::-webkit-scrollbar {
    width: 6px;
}
.wpsp-modal::-webkit-scrollbar-thumb {
    background: var(--wpsp-border-color);
    border-radius: 10px;
}

/* Nút Close thanh mảnh */
.wpsp-close { 
    position: absolute; 
    top: 20px; right: 25px; 
    font-size: 24px; 
    font-weight: 300;
    cursor: pointer; 
    color: var(--wpsp-text-muted); 
    transition: all 0.4s ease;
    z-index: 10; 
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
}
.wpsp-close:hover { 
    color: var(--wpsp-accent-color); 
    transform: rotate(90deg); 
}

/* --- 3. Header & Slogan --- */
.wpsp-header { 
    text-align: center; 
    margin-bottom: clamp(30px, 5vw, 50px); 
}
.wpsp-header h2 { 
    margin: 0; 
    font-size: clamp(1.5rem, 3vw, 2.25rem); 
    font-weight: 400; 
    text-transform: uppercase; 
    letter-spacing: 4px; 
    color: var(--wpsp-text-main); 
    font-family: 'Mollie Glaston', serif;
}
.wpsp-slogan { 
    margin: 15px 0 0 0; 
    font-size: clamp(0.85rem, 2vw, 0.9rem); 
    color: var(--wpsp-text-muted); 
    font-style: italic; 
    letter-spacing: 2px; 
}

/* --- 4. Cấu trúc chia cột (Split Layout) --- */
.wpsp-body { 
    display: flex; 
    gap: clamp(40px, 6vw, 60px); 
}
.wpsp-col-left { 
    flex: 1; 
    padding-right: clamp(0px, 4vw, 40px); 
    border-right: 1px solid var(--wpsp-border-color); 
}
.wpsp-col-right { 
    flex: 1.2; 
}
.wpsp-col-title { 
    font-size: 13px; 
    font-weight: 600; 
    text-transform: uppercase; 
    margin-bottom: 30px; 
    color: var(--wpsp-text-muted); 
    letter-spacing: 2px; 
}

/* --- 5. Cột trái: Thông tin liên hệ & Social --- */
.wpsp-contact-info { 
    list-style: none; padding: 0; margin: 0 0 40px 0; 
}
.wpsp-contact-info li { 
    display: flex; 
    align-items: flex-start; 
    margin-bottom: 20px; 
    font-size: 15px; 
    color: var(--wpsp-text-main); 
    line-height: 1.8; 
}
.wpsp-contact-info li i { 
    margin-right: 18px; 
    margin-top: 6px; 
    color: var(--wpsp-accent-color); 
    font-size: 16px; 
}

.wpsp-socials { 
    display: flex; gap: 12px; flex-wrap: wrap;
}
.wpsp-socials a { 
    display: inline-flex; align-items: center; justify-content: center; 
    width: 42px; height: 42px; 
    border: 1px solid var(--wpsp-border-color); 
    border-radius: 50%;
    color: var(--wpsp-text-main); 
    text-decoration: none; 
    font-size: 15px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
}
.wpsp-socials a:hover { 
    background: var(--wpsp-accent-color); 
    color: #fff; 
    border-color: var(--wpsp-accent-color); 
    transform: translateY(-3px);
}

/* --- 6. Cột phải: Form nhập liệu phong cách Flushed --- */
.wpsp-fields-group { 
    display: flex; flex-direction: column; gap: 25px; 
}

.wpsp-input-wrap input, 
.wpsp-input-wrap textarea { 
    width: 100%; 
    padding: 12px 0; 
    border: none; 
    border-bottom: 1px solid var(--wpsp-border-color); 
    background: transparent; 
    font-size: 16px; /* QUAN TRỌNG: 16px để chống auto-zoom bàn phím trên iOS */
    color: var(--wpsp-text-main);
    font-family: inherit; 
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    box-sizing: border-box; 
    border-radius: 0;
    -webkit-appearance: none; /* Reset style trên Safari */
}

.wpsp-input-wrap textarea {
    resize: vertical;
    padding-top: 15px;
    min-height: 80px;
}

.wpsp-input-wrap input:focus, 
.wpsp-input-wrap textarea:focus { 
    outline: none; 
    border-bottom: 2px solid var(--wpsp-text-main);
    padding-left: 15px;
    background-color: rgba(11, 11, 11, 0.03);
    border-radius: 6px 6px 0 0;
}

.wpsp-input-wrap input::placeholder, 
.wpsp-input-wrap textarea::placeholder {
    color: var(--wpsp-text-muted);
    opacity: 0.6;
    font-weight: 300;
}

body.dark-mode .wpsp-input-wrap input:focus,
body.dark-theme .wpsp-input-wrap input:focus,
[data-theme="dark"] .wpsp-input-wrap input:focus,
body.dark-mode .wpsp-input-wrap textarea:focus,
body.dark-theme .wpsp-input-wrap textarea:focus,
[data-theme="dark"] .wpsp-input-wrap textarea:focus {
    background-color: rgba(255, 255, 255, 0.04);
}

/* Nút Submit */
.wpsp-submit-btn { 
    width: 100%; 
    background: var(--wpsp-btn-bg); 
    color: var(--wpsp-btn-text); 
    border: none; 
    padding: 18px; 
    text-transform: uppercase; 
    font-size: 13px; 
    font-weight: 600; 
    letter-spacing: 2px; 
    cursor: pointer; 
    transition: all 0.4s ease; 
    margin-top: 20px; 
    border-radius: 2px;
}
.wpsp-submit-btn:hover:not(:disabled) { 
    background: var(--wpsp-accent-color); 
    color: #fff; 
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.wpsp-submit-btn:disabled { 
    background: var(--wpsp-border-color); 
    color: var(--wpsp-text-muted);
    cursor: not-allowed; 
}

/* Thông báo phản hồi */
.wpsp-response {
    font-size: 14px;
    text-align: center;
    padding-top: 15px;
    font-weight: 500;
}

/* --- 7. Tương thích Mobile & Tablet --- */
@media (max-width: 992px) {
    .wpsp-body { flex-direction: column; gap: 40px; }
    .wpsp-col-left { 
        padding-right: 0; 
        border-right: none; 
        border-bottom: 1px dashed var(--wpsp-border-color); 
        padding-bottom: 30px; 
    }
    
    /* Căn giữa phần liên hệ trên mobile để form nhìn cân đối hơn */
    .wpsp-col-title { text-align: center; }
    .wpsp-contact-info li { justify-content: center; }
    .wpsp-socials { justify-content: center; }
}

@media (max-width: 576px) {
    .wpsp-modal { 
        padding: 40px 20px; 
        max-height: 85vh; /* Nhường chỗ cho bàn phím ảo đẩy lên */
    }
    .wpsp-header h2 { font-size: 20px; letter-spacing: 2px; }
    .wpsp-close { top: 15px; right: 15px; }
}