/*
 * CSS for Popup Account Plugin - Login Page Styler
 * Version: 2.3 (Mobile Fix + Hide Language Widget)
 * Design: Modern Gradient
 */

/* ========================================= */
/* 1. RESET BODY WP-LOGIN.PHP                */
/* ========================================= */

/* Reset cơ bản cho Body của trang Login để căn giữa trên Desktop */
body.login {
    background-color: rgba(0, 0, 0, 0.6) !important; /* Giống overlay popup */
    background-image: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh; /* Dùng min-height thay vì height cứng để tránh lỗi */
    margin: 0;
    padding: 20px;
    font-family: 'Segoe UI', sans-serif;
    box-sizing: border-box;
    position: relative;
}

/* Ẩn giao diện WP gốc (Form mặc định) */
#login {
    display: none !important;
}

/* ========================================= */
/* 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%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --text-main: #333;
    --text-light: #666;

    width: 100%;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
}

.pap-wrapper * {
    box-sizing: border-box;
}

/* 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: 900px; /* Kích thước chuẩn cho desktop */
    max-width: 100%;
    min-height: 500px;
    display: flex;
    flex-direction: row;
}

/* ========================================= */
/* 3. LEFT SIDE: BANNER                      */
/* ========================================= */

.pap-banner-side {
    flex: 1;
    /* Màu mặc định, JS sẽ đổi màu tùy ngữ cảnh */
    background: var(--primary-gradient);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
}

.pap-banner-side h1 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #fff;
    line-height: 1.2;
    font-weight: 700;
    text-transform: none;
    border: none;
    padding: 0;
}

.pap-banner-side p {
    font-size: 1rem;
    line-height: 1.5;
    opacity: 0.9;
    color: #fff;
    margin-bottom: 0;
}

/* ========================================= */
/* 4. RIGHT SIDE: FORM AREA                  */
/* ========================================= */

.pap-form-side {
    flex: 1.2;
    padding: 40px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
    position: relative;
}

/* Tùy biến Form của WordPress */
.pap-form-side form {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.pap-form-side label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Input styles - Override mạnh để tránh xung đột theme */
.pap-form-side input[type="text"],
.pap-form-side input[type="password"],
.pap-form-side input[type="email"] {
    width: 100% !important;
    padding: 12px 15px !important;
    background-color: #f1f3f6 !important;
    border: 1px solid #f1f3f6 !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    margin-bottom: 20px !important;
    color: var(--text-main) !important;
    box-shadow: none !important;
    height: auto !important;
    line-height: normal !important;
    transition: all 0.3s ease;
}

.pap-form-side input:focus {
    background-color: #fff !important;
    border-color: #fa709a !important; /* Màu focus */
    box-shadow: 0 0 0 3px rgba(250, 112, 154, 0.1) !important;
    outline: none;
}

/* Checkbox "Ghi nhớ" */
.pap-form-side .forgetmenot {
    float: none !important;
    margin-bottom: 20px !important;
    display: flex;
    align-items: center;
}

.pap-form-side input[type="checkbox"] {
    margin: 0 10px 0 0 !important;
    border-radius: 4px !important;
    border: 1px solid #ddd !important;
    height: 18px !important;
    width: 18px !important;
    background: #f1f3f6 !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
}
.pap-form-side input[type="checkbox"]:checked {
    background: #fa709a !important;
    border-color: #fa709a !important;
}
.pap-form-side input[type="checkbox"]:focus {
    box-shadow: none !important;
    outline: none !important;
}

/* Nút bấm (Submit button) */
.pap-form-side .wp-block-button__link,
.pap-form-side .button-primary,
.pap-form-side .button-group .button {
    display: block !important;
    width: 100% !important;
    padding: 14px !important;
    /* Gradient mặc định */
    background: var(--primary-gradient) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    text-shadow: none !important;
    margin: 10px 0 0 0 !important;
    float: none !important;
    height: auto !important;
    cursor: pointer;
    transition: opacity 0.2s;
    text-transform: none !important;
}

.pap-form-side .button-primary:hover {
    opacity: 0.95;
}

/* Các link phụ (Footer links) */
.pap-form-footer {
    margin-top: 25px;
    text-align: center;
}

.pap-form-footer .nav,
.pap-form-footer #backtoblog {
    margin: 10px 0 !important;
    padding: 0 !important;
    font-size: 0.9rem;
    color: var(--text-light);
}

.pap-form-footer a {
    color: var(--text-light) !important;
    text-decoration: none !important;
    transition: color 0.2s;
}

.pap-form-footer a:hover {
    color: #fa709a !important;
    text-decoration: underline !important;
}

/* Thông báo lỗi/thành công của WP */
.login .message, .login .notice, .login .error {
    border-left: 4px solid #00a32a;
    padding: 15px;
    margin: 0 0 25px 0 !important;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

.login .error {
    border-left-color: #d63638;
    background-color: #fff0f0;
}

.login .message {
    border-left-color: #46b450;
    background-color: #f0f9eb;
}

/* ========================================= */
/* 5. MOBILE RESPONSIVE (FIX LỖI)            */
/* ========================================= */

@media (max-width: 768px) {
    /* 1. Quan trọng: Reset body login trên mobile 
       Hủy chế độ flex center dọc để cho phép cuộn trang khi nội dung dài */
    body.login {
        display: block !important; 
        height: auto !important;
        min-height: 100vh;
        padding: 20px 10px;
        overflow-y: auto !important; 
    }

    /* 2. Container chuyển thành cột dọc */
    .pap-container {
        flex-direction: column;
        width: 100% !important;
        max-width: 450px;
        height: auto !important;
        min-height: auto !important;
        margin: 0 auto 30px auto; /* Thêm margin bottom để không sát đáy */
    }

    /* 3. Banner trên mobile */
    .pap-banner-side {
        padding: 30px 20px;
        flex: none; /* Không co giãn */
        width: 100%;
        min-height: 120px; /* Đảm bảo độ cao tối thiểu */
    }

    .pap-banner-side h1 {
        font-size: 1.6rem;
        margin-bottom: 10px;
    }

    /* 4. Form bên dưới */
    .pap-form-side {
        padding: 30px 25px;
        flex: none;
        width: 100%;
    }
}

/* ========================================= */
/* 6. ẨN WIDGET NGÔN NGỮ                     */
/* ========================================= */

/* * Ẩn các thành phần dịch thuật của bên thứ 3 (GTranslate, Google Translate)
 * CHỈ TRÊN TRANG LOGIN để không che khuất giao diện 
 */
body.login .gtranslate_wrapper,
body.login #google_translate_element,
body.login .skiptranslate,
body.login .goog-te-banner-frame,
body.login #goog-gt-tt,
body.login .goog-te-balloon-frame {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    z-index: -9999 !important;
    opacity: 0 !important;
}

/* Đảm bảo body không bị đẩy xuống bởi thanh top bar của Google Translate */
body.login {
    top: 0 !important;
    position: static !important;
}