/**
 * Auth form – 1 bộ CSS dùng chung cho:
 * - Popup đăng nhập/đăng ký trang thanh toán (modal)
 * - Form inline trang tài khoản [woocommerce_my_account]
 * - Popup Flatsome #login-form-popup
 * Template chung: auth-form-inner.php
 */
/* Auth Modal Styles */
.vplugin-auth-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important; /* High z-index to ensure modal appears above header and all other elements */
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide modal by default - only show when JavaScript removes display: none */
.vplugin-auth-modal {
    display: none !important;
}

/* Show modal when display: none is removed */
.vplugin-auth-modal:not([style*="display: none"]) {
    display: flex !important;
}

/* Additional check for inline style with different formats */
.vplugin-auth-modal[style*="display:none"],
.vplugin-auth-modal[style*="display: none"] {
    display: none !important;
}

.vplugin-auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
    pointer-events: auto;
}

.vplugin-auth-modal-content {
    position: relative !important;
    background: #fff !important;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 2 !important;
    margin: 0 !important;
    pointer-events: auto !important;
    transform: translateZ(0);
}

.vplugin-auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
    text-decoration: none;
    outline: none;
}

.vplugin-auth-modal-close:hover {
    background: #333;
}

.vplugin-auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.vplugin-auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.vplugin-auth-logo-text {
    font-size: 24px;
    font-weight: bold;
    color: #1976d2;
}

.vplugin-auth-logo-box {
    font-size: 16px;
    font-weight: bold;
    color: #1976d2;
    border: 2px solid #1976d2;
    padding: 4px 8px;
    border-radius: 4px;
}

.vplugin-auth-title {
    font-size: 20px;
    font-weight: bold;
    color: #000;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.vplugin-auth-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.vplugin-auth-benefits {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    justify-content: center;
}
.vplugin-auth-form input {
    box-shadow: none !important;
}

/* Form auth dùng chung 1 bộ style (checkout modal + trang tài khoản + Flatsome popup) – ghi đè theme/Flatsome input */
.vplugin-auth-modal .vplugin-auth-input,
.vplugin-auth-inline .vplugin-auth-input,
.vplugin-auth-form-wrapper .vplugin-auth-input,
#login-form-popup .vplugin-auth-input {
    width: 100% !important;
    height: auto !important;
    min-height: 44px !important;
    padding: 12px 16px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 99px !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    background-color: #fff !important;
    color: #333 !important;
    font-size: 14px !important;
    transition: border-color 0.2s, color 0.2s, background 0.2s !important;
    vertical-align: middle !important;
    max-width: 100% !important;
}
.vplugin-auth-modal .vplugin-auth-input:focus,
.vplugin-auth-inline .vplugin-auth-input:focus,
.vplugin-auth-form-wrapper .vplugin-auth-input:focus,
#login-form-popup .vplugin-auth-input:focus {
    outline: none !important;
    border-color: #1976d2 !important;
}

.vplugin-auth-benefit-card {
    flex: 1;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}
@media (max-width: 849px) {
    .vplugin-auth-benefit-card{
        flex-direction: row;
        align-items: center;
    }
}
.vplugin-auth-benefit-icon {
    font-size: 24px;
    font-weight: bold;
    color: #1976d2;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vplugin-auth-benefit-icon svg {
    width: 24px;
    height: 24px;
    color: #1976d2;
}

.vplugin-auth-benefit-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
}

.vplugin-auth-benefit-text {
    font-size: 13px;
    color: #333;
    margin: 0;
    text-align: left;
    font-weight: 600;
}

.vplugin-auth-tabs {
    display: none; /* Hidden - tabs are implicit, users switch via links */
}

.vplugin-auth-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s;
}

.vplugin-auth-tab:hover {
    color: #1976d2;
}

.vplugin-auth-tab.active {
    color: #1976d2;
    border-bottom-color: #1976d2;
    font-weight: 600;
}

.vplugin-auth-tab-content {
    position: relative;
}

.vplugin-auth-tab-panel {
    display: none;
}

.vplugin-auth-tab-panel.active {
    display: block;
}

.vplugin-auth-prompt {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin: 0 0 20px 0;
}

/* Wrapper cho nội dung từ hook (Nextend Social Login, WooCommerce Social Login, ...) */
.vplugin-auth-social-login-wrapper {
    margin-bottom: 20px;
}

.vplugin-auth-social-login-wrapper .nsl-container,
.vplugin-auth-social-login-wrapper > div {
    margin-bottom: 12px;
}

.vplugin-auth-social-login {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.vplugin-auth-social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.vplugin-auth-social-btn:hover {
    border-color: #1976d2;
    background: #f5f5f5;
}

.vplugin-auth-social-btn svg {
    width: 20px;
    height: 20px;
}

.vplugin-auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    text-align: center;
}

.vplugin-auth-divider::before,
.vplugin-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.vplugin-auth-divider span {
    padding: 0 16px;
    font-size: 14px;
    color: #666;
}

.vplugin-auth-form {
    margin-bottom: 20px;
}

.vplugin-auth-form-row {
    display: flex;
    gap: 12px;
}

.vplugin-auth-form-group {
    position: relative;
    margin-bottom: 16px;
}

.vplugin-auth-form-group-half {
    flex: 1;
}

.vplugin-auth-password-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.vplugin-auth-input-wrapper {
    position: relative;
}

.vplugin-auth-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
    background: #fff;
}

.vplugin-auth-input:focus {
    outline: none;
    border-color: #1976d2;
}

.vplugin-auth-input:not(:placeholder-shown) {
    border-color: #1976d2;
}

.vplugin-auth-input:focus ~ .vplugin-auth-label-floating,
.vplugin-auth-input:not(:placeholder-shown) ~ .vplugin-auth-label-floating,
.vplugin-auth-label-floating.vplugin-label-active {
    top: 4px;
    transform: translateY(-50%) scale(0.8);
    color: #737373;
    padding: 0 8px;
}

.vplugin-auth-label-floating {
    position: absolute;
    left: 16px;
    top: 22px;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 400;
    color: #a3a3a3;
    background: #ffffff;
    padding: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 1;
}

.vplugin-auth-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.vplugin-auth-toggle-password {
    position: absolute;
    right: 0px;
    top: 40%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.vplugin-auth-toggle-password svg {
    width: 16px;
    height: 16px;
}

.vplugin-auth-eye-icon,
.vplugin-auth-eye-off-icon {
    display: block;
}

.vplugin-auth-submit-btn {
    width: 100%;
    padding: 8px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
}

.vplugin-auth-submit-btn:hover {
    background: #333;
}

/* Nút submit thống nhất – ghi đè theme khi form ở trang tài khoản / Flatsome popup */
.vplugin-auth-inline .vplugin-auth-submit-btn,
.vplugin-auth-form-wrapper .vplugin-auth-submit-btn,
#login-form-popup .vplugin-auth-submit-btn {
    width: 100% !important;
    padding: 12px 16px !important;
    background: #000 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 99px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    box-shadow: none !important;
    height: auto !important;
    min-height: 44px !important;
}
.vplugin-auth-inline .vplugin-auth-submit-btn:hover,
.vplugin-auth-form-wrapper .vplugin-auth-submit-btn:hover,
#login-form-popup .vplugin-auth-submit-btn:hover {
    background: #333 !important;
}

.vplugin-auth-submit-btn:disabled,
.vplugin-auth-submit-btn.vplugin-auth-btn-loading {
    cursor: not-allowed !important;
    opacity: 0.85;
}

.vplugin-auth-submit-btn.vplugin-auth-btn-loading {
    position: relative;
}

.vplugin-auth-submit-btn.vplugin-auth-btn-loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    vertical-align: middle;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: vplugin-auth-spin 0.7s linear infinite;
}

@keyframes vplugin-auth-spin {
    to { transform: rotate(360deg); }
}

.vplugin-auth-footer-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.vplugin-auth-link {
    color: #1976d2;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.vplugin-auth-link:hover {
    color: #1565c0;
    text-decoration: underline;
}

.vplugin-auth-forgot-title {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    margin: 0 0 24px 0;
    color: #000;
}

.vplugin-auth-forgot-desc {
    margin: 0 0 20px;
    font-size: 14px;
    color: #555;
    text-align: center;
}

a.vplugin-auth-forgot-link {
    display: block;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

.login-link {
    color: #1976d2;
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
    transition: color 0.2s;
}

.login-link:hover {
    color: #1565c0;
    text-decoration: underline;
}

@media (max-width: 849px) {
    /* Mobile/Tablet: Modal appears at bottom */
    .vplugin-auth-modal {
        align-items: flex-end !important;
        justify-content: center !important;
    }
    
    .vplugin-auth-modal-content {
        padding: 20px;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh !important;
        border-radius: 16px 16px 0 0 !important;
        margin: 0 !important;
        transform: translateY(0) !important;
        animation: slideUp 0.3s ease-out;
    }
    .vplugin-auth-benefit-card{
        padding: 8px;
        gap: 4px;
    }
    .vplugin-auth-benefit-icon{
        font-size: 15px;
        width: 25px;
        height: 25px;
    }
    .vplugin-auth-benefit-text{
        font-size: 11px;
        text-align: left;
    }
    .vplugin-auth-benefits {
        flex-direction: row;
        align-items: center;
    }
    
    .vplugin-auth-form-row {
        flex-direction: column;
    }
    
    .vplugin-auth-footer-links {
       
        gap: 10px;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Trang đặt lại mật khẩu (full page, đồng bộ auth modal) */
.vplugin-reset-password-page {
    max-width: 500px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.vplugin-reset-password-page .vplugin-reset-password-wrapper {
    margin: 0;
    max-height: none;
}
.vplugin-reset-password-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.vplugin-reset-password-message.vplugin-reset-password-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.vplugin-reset-password-message.vplugin-reset-password-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.vplugin-reset-password-message a.vplugin-auth-submit-btn {
    display: inline-block;
    margin-top: 12px;
    text-decoration: none;
    text-align: center;
}

/* Ẩn tab/panel Đăng ký khi WooCommerce tắt đăng ký (trang tài khoản / Flatsome popup) */
.vplugin-auth-hide-register .vplugin-auth-tab[data-tab="register"],
.vplugin-auth-hide-register #vplugin-auth-tab-register {
    display: none !important;
}
.vplugin-auth-hide-register .vplugin-auth-footer-links a[data-tab="register"] {
    display: none;
}

/* Form inline (trang tài khoản [woocommerce_my_account] + Flatsome #login-form-popup) */
.vplugin-auth-inline.vplugin-auth-form-wrapper {
    max-width: 500px;
    margin: 0 auto;
    padding: 16px 0;
}
#login-form-popup .vplugin-auth-inline.vplugin-auth-form-wrapper {
    padding: 8px 0;
}


